Skip tests for cross compilation when they can not be run.

pull/15/head
Jussi Pakkanen 12 years ago
parent 6aa1152d72
commit 696f72da1b
  1. 38
      meson_test.py
  2. 3
      run_cross_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)

@ -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.')

Loading…
Cancel
Save