def test_ForceFunction(self):
    """Test the internal functions directly."""
    made_up_file1 = 'dummy1'
    filetype.SetForcedFileType('c')
    self.assertEqual(filetype.GetForcedFileType(), 'c')
    filetype.ForceFileType(made_up_file1)
    self.assertEqual(filetype.FileType(made_up_file1), 'c')
    filetype.ForceFileType(made_up_file1)

    made_up_file2 = 'dummy2'
    filetype.SetForcedFileType('cpp')
    filetype.ForceFileType(made_up_file2)
    self.assertEqual(filetype.FileType(made_up_file2), 'cpp')
    filetype.ForceFileType(made_up_file1)
 def tearDown(self):
   # Wipe other temp files that are normally wiped by DriverExit.
   # We don't want anything to exit, so we do not call DriverExit manually.
   driver_temps.TempFiles.wipe()
   # Reset some internal state.
   filetype.ClearFileTypeCaches()
   filetype.SetForcedFileType(None)
示例#3
0
 def tearDown(self):
     # Reset some internal state.
     sys.exit = self.exit_backup
     filetype.ClearFileTypeCaches()
     filetype.SetForcedFileType(None)
     shutil.rmtree(self.temp_dir)
     super(TestPrecompiledHeaders, self).tearDown()
示例#4
0
def HandleDashX(arg):
    if arg == 'none':
        filetype.SetForcedFileType(None)
        return
    filetype.SetForcedFileType(filetype.GCCTypeToFileType(arg))
 def setUp(self):
   driver_test_utils.ApplyTestEnvOverrides(env)
   # Reset some internal state.
   filetype.ClearFileTypeCaches()
   filetype.SetForcedFileType(None)
示例#6
0
 def runDriver(self, driver, flags):
     driver_tools.RunDriver(driver, flags)
     # Reset some internal state.
     filetype.ClearFileTypeCaches()
     filetype.SetForcedFileType(None)