mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Bug 1266343 - Add unit tests for the toolchain checks. r=chmanchester
This commit is contained in:
parent
3b6aa4658f
commit
11908ff843
@ -548,7 +548,7 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None):
|
||||
|
||||
if language == 'C++':
|
||||
@depends(valid_compiler, c_compiler)
|
||||
def compiler_suite_consistency(compiler, c_compiler):
|
||||
def valid_compiler(compiler, c_compiler):
|
||||
if compiler.type != c_compiler.type:
|
||||
die('The %s C compiler is %s, while the %s C++ compiler is '
|
||||
'%s. Need to use the same compiler suite.',
|
||||
@ -561,6 +561,7 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None):
|
||||
'version.',
|
||||
host_or_target_str, c_compiler.version,
|
||||
host_or_target_str, compiler.version)
|
||||
return compiler
|
||||
|
||||
# Set CC/CXX/HOST_CC/HOST_CXX for old-configure, which needs the wrapper
|
||||
# and the flags that were part of the user input for those variables to
|
||||
|
@ -40,6 +40,7 @@ PYTHON_UNIT_TESTS += [
|
||||
'mozbuild/mozbuild/test/configure/test_configure.py',
|
||||
'mozbuild/mozbuild/test/configure/test_moz_configure.py',
|
||||
'mozbuild/mozbuild/test/configure/test_options.py',
|
||||
'mozbuild/mozbuild/test/configure/test_toolchain_configure.py',
|
||||
'mozbuild/mozbuild/test/configure/test_util.py',
|
||||
'mozbuild/mozbuild/test/controller/test_ccachestats.py',
|
||||
'mozbuild/mozbuild/test/controller/test_clobber.py',
|
||||
|
@ -166,9 +166,15 @@ class BaseConfigureTest(unittest.TestCase):
|
||||
return 0, args[0], ''
|
||||
|
||||
def get_sandbox(self, paths, config, args=[], environ={}, mozconfig='',
|
||||
out=None):
|
||||
if not out:
|
||||
out = StringIO()
|
||||
out=None, logger=None):
|
||||
kwargs = {}
|
||||
if logger:
|
||||
kwargs['logger'] = logger
|
||||
else:
|
||||
if not out:
|
||||
out = StringIO()
|
||||
kwargs['stdout'] = out
|
||||
kwargs['stderr'] = out
|
||||
|
||||
if mozconfig:
|
||||
fh, mozconfig_path = tempfile.mkstemp()
|
||||
@ -191,7 +197,7 @@ class BaseConfigureTest(unittest.TestCase):
|
||||
paths[mozpath.join(autoconf_dir, 'config.sub')] = self.config_sub
|
||||
|
||||
sandbox = ConfigureTestSandbox(paths, config, environ,
|
||||
['configure'] + args, out, out)
|
||||
['configure'] + args, **kwargs)
|
||||
sandbox.include_file(os.path.join(topsrcdir, 'moz.configure'))
|
||||
|
||||
return sandbox
|
||||
|
1037
python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
Normal file
1037
python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user