diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-31 19:33:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 19:33:06 +0300 |
commit | e75f6e43050594c77a09eb7b27ee3ec0b0d0898f (patch) | |
tree | e89968d5d63109721a11cb385b77d2f7d69a232c /mesonbuild/mtest.py | |
parent | a5d0a501fd27a7a68675f5ca6b371ee3c0234016 (diff) | |
parent | e8dae2b966498207867cb07d58f4404b76c087ce (diff) | |
download | meson-e75f6e43050594c77a09eb7b27ee3ec0b0d0898f.zip meson-e75f6e43050594c77a09eb7b27ee3ec0b0d0898f.tar.gz meson-e75f6e43050594c77a09eb7b27ee3ec0b0d0898f.tar.bz2 |
Merge pull request #3850 from mesonbuild/nirbheek/exe-wrapper-compiler-fallbacks
Be more permissive about not-found exe_wrapper
Diffstat (limited to 'mesonbuild/mtest.py')
-rw-r--r-- | mesonbuild/mtest.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index 855154f..8ebef04 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -240,7 +240,11 @@ class SingleTestRunner: # because there is no execute wrapper. return None else: - return [self.test.exe_runner] + self.test.fname + if not self.test.exe_runner.found(): + msg = 'The exe_wrapper defined in the cross file {!r} was not ' \ + 'found. Please check the command and/or add it to PATH.' + raise TestException(msg.format(self.test.exe_runner.name)) + return self.test.exe_runner.get_command() + self.test.fname else: return self.test.fname @@ -257,19 +261,12 @@ class SingleTestRunner: self.test.timeout = None return self._run_cmd(wrap + cmd + self.test.cmd_args + self.options.test_args) - @staticmethod - def _substring_in_list(substr, strlist): - for s in strlist: - if substr in s: - return True - return False - def _run_cmd(self, cmd): starttime = time.time() if len(self.test.extra_paths) > 0: self.env['PATH'] = os.pathsep.join(self.test.extra_paths + ['']) + self.env['PATH'] - if self._substring_in_list('wine', cmd): + if mesonlib.substring_is_in_list('wine', cmd): wine_paths = ['Z:' + p for p in self.test.extra_paths] wine_path = ';'.join(wine_paths) # Don't accidentally end with an `;` because that will add the @@ -744,12 +741,13 @@ def run(args): if check_bin is not None: exe = ExternalProgram(check_bin, silent=True) if not exe.found(): - sys.exit('Could not find requested program: %s' % check_bin) + print('Could not find requested program: {!r}'.format(check_bin)) + return 1 options.wd = os.path.abspath(options.wd) if not options.list and not options.no_rebuild: if not rebuild_all(options.wd): - sys.exit(-1) + return 1 try: th = TestHarness(options) @@ -761,5 +759,8 @@ def run(args): return th.run_special() except TestException as e: print('Meson test encountered an error:\n') - print(e) + if os.environ.get('MESON_FORCE_BACKTRACE'): + raise e + else: + print(e) return 1 |