Bug 1266343 - Add unit tests for the toolchain checks. r=chmanchester

This commit is contained in:
Mike Hommey 2016-04-20 13:56:55 +09:00
parent 3b6aa4658f
commit 11908ff843
4 changed files with 1050 additions and 5 deletions

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff