def testAppend(self): cmdLine, env = clcache.extendCommandLineFromEnvironment(['/nologo'], { 'USER': '******', '_CL_': 'file.c', }) self.assertEqual(cmdLine, ['/nologo', 'file.c']) self.assertEqual(env, {'USER': '******'})
def testPrepend(self): cmdLine, env = clcache.extendCommandLineFromEnvironment(['/nologo'], { 'USER': '******', 'CL': '/MP', }) self.assertEqual(cmdLine, ['/MP', '/nologo']) self.assertEqual(env, {'USER': '******'})
def testPrependMultiple(self): cmdLine, _ = clcache.extendCommandLineFromEnvironment(['INPUT.C'], { 'CL': r'/Zp2 /Ox /I\INCLUDE\MYINCLS \LIB\BINMODE.OBJ', }) self.assertEqual(cmdLine, ['/Zp2', '/Ox', r'/I\INCLUDE\MYINCLS', r'\LIB\BINMODE.OBJ', 'INPUT.C'])
def testSimple(self): cmdLine, env = clcache.extendCommandLineFromEnvironment(['/nologo'], {'USER': '******'}) self.assertEqual(cmdLine, ['/nologo']) self.assertEqual(env, {'USER': '******'})
def testEmpty(self): cmdLine, env = clcache.extendCommandLineFromEnvironment([], {}) self.assertEqual(cmdLine, []) self.assertEqual(env, {})