You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I need to run a test setup script (or some code) before the tests can be run. This has to move a bunch of test data files into the build directory and set up a test environment. How can I do this in a good way? run_target was the obvious first try (with a shell script), but I was unable to add this as a dependency for the tests. Then I tried a custom_target, and add this as a link_depends for the test(exectuable()) - but this causes the test setup to be run just when tests are compiling - and I don't want to run this unless I am actually running the tests.
Also, is it possible to avoid having the tests build by default. Passing build_by_default : false to the test(executable()) did not work.
Also, is it possible to avoid having the tests build by default. Passing build_by_default : false to the test(executable()) did not work.
This also does not seem to work for me (with the result of executable() stored in a variable); the test executables are always built. This is a real pain if I'm testing new code in src/, or a new feature that doesn't have a formal test yet, or I simply decide I don't care about the test results and just want to build the core.
@nirbheek I suppose it's a separate issue. Here we need something to prepare tests (run script, with some DB for example) and some action to stop tests (stop and clean DB for example).
In #1704 you mostly talking about a separate run for tests.
Of course, we can run some bash/bat script to do it but in that case semantic will not so clear for developers.
Hi, I need to run a test setup script (or some code) before the tests can be run. This has to move a bunch of test data files into the build directory and set up a test environment. How can I do this in a good way?
run_target
was the obvious first try (with a shell script), but I was unable to add this as a dependency for the tests. Then I tried acustom_target
, and add this as alink_depends
for the test(exectuable()) - but this causes the test setup to be run just when tests are compiling - and I don't want to run this unless I am actually running the tests.Also, is it possible to avoid having the tests build by default. Passing
build_by_default : false
to the test(executable()) did not work.Full meson.build.
The text was updated successfully, but these errors were encountered: