Run cross build tests with exe wrapper.

pull/15/head
Jussi Pakkanen 11 years ago
parent 354bdca920
commit 6780050cbf
  1. 4
      backends.py
  2. 2
      cross/ubuntu-mingw.txt
  3. 2
      environment.py
  4. 11
      meson_test.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):

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

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

@ -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()

Loading…
Cancel
Save