-
Notifications
You must be signed in to change notification settings - Fork 97
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
Build no tests by default #572
Build no tests by default #572
Conversation
Building tests can be enforced using --test for build. It is done automatically before running tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing. Works nicely for a couple of projects I tested so far.
I have one suggestion about the new logical value, though.
src/fpm_targets.f90
Outdated
if (.not. include_tests) then | ||
if (sources(i)%unit_scope == FPM_SCOPE_TEST) cycle | ||
end if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be beneficial to make the include_tests
logical part of the fpm_model_t
, this way it can be easily accessed here without requiring to change the signature of all procedures until we get to the target list builder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it would be nicer to have it in the model. But it did not seem to fit with the existing, more fundamental components:
type :: fpm_model_t
character(:), allocatable :: package_name
type(package_t), allocatable :: packages(:)
type(compiler_t) :: compiler
type(archiver_t) :: archiver
character(:), allocatable :: fortran_compile_flags
character(:), allocatable :: output_directory
type(string_t), allocatable :: include_dirs(:)
type(string_t), allocatable :: link_libraries(:)
type(string_t), allocatable :: external_modules(:)
type(dependency_tree_t) :: deps
logical :: include_tests
end type fpm_model_t
Is this ok?
Thanks very much @Sideboard! This all looks good - I agree with Sebastian's comment regarding the logical value, I think it is fine to include it in the model. |
I changed the structure and renamed the internal settings name from Shall I …
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I usually squash small PRs on merge, so no worries about polluting the history here. But feel free to rebase your branch if you like.
Merge-squash is fine with me and there is no need for a bare rebase as far as I see. The second commit message can be scrapped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, many thanks Sascha @Sideboard 👍
I just realized that the cargo option is
|
Thanks, I'll go ahead and merge. |
Thank you @Sideboard for this contribution! |
Fixes #92
build
to exclude tests (sources with FPM_SCOPE_TEST)--test
to force building tests