зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1270446 - Automatically add --target argument when unit test class has a TARGET attribute. r=chmanchester
This commit is contained in:
Родитель
4af7d047e9
Коммит
e0898b3dc1
|
@ -176,6 +176,11 @@ class BaseConfigureTest(unittest.TestCase):
|
|||
kwargs['stdout'] = out
|
||||
kwargs['stderr'] = out
|
||||
|
||||
if hasattr(self, 'TARGET'):
|
||||
target = ['--target=%s' % self.TARGET]
|
||||
else:
|
||||
target = []
|
||||
|
||||
if mozconfig:
|
||||
fh, mozconfig_path = tempfile.mkstemp()
|
||||
os.write(fh, mozconfig)
|
||||
|
@ -197,7 +202,8 @@ class BaseConfigureTest(unittest.TestCase):
|
|||
paths[mozpath.join(autoconf_dir, 'config.sub')] = self.config_sub
|
||||
|
||||
sandbox = ConfigureTestSandbox(paths, config, environ,
|
||||
['configure'] + args, **kwargs)
|
||||
['configure'] + target + args,
|
||||
**kwargs)
|
||||
sandbox.include_file(os.path.join(topsrcdir, 'moz.configure'))
|
||||
|
||||
return sandbox
|
||||
|
|
|
@ -664,6 +664,7 @@ class WindowsToolchainTest(BaseToolchainTest):
|
|||
|
||||
|
||||
class CrossCompileToolchainTest(BaseToolchainTest):
|
||||
TARGET = 'arm-unknown-linux-gnu'
|
||||
PATHS = {
|
||||
'/usr/bin/arm-linux-gnu-gcc': GCC_4_9,
|
||||
'/usr/bin/arm-linux-gnu-g++': GXX_4_9,
|
||||
|
@ -695,7 +696,7 @@ class CrossCompileToolchainTest(BaseToolchainTest):
|
|||
},
|
||||
'host_c_compiler': self.GCC_4_9_RESULT,
|
||||
'host_cxx_compiler': self.GXX_4_9_RESULT,
|
||||
}, args=['--target=arm-unknown-linux-gnu'])
|
||||
})
|
||||
|
||||
def test_overridden_cross_gcc(self):
|
||||
self.do_toolchain_test(self.PATHS, {
|
||||
|
@ -703,7 +704,7 @@ class CrossCompileToolchainTest(BaseToolchainTest):
|
|||
'cxx_compiler': self.ARM_GXX_5_RESULT,
|
||||
'host_c_compiler': self.GCC_4_9_RESULT,
|
||||
'host_cxx_compiler': self.GXX_4_9_RESULT,
|
||||
}, args=['--target=arm-unknown-linux-gnu'], environ={
|
||||
}, environ={
|
||||
'CC': 'arm-linux-gnu-gcc-5',
|
||||
'CXX': 'arm-linux-gnu-g++-5',
|
||||
})
|
||||
|
@ -711,7 +712,7 @@ class CrossCompileToolchainTest(BaseToolchainTest):
|
|||
def test_overridden_unsupported_cross_gcc(self):
|
||||
self.do_toolchain_test(self.PATHS, {
|
||||
'c_compiler': self.ARM_GCC_4_7_RESULT,
|
||||
}, args=['--target=arm-unknown-linux-gnu'], environ={
|
||||
}, environ={
|
||||
'CC': 'arm-linux-gnu-gcc-4.7',
|
||||
'CXX': 'arm-linux-gnu-g++-4.7',
|
||||
})
|
||||
|
@ -723,7 +724,7 @@ class CrossCompileToolchainTest(BaseToolchainTest):
|
|||
'cxx_compiler': self.ARM_GXX_5_RESULT,
|
||||
'host_c_compiler': self.GCC_4_9_RESULT,
|
||||
'host_cxx_compiler': self.GXX_4_9_RESULT,
|
||||
}, args=['--target=arm-unknown-linux-gnu'], environ={
|
||||
}, environ={
|
||||
'CC': 'arm-linux-gnu-gcc-5',
|
||||
})
|
||||
|
||||
|
@ -732,7 +733,7 @@ class CrossCompileToolchainTest(BaseToolchainTest):
|
|||
'cxx_compiler': self.ARM_GXX_5_RESULT,
|
||||
'host_c_compiler': self.CLANG_3_6_RESULT,
|
||||
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
|
||||
}, args=['--target=arm-unknown-linux-gnu'], environ={
|
||||
}, environ={
|
||||
'CC': 'arm-linux-gnu-gcc-5',
|
||||
'HOST_CC': 'clang',
|
||||
})
|
||||
|
@ -742,7 +743,7 @@ class CrossCompileToolchainTest(BaseToolchainTest):
|
|||
'cxx_compiler': self.ARM_GXX_5_RESULT,
|
||||
'host_c_compiler': self.CLANG_3_6_RESULT,
|
||||
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
|
||||
}, args=['--target=arm-unknown-linux-gnu'], environ={
|
||||
}, environ={
|
||||
'CC': 'arm-linux-gnu-gcc-5',
|
||||
'CXX': 'arm-linux-gnu-g++-5',
|
||||
'HOST_CC': 'clang',
|
||||
|
|
Загрузка…
Ссылка в новой задаче