aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-08-23 23:52:17 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-08-23 23:52:17 +0300
commit6780050cbff88de1943d6297a6169acd57e9ab3a (patch)
treeaa3e71b8e4b2b578dceceb98fdbee26bc2578c5c
parent354bdca92042fbd81952578046858b43be960abc (diff)
downloadmeson-6780050cbff88de1943d6297a6169acd57e9ab3a.zip
meson-6780050cbff88de1943d6297a6169acd57e9ab3a.tar.gz
meson-6780050cbff88de1943d6297a6169acd57e9ab3a.tar.bz2
Run cross build tests with exe wrapper.
-rw-r--r--backends.py4
-rw-r--r--cross/ubuntu-mingw.txt2
-rw-r--r--environment.py2
-rwxr-xr-xmeson_test.py11
4 files changed, 15 insertions, 4 deletions
diff --git a/backends.py b/backends.py
index 75b0264..7ac770d 100644
--- a/backends.py
+++ b/backends.py
@@ -452,7 +452,9 @@ class NinjaBackend(Backend):
for t in self.build.get_tests():
name = t.get_name()
fname = os.path.join(self.environment.get_build_dir(), self.get_target_filename(t.get_exe()))
- arr.append([name, fname])
+ is_cross = self.environment.is_cross_build()
+ exe_wrapper = self.environment.cross_info.get('exe_wrapper', None)
+ arr.append([name, fname, is_cross, exe_wrapper])
pickle.dump(arr, datafile)
def generate_dep_gen_rules(self, outfile):
diff --git a/cross/ubuntu-mingw.txt b/cross/ubuntu-mingw.txt
index 5b9fe68..bb5303f 100644
--- a/cross/ubuntu-mingw.txt
+++ b/cross/ubuntu-mingw.txt
@@ -1,5 +1,5 @@
name = 'windows'
-exe_wrapper = 'wine'
+exe_wrapper = 'wine' # A command used to run generated executables.
c = '/usr/bin/i586-mingw32msvc-gcc'
cpp = '/usr/bin/i586-mingw32msvc-g++'
root = '/usr/i586-mingw32msvc'
diff --git a/environment.py b/environment.py
index 8183cbe..c2ff299 100644
--- a/environment.py
+++ b/environment.py
@@ -134,7 +134,7 @@ class CCompiler():
pe.wait()
if pe.returncode != 0:
raise EnvironmentException('Executables created by C compiler %s are not runnable.' % self.name_string())
-
+
def has_header(self, hname):
templ = '''#include<%s>
'''
diff --git a/meson_test.py b/meson_test.py
index a169f74..55ce02d 100755
--- a/meson_test.py
+++ b/meson_test.py
@@ -44,7 +44,16 @@ def run_tests(options, datafilename):
for i, test in enumerate(tests):
name = test[0]
fname = test[1]
- cmd = wrap + [fname]
+ is_cross = test[2]
+ 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]
+ else:
+ cmd = [fname]
+ cmd = wrap + cmd
starttime = time.time()
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdo, stde) = p.communicate()