aboutsummaryrefslogtreecommitdiff
path: root/mesontest.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-18 20:32:41 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-11-18 22:08:07 +0200
commit39df22bf539ce3359679643256b854f34c13fa16 (patch)
treebe980cbd72c9c04369bf9516222244d7b137adf8 /mesontest.py
parente24229eae718c8b177074de27b30fdcfb26ff4a6 (diff)
downloadmeson-39df22bf539ce3359679643256b854f34c13fa16.zip
meson-39df22bf539ce3359679643256b854f34c13fa16.tar.gz
meson-39df22bf539ce3359679643256b854f34c13fa16.tar.bz2
Made Meson test into a class rather than abusing global variables and as preparation for moving it elsewhere.
Diffstat (limited to 'mesontest.py')
-rwxr-xr-xmesontest.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesontest.py b/mesontest.py
index 30302d8..3a2b0a3 100755
--- a/mesontest.py
+++ b/mesontest.py
@@ -19,6 +19,7 @@
import subprocess, sys, os, argparse
import pickle
from mesonbuild.scripts import meson_test, meson_benchmark
+from mesonbuild import environment
parser = argparse.ArgumentParser()
parser.add_argument('--repeat', default=1, dest='repeat', type=int,
@@ -53,7 +54,12 @@ def gdbrun(test):
def run(args):
datafile = 'meson-private/meson_test_setup.dat'
- if args[0] == '--benchmark':
+ if not os.path.isfile(datafile):
+ print('Test data file. Probably this means that you did not run this in the build directory.')
+ return 1
+ if os.path.isfile('build.ninja'):
+ subprocess.check_call([environment.detect_ninja(), 'all'])
+ if len(args) > 0 and args[0] == '--benchmark':
return meson_benchmark.run(args[1:] + ['meson-private/meson_benchmark_setup.dat'])
options = parser.parse_args(args)
if len(options.tests) == 0: