aboutsummaryrefslogtreecommitdiff
path: root/mesontest.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-02-16 23:19:45 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-02-19 17:20:14 -0500
commit69e51109c2e1caf0fea7914e90d002fb43b08fa9 (patch)
tree8aa1439d14b432eebd4192a36f8efc96cbe12a88 /mesontest.py
parentf0ccbc649ca6a4a7947fa5e59e036f473dbbf9ff (diff)
downloadmeson-69e51109c2e1caf0fea7914e90d002fb43b08fa9.zip
meson-69e51109c2e1caf0fea7914e90d002fb43b08fa9.tar.gz
meson-69e51109c2e1caf0fea7914e90d002fb43b08fa9.tar.bz2
Run regen before loading test data because it might have changed.
Diffstat (limited to 'mesontest.py')
-rwxr-xr-xmesontest.py48
1 files changed, 23 insertions, 25 deletions
diff --git a/mesontest.py b/mesontest.py
index 3545ed8..96f0315 100755
--- a/mesontest.py
+++ b/mesontest.py
@@ -159,7 +159,6 @@ class TestHarness:
self.skip_count = 0
self.timeout_count = 0
self.is_run = False
- self.cant_rebuild = False
self.tests = None
self.suites = None
if self.options.benchmark:
@@ -167,27 +166,6 @@ class TestHarness:
else:
self.load_datafile(os.path.join(options.wd, 'meson-private', 'meson_test_setup.dat'))
- def rebuild_all(self):
- if not os.path.isfile(os.path.join(self.options.wd, 'build.ninja')):
- print("Only ninja backend is supported to rebuilt tests before running them.")
- self.cant_rebuild = True
- return True
-
- ninja = environment.detect_ninja()
- if not ninja:
- print("Can't find ninja, can't rebuild test.")
- self.cant_rebuild = True
- return False
-
- p = subprocess.Popen([ninja, '-C', self.options.wd])
- (stdo, stde) = p.communicate()
-
- if p.returncode != 0:
- print("Could not rebuild")
- return False
-
- return True
-
def run_single_test(self, wrap, test):
if test.fname[0].endswith('.jar'):
cmd = ['java', '-jar'] + test.fname
@@ -548,6 +526,25 @@ def merge_suite_options(options):
options.wrapper = current.exe_wrapper
return current.env
+def rebuild_all(wd):
+ if not os.path.isfile(os.path.join(wd, 'build.ninja')):
+ print("Only ninja backend is supported to rebuild tests before running them.")
+ return True
+
+ ninja = environment.detect_ninja()
+ if not ninja:
+ print("Can't find ninja, can't rebuild test.")
+ return False
+
+ p = subprocess.Popen([ninja, '-C', wd])
+ (stdo, stde) = p.communicate()
+
+ if p.returncode != 0:
+ print("Could not rebuild")
+ return False
+
+ return True
+
def run(args):
options = parser.parse_args(args)
@@ -573,13 +570,14 @@ def run(args):
options.wd = os.path.abspath(options.wd)
+ if not options.no_rebuild:
+ if not rebuild_all(options.wd):
+ sys.exit(-1)
+
th = TestHarness(options)
if options.list:
list_tests(th)
return 0
- if not options.no_rebuild:
- if not th.rebuild_all():
- sys.exit(-1)
if len(options.args) == 0:
return th.doit()
return th.run_special()