aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-08-10 23:02:51 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-08-10 23:02:51 +0300
commitd02e4ce1c972ddae681c63310ca399b32811c4a2 (patch)
tree43e6200c299294ac181a63ae55d5bf4c4d08a061 /run_tests.py
parent20d850d21f58c256abbad241e0c444d173c60834 (diff)
downloadmeson-d02e4ce1c972ddae681c63310ca399b32811c4a2.zip
meson-d02e4ce1c972ddae681c63310ca399b32811c4a2.tar.gz
meson-d02e4ce1c972ddae681c63310ca399b32811c4a2.tar.bz2
Created new suite of tests that should fail when executed.
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/run_tests.py b/run_tests.py
index 158aadd..c49a1d4 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -30,7 +30,7 @@ if True: # Currently we have only one backend.
test_commands = [ninja_command, 'test']
install_commands = [ninja_command, 'install']
-def run_test(testdir):
+def run_test(testdir, should_succeed=True):
shutil.rmtree(test_build_dir)
shutil.rmtree(install_dir)
os.mkdir(test_build_dir)
@@ -39,6 +39,10 @@ def run_test(testdir):
gen_command = [sys.executable, meson_command, '--prefix', install_dir, testdir, test_build_dir] + backend_flags
p = subprocess.Popen(gen_command)
p.wait()
+ if not should_succeed:
+ if p.returncode != 0:
+ return
+ raise RuntimeError('Test that should fail succeeded.')
if p.returncode != 0:
raise RuntimeError('Generating the build system failed.')
pc = subprocess.Popen(compile_commands, cwd=test_build_dir)
@@ -63,6 +67,7 @@ def gather_tests(testdir):
def run_tests():
commontests = gather_tests('test cases/common')
+ failtests = gather_tests('test cases/failing')
if environment.is_osx():
platformtests = gather_tests('test cases/osx')
elif environment.is_windows():
@@ -87,12 +92,23 @@ def run_tests():
pass
print('\nRunning common tests.\n')
[run_test(t) for t in commontests]
- print('\nRunning platform dependent tests.\n')
- [run_test(t) for t in platformtests]
- print('\nRunning framework tests.\n')
- [run_test(t) for t in frameworktests]
- print('\nRunning extra language tests.\n')
- [run_test(t) for t in objctests]
+ print('\nRunning failing tests.\n')
+ [run_test(t, False) for t in failtests]
+ if len(platformtests) > 0:
+ print('\nRunning platform dependent tests.\n')
+ [run_test(t) for t in platformtests]
+ else:
+ print('\nNo platform specific tests.\n')
+ if len(frameworktests) > 0:
+ print('\nRunning framework tests.\n')
+ [run_test(t) for t in frameworktests]
+ else:
+ print('\nNo framework tests on this platform.\n')
+ if len(objctests) > 0:
+ print('\nRunning extra language tests.\n')
+ [run_test(t) for t in objctests]
+ else:
+ print('\nNo extra language tests on this platform.\n')
def check_file(fname):
if fname.endswith('parsetab.py'): # Autogenerated