Skip to content

Commit

Permalink
run_*tests*.py: print Meson version at start of test suite
Browse files Browse the repository at this point in the history
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())
  • Loading branch information
scivision authored and jpakkane committed Jun 15, 2020
1 parent 0a583ac commit 1ec84c5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions run_cross_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

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']
Expand All @@ -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())
6 changes: 4 additions & 2 deletions run_meson_command_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,6 +22,8 @@
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
Expand Down Expand Up @@ -195,4 +196,5 @@ def test_meson_zipapp(self):


if __name__ == '__main__':
sys.exit(unittest.main(buffer=True))
print('Meson build system', meson_version, ' Command Tests')
raise SystemExit(unittest.main(buffer=True))
3 changes: 2 additions & 1 deletion run_project_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
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
Expand Down Expand Up @@ -1248,6 +1248,7 @@ def get_version(t: dict) -> str:
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()
Expand Down
5 changes: 3 additions & 2 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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
Expand Down Expand Up @@ -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())
1 change: 1 addition & 0 deletions run_unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

0 comments on commit 1ec84c5

Please sign in to comment.