Skip to content

Commit

Permalink
Fix cross test and run them if a cross compiler is available.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Dec 20, 2016
1 parent 4317edc commit 2b65083
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cross/ubuntu-armhf.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[binaries]
# we could set exe_wrapper = qemu-arm-static but to test the case
# when cross compiled binaries can't be run we don't do that
c = '/usr/bin/arm-linux-gnueabihf-gcc'
cpp = '/usr/bin/arm-linux-gnueabihf-g++'
c = '/usr/bin/arm-linux-gnueabihf-gcc-6'
cpp = '/usr/bin/arm-linux-gnueabihf-g++-6'
ar = '/usr/arm-linux-gnueabihf/bin/ar'
strip = '/usr/arm-linux-gnueabihf/bin/strip'
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
Expand Down
2 changes: 1 addition & 1 deletion mesontest.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def run_single_test(self, wrap, test):
duration = 0.0
stdo = 'Not run because can not execute cross compiled binaries.'
stde = None
returncode = -1
returncode = GNU_SKIP_RETURNCODE
else:
cmd = wrap + cmd + test.cmd_args
starttime = time.time()
Expand Down
2 changes: 1 addition & 1 deletion run_cross_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import os, subprocess, shutil, sys
import mesonbuild.environment as environment

from run_tests import gather_tests
from run_project_tests import gather_tests

test_build_dir = 'work area'
install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir')
Expand Down
3 changes: 3 additions & 0 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
if mesonlib.is_linux():
print('Running unittests.\n')
returncode += subprocess.call([sys.executable, 'run_unittests.py', '-v'])
if shutil.which('arm-linux-gnueabihf-gcc-6'): # Ubuntu packages do not have a binary without -6 suffix.
print('Running cross compilation tests.\n')
returncode += subprocess.call([sys.executable, 'run_cross_test.py', 'cross/ubuntu-armhf.txt'])
returncode += subprocess.call([sys.executable, 'run_project_tests.py'] + sys.argv[1:])
sys.exit(returncode)

0 comments on commit 2b65083

Please sign in to comment.