def testIgnoreTrusted(self): filenames = [ os.path.join('ppapi', 'c', 'trusted', 'ppb_broker_trusted.h'), os.path.join('ppapi', 'cpp', 'trusted', 'file_chooser_trusted.cc'), ] result = verify_ppapi.PartitionFiles(filenames) self.assertEqual(0, len(result['ppapi'])) self.assertEqual(0, len(result['ppapi_cpp'])) self.assertEqual(0, len(result['ppapi_cpp_private']))
def testIgnoreDocumentation(self): filenames = [ os.path.join('ppapi', 'c', 'documentation', 'Doxyfile'), os.path.join('ppapi', 'c', 'documentation', 'index.dox'), os.path.join('ppapi', 'cpp', 'documentation', 'footer.html'), ] result = verify_ppapi.PartitionFiles(filenames) self.assertEqual(0, len(result['ppapi'])) self.assertEqual(0, len(result['ppapi_cpp'])) self.assertEqual(0, len(result['ppapi_cpp_private']))
def testIgnoreIfNotSourceOrHeader(self): filenames = [ os.path.join('ppapi', 'c', 'DEPS'), os.path.join('ppapi', 'c', 'blah', 'foo.xml'), os.path.join('ppapi', 'cpp', 'DEPS'), os.path.join('ppapi', 'cpp', 'foobar.py'), ] result = verify_ppapi.PartitionFiles(filenames) self.assertEqual(0, len(result['ppapi'])) self.assertEqual(0, len(result['ppapi_cpp'])) self.assertEqual(0, len(result['ppapi_cpp_private']))
def testBasic(self): filenames = [ os.path.join('ppapi', 'c', 'ppb_foo.h'), os.path.join('ppapi', 'cpp', 'foo.h'), os.path.join('ppapi', 'cpp', 'foo.cc'), ] result = verify_ppapi.PartitionFiles(filenames) self.assertTrue(filenames[0] in result['ppapi']) self.assertTrue(filenames[1] in result['ppapi_cpp']) self.assertTrue(filenames[2] in result['ppapi_cpp']) self.assertEqual(0, len(result['ppapi_cpp_private']))
def testIgnoreOtherDirectories(self): ignored_directories = [ 'api', 'examples', 'generators', 'host', 'lib', 'native_client', 'proxy', 'shared_impl', 'tests', 'thunk' ] # Generate some random files in the ignored directories. filenames = [] for dirname in ignored_directories: filenames = os.path.join('ppapi', dirname, 'foo.cc') filenames = os.path.join('ppapi', dirname, 'subdir', 'foo.h') filenames = os.path.join('ppapi', dirname, 'DEPS') result = verify_ppapi.PartitionFiles(filenames) self.assertEqual(0, len(result['ppapi'])) self.assertEqual(0, len(result['ppapi_cpp'])) self.assertEqual(0, len(result['ppapi_cpp_private']))