Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2051: Running unit tests from DUB single file packages fails #2052

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

drug007
Copy link
Contributor

@drug007 drug007 commented Dec 2, 2020

Performing test command dub imports every source file as module to build the project excluding the main source file. But this excluding may fail and in this case dub try to import the main source file as module. Single file package building fails because the main source file does not belong to any import path. Now both the current file and the main source file paths are compared in relative form to prevent importing the main source file as module.

@dlang-bot dlang-bot added the WIP label Dec 2, 2020
@dlang-bot
Copy link
Collaborator

Thanks for your pull request and interest in making D better, @drug007! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

@drug007 drug007 force-pushed the fix-2051-main-source-file branch 4 times, most recently from ec3b222 to 1af6845 Compare December 2, 2020 11:59
Performing test command dub imports every source file as module to build the project excluding the main source file. But this excluding may fail and in this case dub try to import the main source file as module. Single file package building fails because the main source file does not belong to any import path. Now both the current file and the main source file paths are compared in relative form to prevent importing the main source file as module.
@drug007 drug007 force-pushed the fix-2051-main-source-file branch from 1af6845 to fd32d4d Compare December 2, 2020 12:10
@drug007 drug007 changed the title [WIP] Fix #2051 Fix #2051: Running unit tests from DUB single file packages fails Dec 2, 2020
@drug007
Copy link
Contributor Author

drug007 commented Dec 2, 2020

@thewilsonator I opened this PR instead of #2050 and it's ready to review. How to remove WIP label?
Would it be better if I'll split the commit to several like a commit with tests, a commit with changelog etc?

@thewilsonator thewilsonator removed the WIP label Dec 2, 2020
@thewilsonator thewilsonator merged commit 68190df into dlang:master Dec 3, 2020
@drug007 drug007 deleted the fix-2051-main-source-file branch December 4, 2020 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants