diff --git a/v2/test/BoostBuild.py b/v2/test/BoostBuild.py index 588848043..f3b005da7 100644 --- a/v2/test/BoostBuild.py +++ b/v2/test/BoostBuild.py @@ -10,6 +10,7 @@ import types import time import tempfile import sys +import re def get_toolset(): toolset = None; @@ -31,7 +32,7 @@ def prepare_suffix_map(toolset): if toolset in ["gcc"]: suffixes['.lib'] = '.a' # static libs have '.a' suffix with mingw... suffixes['.obj'] = '.o' - if os.uname()[0] == 'Darwin': + if os.__dict__.has_key('uname') and os.uname()[0] == 'Darwin': suffixes['.dll'] = '.dylib' @@ -83,7 +84,7 @@ class Tester(TestCmd.TestCmd): jam_build_dir = "" if os.name == 'nt': jam_build_dir = "bin.ntx86" - elif os.name == 'posix': + elif os.name == 'posix' and os.__dict__.has_key('uname'): if os.uname()[0].lower().startswith('cygwin'): jam_build_dir = "bin.cygwinx86" if 'TMP' in os.environ and os.environ['TMP'].find('~') != -1: @@ -126,7 +127,7 @@ class Tester(TestCmd.TestCmd): break else: print "Cannot find built Boost.Jam" - exit(1) + os.exit(1) program_list.append(os.path.join(jam_build_dir, executable)) @@ -293,14 +294,19 @@ class Tester(TestCmd.TestCmd): self.maybe_do_diff(self.stdout(), stdout) self.fail_test(1, dump_stdio = 0) - if not stderr is None and not match(self.stderr(), stderr): + # Intel tends to produce some message to stderr, which makes tests + # fail + intel_workaround = re.compile("^xi(link|lib): executing.*\n", re.M) + actual_stderr = re.sub(intel_workaround, "", self.stderr()) + + if not stderr is None and not match(actual_stderr, stderr): print "STDOUT ===================" print self.stdout() print "Expected STDERR ==========" print stderr print "Actual STDERR ============" - print self.stderr() - self.maybe_do_diff(self.stderr(), stderr) + print actual_stderr + self.maybe_do_diff(actual_stderr, stderr) self.fail_test(1, dump_stdio = 0) self.tree = build_tree(self.workdir) @@ -387,13 +393,12 @@ class Tester(TestCmd.TestCmd): d = self.unexpected_difference for name in self.adjust_names(names): - # We need to check in both touched and modified files if - # it's a Windows exe because they sometimes have slight + # We need to check in both touched and modified files. + # The reason is that: + # (1) for windows binaries often have slight # differences even with identical inputs - if windows: - filesets = [d.modified_files, d.touched_files] - else: - filesets = [d.touched_files] + # (2) Intel's compiler for Linux has the same behaviour + filesets = [d.modified_files, d.touched_files] while filesets: try: