Commit Graph

29 Commits

Author SHA1 Message Date
Alberto Sartori 717f7db67e improve suite of meson test (#3369) 2018-04-14 22:17:02 +03:00
Jussi Pakkanen be3387d937
Merge pull request #3322 from sarum9in/run_timeout 2018-03-29 21:48:09 +03:00
Aleksey Filippov ddc6f72507 Use consistent quotes 2018-03-28 21:31:04 +00:00
Aleksey Filippov 827d33c8b6 Split SingleTestRunner.run() 2018-03-28 18:57:50 +00:00
Aleksey Filippov 0e8c69b796 Split SingleTestRunner._get_cmd() out of run() 2018-03-28 18:34:02 +00:00
Aleksey Filippov 9596fd6c24 Move run_single_test() into separate class 2018-03-28 18:34:02 +00:00
Aleksey Filippov 3eebb1f83a Make run_single_test() method static
Closes #3318
2018-03-28 18:34:02 +00:00
Aleksey Filippov 9c01fc0e49 Do not access counters from parallel code 2018-03-28 18:34:02 +00:00
Aleksey Filippov 2aa1c3d575 Use enum instead of string constants 2018-03-28 18:33:50 +00:00
Aleksey Filippov 84e3cadc70 Use hermetic parameters in run_single_test(), initialize them before in the caller 2018-03-28 16:44:49 +00:00
Jussi Pakkanen 9b2e533d87 Always build parser objects anew to avoid leaking old data. 2018-03-27 00:39:45 +03:00
nyorain dd614015e0 Open mesontest logfiles in utf-8 mode
Otherwise unit tests fail on windows when they output some
non-utf8 data.
2018-03-20 22:28:59 +02:00
Alicia Boya García 70270d874d meson test: let gdb handle ^C instead of us
Fixes https://github.com/mesonbuild/meson/issues/3156
2018-03-05 00:04:28 +02:00
Hemmo Nieminen 275c737d57 Fix test setup's timeout_multiplier handling. 2018-03-03 21:23:33 +02:00
Hemmo Nieminen e0d0c0166a Avoid unnecessary unpickling of build data during testing. 2018-03-01 01:06:51 +02:00
Hemmo Nieminen 7fb8e518b2 Harmonize data pickling.
Try to be more consistent on using save() and load() methods to pickle
data.
2018-03-01 01:06:51 +02:00
Hemmo Nieminen 060560bf62 Use test setups from the active (sub)project by default.
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-25 21:44:59 +02:00
Hemmo Nieminen abcaf7c222 Namespace test setups.
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-25 21:44:59 +02:00
Alex Hirsch 3e8eab66a1 Do not set MALLOC_PERTURB_ for benchmarks
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-02-12 21:39:28 +02:00
Robert Doolittle 9b27f07002 don't use bare except 2018-01-30 10:17:45 -08:00
Robert Doolittle 60cfb87e69 mtest: catch ctrl-c and properly kill the child processes. Fixes #2281 2018-01-30 10:13:34 -08:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
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
2018-01-30 07:08:22 +11:00
Dylan Baker d573a29bda mtest: Chdir into the build directory before running tests with -C
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-30 22:19:54 +02:00
Jussi Pakkanen 5cd8a7bbcc More defensive process killing. Closes #2629. 2017-11-19 18:20:41 +02:00
Eric Engestrom 5f7f5cdb05 Print correct command in help message
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-11-09 21:12:34 +02:00
Eric Engestrom 9b6214eb4d mtest: print correct name in error message 2017-10-31 10:11:05 +00:00
Jussi Pakkanen b63710863b Renamed test serialisation from is_cross to is_cross_built for clarity. 2017-09-12 20:32:07 +03:00
Jon Turney b04c4fa878 Add Windows extra_paths to beginning of PATH when running tests
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-09-12 20:28:42 +03:00
Jussi Pakkanen c2e40650e8 Turned mesontest into on internal module. 2017-08-02 22:00:09 +03:00