From 3a320036ce836a1cf459e5311f4639bdc272c628 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 8 Mar 2013 18:53:41 +0200 Subject: [PATCH] Can run most of the test suite on Windows. --- run_tests.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/run_tests.py b/run_tests.py index 0a4e3e401..b570d6267 100755 --- a/run_tests.py +++ b/run_tests.py @@ -39,7 +39,7 @@ def run_test(testdir): os.mkdir(test_build_dir) os.mkdir(install_dir) print('Running test: ' + testdir) - gen_command = [meson_command, '--prefix', install_dir, testdir, test_build_dir] + backend_flags + gen_command = [sys.executable, meson_command, '--prefix', install_dir, testdir, test_build_dir] + backend_flags p = subprocess.Popen(gen_command) p.wait() if p.returncode != 0: @@ -58,8 +58,8 @@ def run_test(testdir): raise RuntimeError('Running install failed.') def gather_tests(testdir): - - tests = [t.split('/', 2)[2] for t in glob(os.path.join(testdir, '*'))] + print(glob(os.path.join(testdir, '*'))) + tests = [t.replace('\\', '/').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(testdir, t[1]) for t in testlist] @@ -87,5 +87,7 @@ def run_tests(): [run_test(t) for t in platformtests] if __name__ == '__main__': - os.chdir(os.path.split(__file__)[0]) + script_dir = os.path.split(__file__)[0] + if script_dir != '': + os.chdir(script_dir) run_tests()