aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mtest.py
AgeCommit message (Collapse)AuthorFilesLines
2018-11-04test: do not use PIPEMarcel Hollerbach1-12/+21
as instructed in the python docs, you should not use PIPE here. This can lead to deadlocks, with massive testsuite output. Which was the case for efl. For now the output of the tests is redirected into the a temp file, the content from there can then be used to fill the TestRun structure. This fixes test running problems in efl.
2018-10-04Use a single ArgumentParser for all subcommandsXavier Claessens1-6/+8
This has the adventage that "meson --help" shows a list of all commands, making them discoverable. This also reduce the manual parsing of arguments to the strict minimum needed for backward compatibility.
2018-09-06Guard against the process redirecting stdout. Closes #3967.Jussi Pakkanen1-0/+3
2018-09-06Try to kill processes even more thoroughly. Closes #4127.Jussi Pakkanen1-1/+12
2018-08-11Print only custom env vars in the test log for each testNirbheek Chauhan1-4/+10
We still print the inherited env at the top of the test log because it is useful when inspecting test results from a CI. Fixes https://github.com/mesonbuild/meson/issues/3924
2018-07-09cross: Be more permissive about not-found exe_wrapperNirbheek Chauhan1-4/+11
We used to immediately try to use whatever exe_wrapper was defined in the cross file, but some people generate the cross file once and use it for several projects, most of which do not even need an exe wrapper to build. Now we're a bit more resilient. We quietly fall back to using non-exe-wrapper paths for compiler checks and skip the sanity check. However, if some code needs the exe wrapper, f.ex., if you run a built executable using custom_target() or run_target(), we will error out during setup. Tests will, of course, continue to error out when you run them if the exe wrapper was not found. We don't want people's tests to silently "pass" (aka skip) because of a bad CI setup. Closes https://github.com/mesonbuild/meson/issues/3562 This commit also adds a test for the behaviour of exe_wrapper in these cases, and refactors the unit tests a bit for it.
2018-07-09cross: Use ExternalProgram for cross-file exe_wrapperNirbheek Chauhan1-8/+2
We already have code to fetch and find binaries specified in a cross file, so use the same code for exe_wrapper. This allows us to handle the same corner-cases that were fixed for other cross binaries.
2018-06-17Report exit status or signal that killed the testKurtis Rader1-3/+34
When a test fails due to a signal (e.g., SIGSEGV) it can be somewhat mysterious why the test failed. Also, even when a test fails due to a non-zero exit status it would help if the exit status was reported. This augments the result string to include the non-zero exit status or signal number and name. Resolves #3642
2018-06-05Set WINEPATH when running serialized executablesNirbheek Chauhan1-0/+16
When the exe runner is `wine` or `wine32` or `wine64`, etc. This allows people to run tests with wine. Note that you also have to set WINEPATH to point to your custom prefix(es) if your tests use external dependencies. Closes https://github.com/mesonbuild/meson/issues/3620
2018-05-29Don't call getpgid() when killing a test.George Koehler1-1/+2
OpenBSD's getpgid(2) fails with EPERM (PermissionError) because the test is in a different session: https://man.openbsd.org/getpgid Use p.pid as the process group ID, because setsid() created a process group with the same ID as the process. See setsid(2) manuals: - FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=setsid - illumos: https://illumos.org/man/setsid - Linux: http://man7.org/linux/man-pages/man2/setsid.2.html This change fixes 'manual tests/8 timeout' on OpenBSD. To verify this change, one must run the manual test. For example, $ cd 'manual tests/8 timeout' $ meson build $ ninja -C build test It should report that the test timed out, and not show PermissionError. Fixes https://github.com/mesonbuild/meson/issues/3569
2018-04-14improve suite of meson test (#3369)Alberto Sartori1-0/+19
2018-03-29Merge pull request #3322 from sarum9in/run_timeoutJussi Pakkanen1-150/+180
2018-03-28Use consistent quotesAleksey Filippov1-8/+8
2018-03-28Split SingleTestRunner.run()Aleksey Filippov1-99/+97
2018-03-28Split SingleTestRunner._get_cmd() out of run()Aleksey Filippov1-6/+8
2018-03-28Move run_single_test() into separate classAleksey Filippov1-95/+101
2018-03-28Make run_single_test() method staticAleksey Filippov1-3/+5
Closes #3318
2018-03-28Do not access counters from parallel codeAleksey Filippov1-5/+15
2018-03-28Use enum instead of string constantsAleksey Filippov1-12/+23
2018-03-28Use hermetic parameters in run_single_test(), initialize them before in the ↵Aleksey Filippov1-12/+13
caller
2018-03-27Always build parser objects anew to avoid leaking old data.Jussi Pakkanen1-42/+44
2018-03-20Open mesontest logfiles in utf-8 modenyorain1-2/+2
Otherwise unit tests fail on windows when they output some non-utf8 data.
2018-03-05meson test: let gdb handle ^C instead of usAlicia Boya García1-4/+21
Fixes https://github.com/mesonbuild/meson/issues/3156
2018-03-03Fix test setup's timeout_multiplier handling.Hemmo Nieminen1-2/+4
2018-03-01Avoid unnecessary unpickling of build data during testing.Hemmo Nieminen1-24/+24
2018-03-01Harmonize data pickling.Hemmo Nieminen1-24/+24
Try to be more consistent on using save() and load() methods to pickle data.
2018-02-25Use test setups from the active (sub)project by default.Hemmo Nieminen1-40/+44
Replace the logic where a test setup with no project specifier defaults to the main project with one that takes the test setup from the same (sub)project from where the to-be-executed test has been read from.
2018-02-25Namespace test setups.Hemmo Nieminen1-4/+5
Use $project_name:$test_setup namespace scheme for test setups. This allows one to choose from which (sub)project a test setup is taken from should there be several sharing the same name. Defaults to the main project. E.g. "meson test --setup subproj:valgrind".
2018-02-12Do not set MALLOC_PERTURB_ for benchmarksAlex Hirsch1-3/+3
Setting MALLOC_PERTURB_ to a non-zero value is fine for regular test cases. It helps catching bugs, but also comes with some runtime overhead. This overhead is noticeable for benchmarks when compared to running them directly instead of through Meason. Therefore, MALLOC_PERTURB_ is not touched for benchmarks. closes #3034
2018-01-30don't use bare exceptRobert Doolittle1-3/+0
2018-01-30mtest: catch ctrl-c and properly kill the child processes. Fixes #2281Robert Doolittle1-2/+11
2018-01-30Use os.path: basename() and dirname() instead of split()Aleksey Filippov1-1/+1
According to Python documentation[1] dirname and basename are defined as follows: os.path.dirname() = os.path.split()[0] os.path.basename() = os.path.split()[1] For the purpose of better readability split() is replaced by appropriate function if only one part of returned tuple is used. [1]: https://docs.python.org/3/library/os.path.html#os.path.split
2017-11-30mtest: Chdir into the build directory before running tests with -CDylan Baker1-24/+30
When `ninja -C builddir/ test` is run, ninja will change into the build dir before starting, but `meson test -C builddir/` does not. This is important because meson does not use (for good reasons) absolute paths, which means if a test case needs to be passed as an argument a file name that is part of the build process, it will be relative builddir. Without changing into the builddir the path will not exist (or worse, point at the wrong thing), and test will not behave as intended. To fix this mtest will change directory before starting tests, and will change back after all tests have been finished. Fixes #2710
2017-11-19More defensive process killing. Closes #2629.Jussi Pakkanen1-1/+7
2017-11-09Print correct command in help messageEric Engestrom1-1/+1
Taking mconf for instance: before: $ meson configure --help usage: meson [-h] [-D SETS] [--clearcache] [directory [directory ...]] after: $ meson configure --help usage: meson configure [-h] [-D SETS] [--clearcache] [directory [directory ...]]
2017-10-31mtest: print correct name in error messageEric Engestrom1-1/+1
2017-09-12Renamed test serialisation from is_cross to is_cross_built for clarity.Jussi Pakkanen1-2/+2
2017-09-12Add Windows extra_paths to beginning of PATH when running testsJon Turney1-1/+1
Adding it to the end of PATH means that if an installed instance of a DLL exists, that would be used instead of the built instance. Compare with run_exe(), which already gets this right.
2017-08-02Turned mesontest into on internal module.Jussi Pakkanen1-0/+624