mesontest: Fix the --wd option and rename it to -C to be coherent with ninja

pull/1087/head
Thibault Saunier 8 years ago
parent 9644e8b8de
commit 3f6e06c930
  1. 9
      mesontest.py

@ -57,7 +57,7 @@ parser.add_argument('--list', default=False, dest='list', action='store_true',
help='List available tests.') help='List available tests.')
parser.add_argument('--wrapper', default=None, dest='wrapper', parser.add_argument('--wrapper', default=None, dest='wrapper',
help='wrapper to run tests with (e.g. Valgrind)') help='wrapper to run tests with (e.g. Valgrind)')
parser.add_argument('--wd', default=None, dest='wd', parser.add_argument('-C', default='.', dest='wd',
help='directory to cd into before running') help='directory to cd into before running')
parser.add_argument('--suite', default=None, dest='suite', parser.add_argument('--suite', default=None, dest='suite',
help='Only run tests belonging to the given suite.') help='Only run tests belonging to the given suite.')
@ -136,9 +136,10 @@ class TestHarness:
self.error_count = 0 self.error_count = 0
self.is_run = False self.is_run = False
if self.options.benchmark: if self.options.benchmark:
self.datafile = 'meson-private/meson_benchmark_setup.dat' self.datafile = os.path.join(options.wd, 'meson-private/meson_benchmark_setup.dat')
else: else:
self.datafile = 'meson-private/meson_test_setup.dat' self.datafile = os.path.join(options.wd, 'meson-private/meson_test_setup.dat')
print(self.datafile)
def run_single_test(self, wrap, test): def run_single_test(self, wrap, test):
if test.fname[0].endswith('.jar'): if test.fname[0].endswith('.jar'):
@ -250,7 +251,7 @@ class TestHarness:
return self.error_count return self.error_count
def run_tests(self, datafilename, log_base): def run_tests(self, datafilename, log_base):
logfile_base = os.path.join('meson-logs', log_base) logfile_base = os.path.join(self.options.wd, 'meson-logs', log_base)
if self.options.wrapper is None: if self.options.wrapper is None:
wrap = [] wrap = []
logfilename = logfile_base + '.txt' logfilename = logfile_base + '.txt'

Loading…
Cancel
Save