aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-03-03 20:05:04 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-03-03 20:05:04 +0200
commit9262fe600ad22180d7e1a5179fa5d4f681b17cb7 (patch)
tree8e0cc6f865577c3b90f0b35f41d11eae77986090 /run_tests.py
parent83caae1bcb816433d66c6472c701907aa0ec0711 (diff)
downloadmeson-9262fe600ad22180d7e1a5179fa5d4f681b17cb7.zip
meson-9262fe600ad22180d7e1a5179fa5d4f681b17cb7.tar.gz
meson-9262fe600ad22180d7e1a5179fa5d4f681b17cb7.tar.bz2
Split test suite into common and platform dependent parts.
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/run_tests.py b/run_tests.py
index 2e1f0bd..039712f 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -16,6 +16,7 @@
from glob import glob
import os, subprocess, shutil, sys
+import environment
test_build_dir = 'work area'
install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir')
@@ -56,11 +57,22 @@ def run_test(testdir):
if pi.returncode != 0:
raise RuntimeError('Running install failed.')
-def run_tests():
- tests = [t.split('/', 1)[1] for t in glob('test cases/*')]
+def gather_tests(testdir):
+
+ tests = [t.split('/', 2)[2] for t in glob(os.path.join(testdir, '*'))]
testlist = [(int(t.split()[0]), t) for t in tests]
testlist.sort()
- tests = [os.path.join('test cases', t[1]) for t in testlist]
+ tests = [os.path.join(testdir, t[1]) for t in testlist]
+ return tests
+
+def run_tests():
+ commontests = gather_tests('test cases/common')
+ if environment.is_osx():
+ platformtests = gather_tests('test cases/osx')
+ elif environment.is_windows():
+ platformtests = gather_tests('test cases/windows')
+ else:
+ platformtests = gather_tests('test cases/linuxlike')
try:
os.mkdir(test_build_dir)
except OSError:
@@ -69,7 +81,10 @@ def run_tests():
os.mkdir(install_dir)
except OSError:
pass
- [run_test(t) for t in tests]
+ print('Running common tests.')
+ [run_test(t) for t in commontests]
+ print('Running platform dependent tetss')
+ [run_test(t) for t in platformtests]
if __name__ == '__main__':
os.chdir(os.path.split(__file__)[0])