diff options
| -rwxr-xr-x | meson_test.py | 38 | ||||
| -rwxr-xr-x | run_cross_test.py | 3 | 
2 files changed, 24 insertions, 17 deletions
diff --git a/meson_test.py b/meson_test.py index 55ce02dca..8062aae65 100755 --- a/meson_test.py +++ b/meson_test.py @@ -48,27 +48,35 @@ def run_tests(options, datafilename):          exe_wrapper = test[3]          if is_cross:              if exe_wrapper is None: -                print('Can not run test on cross compiled executable because there is no execute wrapper.') -                sys.exit(1) -            cmd = [exe_wrapper, fname] +                # 'Can not run test on cross compiled executable  +                # because there is no execute wrapper. +                cmd = None +            else: +                cmd = [exe_wrapper, fname]          else:              cmd = [fname] -        cmd = wrap + cmd -        starttime = time.time() -        p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) -        (stdo, stde) = p.communicate() -        endtime = time.time() -        duration = endtime - starttime -        stdo = stdo.decode() -        stde = stde.decode() +        if cmd is None: +            res = 'SKIP' +            duration = 0.0 +            stdo = 'Not run because can not execute cross compiled binaries.' +            stde = '' +        else: +            cmd = wrap + cmd +            starttime = time.time() +            p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +            (stdo, stde) = p.communicate() +            endtime = time.time() +            duration = endtime - starttime +            stdo = stdo.decode() +            stde = stde.decode() +            if p.returncode == 0: +                res = 'OK' +            else: +                res = 'FAIL'          startpad = ' '*(numlen - len('%d' % (i+1)))          num = '%s%d/%d' % (startpad, i+1, len(tests))          padding1 = ' '*(40-len(name)) -        if p.returncode == 0: -            res = 'OK' -        else: -            res = 'FAIL'          padding2 = ' '*(5-len(res))          result_str = '%s %s%s%s%s(%5.2f s)' % (num, name, padding1, res, padding2, duration)          print(result_str) diff --git a/run_cross_test.py b/run_cross_test.py index e96e622ec..d1eb6898e 100755 --- a/run_cross_test.py +++ b/run_cross_test.py @@ -22,7 +22,6 @@ Not part of the main test suite because of two reasons:  Eventually migrate to something fancier.''' -from glob import glob  import os, subprocess, shutil, sys  import environment @@ -32,7 +31,7 @@ test_build_dir = 'work area'  install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir')  meson_command = './meson.py' -extra_flags = ['--cross-file', 'cross/ubuntu-mingw.txt'] +extra_flags = ['--cross-file', 'cross/ubuntu-armhf.txt']  ninja_command = environment.detect_ninja()  if ninja_command is None:      raise RuntimeError('Could not find Ninja executable.')  | 
