-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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_by_default:false is ignored by mesontest. #1949
Comments
|
Thanks, --no-rebuild is a useful workaround. In my experience build_by_default is NOT ignored for executables. It is remarkable that Meson builds all targets by default, I think this is a "good thing" in general but build_by_default:false should always work on any target IMO. |
Just tried: mesontest --no-rebuild test-name It still ended up rebuilding all. |
Right, we added that feature recently, I forgot about that.
That would be a bug, but I cannot reproduce it here with 0.41.1 |
I was on 0.41.0. Upgraded to 0.41.1, still --no-rebuild rebuilds all. Even though you said it is ignored, I was still specifying build_by_default:false on the test executables AND the test targets, so I removed that too, still --no-rebuild rebuilds all. |
What are the exact steps that you are taking while doing this? |
I was on 0.41.0. Upgraded to 0.41.1, still --no-rebuild rebuilds all. Even though you said it is ignored, I was still specifying build_by_default:false on the test executables AND the test targets, so I removed that too, still --no-rebuild rebuilds all. |
It seems there was a misunderstanding what --no-rebuild does: it seems to not build even the test i want to run. Please confirm -- if this is correct, then --no-rebuild is a useless option because there is little value in running unit tests that are out of date. When I say "mesontest foo", I need it to build foo (and NOT build any other unit test), then run foo. Is there any way to get this behavior? The reason it is needed is that if I am working on one of very many unit tests, I don't want to have to wait for hundreds of files to build (possibly fail to build), just so I can run the one unit test I want to run. |
That is currently the case. Either you rebuild all targets or none of them. There has been interest in adding functionality to specify a single test and only compile that one (and other things it depends on) and then run it. Until that is done if you know your specific target executable you can do |
The suggested workaround does not work for me. After changing a single CPP file, the ninja build compiles just that one file and links, as it should:
Immediately after that, if I issue
it builds/links 106 other targets that use the modified CPP file, then runs maya_test-error_anim_no_name. P.S. I can't run the unit test directly (outside of mesontest) as it requires specific environment which meson.build sets correctly. |
That would be a bug then. Strange. |
I don't think there is anything special to reproducing this, but If you need a test case, you can look at https://github.com/zajo/boost-noexcept.git: if you do e.g. Thanks! |
Can you test the linked branch? |
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
I have many targets, all flagged as "build_by_default: false". When I do ninja <target_name> it correctly builds only what is required for that target. But if I do mesontest <test_name> it seems to build everything.
The text was updated successfully, but these errors were encountered: