Exemplo n.º 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"')
Exemplo n.º 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"')
Exemplo n.º 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"')
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 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"')
Exemplo n.º 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"')
Exemplo n.º 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))
Exemplo n.º 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))