From 2a844b7ff850f9538f4952c5f2aef0c6d38b2b72 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 6 Mar 2013 02:34:51 +0000 Subject: [PATCH] Fixed test suite errors due to new clang -v output. llvm-svn: 176546 --- lldb/test/lang/cpp/unique-types/TestUniqueTypes.py | 6 ++++-- lldb/test/lldbtest.py | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py index a1716b9..9dd6fda 100644 --- a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py +++ b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py @@ -34,14 +34,16 @@ class UniqueTypesTestCase(TestBase): def unique_types(self): """Test for unique types of std::vector and std::vector.""" - if "clang" in self.getCompiler() and int(self.getCompilerVersion().split('.')[0]) < 3: + compiler = self.getCompiler() + compiler_basename = os.path.basename(compiler) + if "clang" in compiler_basename and int(self.getCompilerVersion().split('.')[0]) < 3: self.skipTest("rdar://problem/9173060 lldb hangs while running unique-types for clang version < 3") exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # GCC 4.6.3 (but not 4.4, 4.6.5 or 4.7) encodes two locations for the 'return 0' statement in main.cpp - locs = 2 if "gcc" in self.getCompiler() and "4.6.3" in self.getCompilerVersion() else 1 + locs = 2 if "gcc" in compiler_basename and "4.6.3" in self.getCompilerVersion() else 1 lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=locs, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py index e62b2b7..f29d947 100644 --- a/lldb/test/lldbtest.py +++ b/lldb/test/lldbtest.py @@ -1024,11 +1024,7 @@ class Base(unittest2.TestCase): compiler = self.getCompiler() version_output = system([which(compiler), "-v"])[1] for line in version_output.split(os.linesep): - compiler_shortname = 'invalid' - for c in ["clang", "LLVM", "gcc"]: - if c in compiler: - compiler_shortname = c - m = re.search('%s version ([0-9\.]+)' % compiler_shortname, line) + m = re.search('version ([0-9\.]+)', line) if m: version = m.group(1) return version -- 2.7.4