def testParseIncludesStrip(self): includesSet, newCompilerOutput = clcache.parseIncludesList(self.sampleCompilerOutput, r"C:\Users\me\test\smartsqlite\src\version.cpp", None, strip=True) self.assertEquals(len(includesSet), self.sampleUniqueIncludesCount) self.assertTrue(r'c:\users\me\test\smartsqlite\include\smartsqlite\version.h' in includesSet) self.assertTrue(r'c:\program files (x86)\microsoft visual studio 12.0\vc\include\concurrencysal.h' in includesSet) self.assertEquals(newCompilerOutput, "version.cpp\n")
def testParseIncludesNoIncludes(self): sample = self._readSampleFileNoIncludes() for stripIncludes in [True, False]: includesSet, newCompilerOutput = clcache.parseIncludesList(sample['CompilerOutput'], r"C:\Users\me\test\myproject\main.cpp", None, strip=stripIncludes) self.assertEqual(len(includesSet), sample['UniqueIncludesCount']) self.assertEqual(newCompilerOutput, "main.cpp\n")
def testParseIncludesStrip(self): sample = self._readSampleFileDefault() includesSet, newCompilerOutput = clcache.parseIncludesList(sample['CompilerOutput'], r"C:\Users\me\test\smartsqlite\src\version.cpp", None, strip=True) self.assertEqual(len(includesSet), sample['UniqueIncludesCount']) self.assertTrue(r'c:\users\me\test\smartsqlite\include\smartsqlite\version.h' in includesSet) self.assertTrue(r'c:\program files (x86)\microsoft visual studio 12.0\vc\include\concurrencysal.h' in includesSet) self.assertTrue(r'' not in includesSet) self.assertEqual(newCompilerOutput, "version.cpp\n")
def testParseIncludesNoIncludes(self): sample = self._readSampleFileNoIncludes() for stripIncludes in [True, False]: includesSet, newCompilerOutput = clcache.parseIncludesList( sample['CompilerOutput'], r"C:\Projects\test\myproject\main.cpp", None, strip=stripIncludes) self.assertEqual(len(includesSet), sample['UniqueIncludesCount']) self.assertEqual(newCompilerOutput, "main.cpp\n")
def testParseIncludesGerman(self): sample = self._readSampleFileDefault(lang="de") includesSet, _ = clcache.parseIncludesList( sample['CompilerOutput'], r"C:\Projects\test\smartsqlite\src\version.cpp", None, strip=False) self.assertEqual(len(includesSet), sample['UniqueIncludesCount']) self.assertTrue( r'c:\projects\test\smartsqlite\include\smartsqlite\version.h' in includesSet) self.assertTrue( r'c:\program files (x86)\microsoft visual studio 12.0\vc\include\concurrencysal.h' in includesSet) self.assertTrue(r'' not in includesSet)