diff options
-rw-r--r-- | coredata.py | 3 | ||||
-rwxr-xr-x | meson_install.py | 2 | ||||
-rwxr-xr-x | meson_test.py | 24 |
3 files changed, 21 insertions, 8 deletions
diff --git a/coredata.py b/coredata.py index 2269118..d936bbf 100644 --- a/coredata.py +++ b/coredata.py @@ -63,6 +63,7 @@ forbidden_target_names = {'clean': None, 'phony': None, 'all': None, 'test': None, + 'test-valgrind': None, 'install': None, - 'build.ninja': None + 'build.ninja': None, } diff --git a/meson_install.py b/meson_install.py index 229ce11..4674232 100755 --- a/meson_install.py +++ b/meson_install.py @@ -123,7 +123,7 @@ def install_targets(d): if __name__ == '__main__': if len(sys.argv) != 2: - print('Installer script for Builder. Do not run on your own, mmm\'kay?') + print('Installer script for Meson. Do not run on your own, mmm\'kay?') print('%s [install info file]' % sys.argv[0]) datafilename = sys.argv[1] do_install(datafilename) diff --git a/meson_test.py b/meson_test.py index c33563e..364b3dc 100755 --- a/meson_test.py +++ b/meson_test.py @@ -15,13 +15,24 @@ # limitations under the License. import sys, subprocess +from optparse import OptionParser -def run_tests(datafilename): +parser = OptionParser() +parser.add_option('--wrapper', default=None, dest='wrapper', + help='wrapper to run tests (e.g. valgrind') + + +def run_tests(options, datafilename): + if options.wrapper is None: + wrap = [] + else: + wrap = [options.wrapper] for line in open(datafilename, 'r'): line = line.strip() if line == '': continue - p = subprocess.Popen(line, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + cmd = wrap + [line] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdo, stde) = p.communicate() if p.returncode != 0: print('Error running test.') @@ -31,8 +42,9 @@ def run_tests(datafilename): print('Test "%s": OK' % line) if __name__ == '__main__': - if len(sys.argv) != 2: - print('Test runner for Builder. Do not run on your own, mmm\'kay?') + (options, args) = parser.parse_args(sys.argv) + if len(args) != 2: + print('Test runner for Meson. Do not run on your own, mmm\'kay?') print('%s [data file]' % sys.argv[0]) - datafile = sys.argv[1] - run_tests(datafile) + datafile = args[1] + run_tests(options, datafile) |