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

tests compiled even when build_by_default is false #3662

Closed
mqudsi opened this issue Jun 1, 2018 · 3 comments
Closed

tests compiled even when build_by_default is false #3662

mqudsi opened this issue Jun 1, 2018 · 3 comments

Comments

@mqudsi
Copy link

mqudsi commented Jun 1, 2018

I'm not sure if this is by design, but there doesn't seem to be a way to suppress tests from being compiled by default (vs only when the test target is built/run).

exe1 = executable('test1, ['test1.cpp'], build_by_default: false)
test('test1', exe1)

ninja here compiles test1 unconditionally. I would expect it to only be compiled when ninja test is run.

@nirbheek
Copy link
Member

nirbheek commented Jun 6, 2018

There is a FIXME in the codebase about changing this. See: mesonbuild/backends/backends.py : get_build_by_default_targets(). Would you like to work on fixing it?

@QuLogic
Copy link
Member

QuLogic commented Aug 6, 2019

This is a duplicate of #2518.

@eli-schwartz
Copy link
Member

Duplicate of #2518

@eli-schwartz eli-schwartz marked this as a duplicate of #2518 Jan 13, 2022
eli-schwartz added a commit to eli-schwartz/meson that referenced this issue Jan 8, 2025
When running `ninja all` we shouldn't build testsuite programs as these
might not be wanted e.g. in order to just install the project. We do
want them to be built when running `ninja test`. Since meson 0.63 we
actually have a dedicated ninja alias for test dependencies -- move
these from the "all" rule to the dedicated test/benchmark rules.

Closes: mesonbuild#1704
Closes: mesonbuild#1949
Closes: mesonbuild#2518
Closes: mesonbuild#3662
Closes: mesonbuild#5728
Closes: mesonbuild#5867
Closes: mesonbuild#6511
Closes: mesonbuild#11317
Closes: mesonbuild#13378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants