|
|
|
@ -19,15 +19,15 @@ import os, subprocess, shutil, sys |
|
|
|
|
|
|
|
|
|
test_build_dir = 'work area' |
|
|
|
|
install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir') |
|
|
|
|
use_shell = len(sys.argv) == 1 |
|
|
|
|
use_shell = len(sys.argv) > 1 |
|
|
|
|
builder_command = './builder.py' |
|
|
|
|
if use_shell: |
|
|
|
|
generator_flags = [] |
|
|
|
|
generator_flags = ['--generator', 'shell'] |
|
|
|
|
compile_commands = ['compile.sh'] |
|
|
|
|
test_commands = ['run_tests.sh'] |
|
|
|
|
install_commands = ['install.sh'] |
|
|
|
|
else: |
|
|
|
|
generator_flags = ['--generator', 'ninja'] |
|
|
|
|
generator_flags = [] |
|
|
|
|
compile_commands = ['ninja'] |
|
|
|
|
test_commands = ['ninja', 'test'] |
|
|
|
|
install_commands = ['ninja', 'install'] |
|
|
|
@ -38,8 +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] +\ |
|
|
|
|
generator_flags) |
|
|
|
|
gen_command = [builder_command, '--prefix', install_dir, testdir, test_build_dir] + generator_flags |
|
|
|
|
p = subprocess.Popen(gen_command) |
|
|
|
|
p.wait() |
|
|
|
|
if p.returncode != 0: |
|
|
|
|
raise RuntimeError('Generating the build system failed.') |
|
|
|
|