Ejemplo n.º 1
0
 def test_MultiLineNoContinuationChar(self):
     # Response files can span multiple lines and do not
     # require a line continuation char like '\' or '^'.
     t = self.getTemp(close=False)
     t.write('f.c\n')
     t.write(' -I.. \n')
     t.write(' -c\n')
     t.write('-o f.o  ')
     t.close()
     argv = driver_tools.DoExpandCommandFile(['@' + t.name], 0)
     self.assertEqual(argv, ['f.c', '-I..', '-c', '-o', 'f.o'])
Ejemplo n.º 2
0
    def CheckResponseFileWithQuotedFile(self, file_to_quote):
        """Test using a response file with quotes around the filename.

    We make sure that the quotes are stripped so that we do not
    attempt to open a file with quotes in its name.
    """
        t = self.getTemp(close=False)
        t.write('-E "%s" -I.. -o out.o\n' % file_to_quote)
        # Close to flush and ensure file is reopenable on windows.
        t.close()
        pre_argv = ['early_arg.c', '@' + t.name, 'later_arg.c']
        response_pos = 1
        argv = driver_tools.DoExpandCommandFile(pre_argv, response_pos)
        self.assertEqual(argv, [
            'early_arg.c', '-E', file_to_quote, '-I..', '-o', 'out.o',
            'later_arg.c'
        ])
Ejemplo n.º 3
0
 def test_EmptyFile(self):
     t = self.getTemp()
     pre_argv = ['early_arg.c', '@' + t.name, '-S']
     argv = driver_tools.DoExpandCommandFile(pre_argv, 1)
     self.assertEqual(argv, ['early_arg.c', '-S'])