diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-02-10 14:08:53 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-02-10 14:08:53 +0200 |
commit | a2845b491ba9bd0c2159140271d28dd055fe3f3e (patch) | |
tree | bc40ab0bb135aa628e764eee6914c26557497403 /run_tests.py | |
parent | aad3a7a76ea9c38b4f954fe9768174ac6065af35 (diff) | |
download | meson-a2845b491ba9bd0c2159140271d28dd055fe3f3e.zip meson-a2845b491ba9bd0c2159140271d28dd055fe3f3e.tar.gz meson-a2845b491ba9bd0c2159140271d28dd055fe3f3e.tar.bz2 |
Tests can now be easily run with both shell and Ninja.
Diffstat (limited to 'run_tests.py')
-rwxr-xr-x | run_tests.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/run_tests.py b/run_tests.py index a8c733b..6b9cb4c 100755 --- a/run_tests.py +++ b/run_tests.py @@ -19,10 +19,18 @@ import os, subprocess, shutil test_build_dir = 'work area' install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir') +use_shell = True builder_command = './builder.py' -compile_commands = ['compile.sh'] -test_commands = ['run_tests.sh'] -install_commands = ['install.sh'] +if use_shell: + generator_flags = [] + compile_commands = ['compile.sh'] + test_commands = ['run_tests.sh'] + install_commands = ['install.sh'] +else: + generator_flags = ['--generator', 'ninja'] + compile_commands = ['ninja'] + test_commands = ['ninja', 'test'] + install_commands = ['ninja', 'install'] def run_test(testdir): shutil.rmtree(test_build_dir) @@ -30,7 +38,8 @@ def run_test(testdir): os.mkdir(test_build_dir) os.mkdir(install_dir) print('Running test: ' + testdir) - p = subprocess.Popen([builder_command, '--prefix', install_dir, testdir, test_build_dir]) + p = subprocess.Popen([builder_command, '--prefix', install_dir, testdir, test_build_dir] +\ + generator_flags) p.wait() if p.returncode != 0: raise RuntimeError('Generating the build system failed.') |