InvokePreprocessor() public method

public InvokePreprocessor ( StreamWriter stdout ) : int
stdout System.IO.StreamWriter
return int
Beispiel #1
0
        public void PreprocessorTest(params string[] argv)
        {
            var c = new Compiler() { CompilerExe = CompilerPath };
            c.SetWorkingDirectory(InitialDir);
            c.SetEnvironment(Compiler.GetEnvironmentDictionary());

            var supported = c.ProcessArguments(argv);
            
            Assert.IsTrue(supported);
            Assert.AreEqual(1, c.CliIncludePaths.Count);
            Assert.AreEqual( Path.Combine(InitialDir, "test-sources\\inc with spaces"), c.CliIncludePaths[0]);
            Assert.AreEqual( Path.Combine(InitialDir, "test-sources\\hello.c"), c.SingleSourceFile);
            using (var sw = new StreamWriter(new MemoryStream()))
            {
                var rv = c.InvokePreprocessor(sw);
                Assert.AreEqual(0, rv);
            }
        }