From 93d2a593c4f6e71f3588ca6856346decc0e1e058 Mon Sep 17 00:00:00 2001 From: Yannick Jadoul Date: Wed, 6 Sep 2017 16:14:39 +0200 Subject: [PATCH] Making call from run_tests to run_test subprocess.check_call --- bin/run_test.py | 5 +---- bin/run_tests.py | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/run_test.py b/bin/run_test.py index 95e76482..90f0e35b 100755 --- a/bin/run_test.py +++ b/bin/run_test.py @@ -35,10 +35,7 @@ if __name__ == '__main__': args = parser.parse_args() project_path = os.path.abspath(args.test_project_dir) - - # move cwd to the project root - os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - + if not os.path.exists(project_path): print('No test project not found.', file=sys.stderr) exit(2) diff --git a/bin/run_tests.py b/bin/run_tests.py index 59ac48d7..9264e2be 100755 --- a/bin/run_tests.py +++ b/bin/run_tests.py @@ -4,8 +4,6 @@ from __future__ import print_function import os, sys, subprocess, shutil, json from glob import glob -import run_test - if __name__ == '__main__': # move cwd to the project root os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) @@ -24,7 +22,8 @@ if __name__ == '__main__': print('Testing projects:', test_projects) + run_test_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'run_test.py') for project_path in test_projects: - run_test.single_run(project_path) + subprocess.check_call([sys.executable, run_test_path, project_path]) print('%d projects built successfully.' % len(test_projects))