aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-02-10 14:08:53 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-02-10 14:08:53 +0200
commita2845b491ba9bd0c2159140271d28dd055fe3f3e (patch)
treebc40ab0bb135aa628e764eee6914c26557497403 /run_tests.py
parentaad3a7a76ea9c38b4f954fe9768174ac6065af35 (diff)
downloadmeson-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-xrun_tests.py17
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.')