diff options
author | Michael Hirsch <scivision@users.noreply.github.com> | 2020-05-14 13:55:46 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-06-15 23:33:40 +0300 |
commit | 1ec84c570fe33309a388238c247caac9578b2191 (patch) | |
tree | 56bfdfca91a6c249364721e0a280ad3f2a49572b | |
parent | 0a583ac06acb34025adb74efe1c5806bb226c1e8 (diff) | |
download | meson-1ec84c570fe33309a388238c247caac9578b2191.zip meson-1ec84c570fe33309a388238c247caac9578b2191.tar.gz meson-1ec84c570fe33309a388238c247caac9578b2191.tar.bz2 |
run_*tests*.py: print Meson version at start of test suite
on some systems, tests may take over an hour to run--only to find
you might have used an unintended Meson version (e.g. release instead
of dev). This change prints the Meson version at the start of the
run_*tests*.py scripts.
Also, raise SystemExit(main()) is preferred in general over
sys.exit(main())
-rwxr-xr-x | run_cross_test.py | 6 | ||||
-rwxr-xr-x | run_meson_command_tests.py | 6 | ||||
-rwxr-xr-x | run_project_tests.py | 3 | ||||
-rwxr-xr-x | run_tests.py | 5 | ||||
-rwxr-xr-x | run_unittests.py | 1 |
5 files changed, 14 insertions, 7 deletions
diff --git a/run_cross_test.py b/run_cross_test.py index abbfdac..1e67876 100755 --- a/run_cross_test.py +++ b/run_cross_test.py @@ -21,8 +21,9 @@ This is now just a wrapper around run_project_tests.py with specific arguments import argparse import subprocess -import sys from mesonbuild import mesonlib +from mesonbuild.coredata import version as meson_version + def runtests(cross_file, failfast): tests = ['--only', 'common'] @@ -37,4 +38,5 @@ def main(): return runtests(options.cross_file, options.failfast) if __name__ == '__main__': - sys.exit(main()) + print('Meson build system', meson_version, 'Cross Tests') + raise SystemExit(main()) diff --git a/run_meson_command_tests.py b/run_meson_command_tests.py index 9dfb62e..c1af758 100755 --- a/run_meson_command_tests.py +++ b/run_meson_command_tests.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import os import tempfile import unittest @@ -23,6 +22,8 @@ import zipapp from pathlib import Path from mesonbuild.mesonlib import windows_proof_rmtree, python_command, is_windows +from mesonbuild.coredata import version as meson_version + def get_pypath(): import sysconfig @@ -195,4 +196,5 @@ class CommandTests(unittest.TestCase): if __name__ == '__main__': - sys.exit(unittest.main(buffer=True)) + print('Meson build system', meson_version, ' Command Tests') + raise SystemExit(unittest.main(buffer=True)) diff --git a/run_project_tests.py b/run_project_tests.py index 0879e2d..c368253 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -42,7 +42,7 @@ from mesonbuild import mesonlib from mesonbuild import mlog from mesonbuild import mtest from mesonbuild.mesonlib import MachineChoice, Popen_safe -from mesonbuild.coredata import backendlist +from mesonbuild.coredata import backendlist, version as meson_version from run_tests import get_fake_options, run_configure, get_meson_script from run_tests import get_backend_commands, get_backend_args_for_dir, Backend @@ -1248,6 +1248,7 @@ if __name__ == '__main__': if options.cross_file: options.extra_args += ['--cross-file', options.cross_file] + print('Meson build system', meson_version, 'Project Tests') setup_commands(options.backend) detect_system_compiler(options) print_tool_versions() diff --git a/run_tests.py b/run_tests.py index 44dcf82..2648e06 100755 --- a/run_tests.py +++ b/run_tests.py @@ -33,7 +33,7 @@ from mesonbuild import mesonmain from mesonbuild import mtest from mesonbuild import mlog from mesonbuild.environment import Environment, detect_ninja -from mesonbuild.coredata import backendlist +from mesonbuild.coredata import backendlist, version as meson_version NINJA_1_9_OR_NEWER = False NINJA_CMD = None @@ -401,4 +401,5 @@ def main(): return returncode if __name__ == '__main__': - sys.exit(main()) + print('Meson build system', meson_version, 'Project and Unit Tests') + raise SystemExit(main()) diff --git a/run_unittests.py b/run_unittests.py index 41ae710..0c2980b 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -8303,4 +8303,5 @@ def main(): return unittest.main(defaultTest=cases, buffer=True) if __name__ == '__main__': + print('Meson build system', mesonbuild.coredata.version, 'Unit Tests') raise SystemExit(main()) |