예제 #1
0
 def testMarksMostSpecific(self):
     includes = [
         add_header.Include('"cow.h"', 'include', [], None),
         add_header.Include('"cow_posix.h"', 'include', [], None),
     ]
     add_header.MarkPrimaryInclude(includes, 'cow_posix.cc')
     self.assertEqual(self._extract_primary_name(includes), '"cow_posix.h"')
예제 #2
0
 def testFullPathMatch(self):
     includes = [
         add_header.Include('"zfs/impl/cow.h"', 'include', [], None)
     ]
     add_header.MarkPrimaryInclude(includes, 'zfs/impl/cow.cc')
     self.assertEqual(self._extract_primary_name(includes),
                      '"zfs/impl/cow.h"')
예제 #3
0
 def testSubstantiallySimilarPaths(self):
     includes = [
         add_header.Include('"farm/public/animal/cow.h"', 'include', [],
                            None)
     ]
     add_header.MarkPrimaryInclude(includes, 'farm/animal/cow.cc')
     self.assertEqual(self._extract_primary_name(includes),
                      '"farm/public/animal/cow.h"')
예제 #4
0
 def testNoMatchingSubdirectories(self):
     includes = [
         add_header.Include('"base/zfs/cow.h"', 'include', [], None)
     ]
     add_header.MarkPrimaryInclude(includes, 'base/animal/cow.cc')
     self.assertIsNone(self._extract_primary_name(includes))
예제 #5
0
 def testTopmostDirectoryDoesNotMatch(self):
     includes = [
         add_header.Include('"animal/impl/cow.h"', 'include', [], None)
     ]
     add_header.MarkPrimaryInclude(includes, 'zfs/impl/cow.cc')
     self.assertIsNone(self._extract_primary_name(includes))
예제 #6
0
 def testFuzzyMatchDoesntMatchDifferentSuffixes(self):
     includes = [add_header.Include('"cow_posix.h"', 'include', [], None)]
     add_header.MarkPrimaryInclude(includes, 'cow_windows.cc')
     self.assertIsNone(self._extract_primary_name(includes))
예제 #7
0
 def testFuzzymatchInReverse(self):
     includes = [add_header.Include('"cow.h"', 'include', [], None)]
     add_header.MarkPrimaryInclude(includes, 'cow_uitest_aura.cc')
     self.assertEqual(self._extract_primary_name(includes), '"cow.h"')
예제 #8
0
 def testFuzzyMatch(self):
     includes = [add_header.Include('"cow.h"', 'include', [], None)]
     add_header.MarkPrimaryInclude(includes, 'cow_linux_unittest.cc')
     self.assertEqual(self._extract_primary_name(includes), '"cow.h"')
예제 #9
0
 def testSystemHeaderNotMatched(self):
     includes = [add_header.Include('<cow.h>', 'include', [], None)]
     add_header.MarkPrimaryInclude(includes, 'cow.cc')
     self.assertIsNone(self._extract_primary_name(includes))
예제 #10
0
 def testNoOpOnHeader(self):
     includes = [add_header.Include('"cow.h"', 'include', [], None)]
     add_header.MarkPrimaryInclude(includes, 'cow.h')
     self.assertIsNone(self._extract_primary_name(includes))