예제 #1
0
 def testSpacesInFilenames(self):
     self.tempfile = tempfile.mktemp("_sdktest")
     with open(self.tempfile, 'w') as out:
         out.write('foo.o: foo\\ bar.h\n')
     fix_deps.FixupDepFile(self.tempfile)
     with open(self.tempfile) as infile:
         contents = infile.read()
     lines = contents.splitlines()
     self.assertEqual(len(lines), 3)
     self.assertEqual(lines[2], 'foo\\ bar.h:')
예제 #2
0
 def testColonInFilename(self):
     self.tempfile = tempfile.mktemp("_sdktest")
     with open(self.tempfile, 'w') as out:
         out.write('foo.o: c:foo.c\\\n c:bar.h\n')
     fix_deps.FixupDepFile(self.tempfile)
     with open(self.tempfile) as infile:
         contents = infile.read()
     lines = contents.splitlines()
     self.assertEqual(len(lines), 5)
     self.assertEqual(lines[3], 'c:foo.c:')
     self.assertEqual(lines[4], 'c:bar.h:')
예제 #3
0
 def testAddsDeps(self):
     self.tempfile = tempfile.mktemp("_sdktest")
     with open(self.tempfile, 'w') as out:
         out.write('foo.o: foo.c foo.h bar.h\n')
     fix_deps.FixupDepFile(self.tempfile)
     with open(self.tempfile) as infile:
         contents = infile.read()
     lines = contents.splitlines()
     self.assertEqual(len(lines), 5)
     self.assertTrue('foo.c:' in lines)
     self.assertTrue('foo.h:' in lines)
     self.assertTrue('bar.h:' in lines)
예제 #4
0
 def testDoubleInvoke(self):
     self.tempfile = tempfile.mktemp("_sdktest")
     with open(self.tempfile, 'w') as out:
         out.write('foo.o: foo\\ bar.h\n')
     fix_deps.FixupDepFile(self.tempfile)
     self.assertRaises(fix_deps.Error, fix_deps.FixupDepFile, self.tempfile)