CClash.Compiler.SetWorkingDirectory C# (CSharp) Method

SetWorkingDirectory() public method

public SetWorkingDirectory ( string path ) : void
path string
return void
        public void SetWorkingDirectory(string path)
        {
            if (path == null) throw new ArgumentNullException("path");
            if (!Directory.Exists(path)) throw new DirectoryNotFoundException("path " + path);
            compworkdir = path;
        }

Usage Example

Beispiel #1
0
        public void ParseSupportedArgs(params string[] argv)
        {
            var c = new Compiler();
            c.SetWorkingDirectory(InitialDir);
            c.SetEnvironment(Compiler.GetEnvironmentDictionary());
            var sbo = new StringBuilder();
            var sbe = new StringBuilder();
            Assert.IsTrue(c.ProcessArguments(argv));
            Assert.IsFalse(c.Linking);
            Assert.IsTrue(c.SingleSource);
            Assert.IsNotNullOrEmpty(c.ObjectTarget);
            Assert.IsFalse(c.PrecompiledHeaders);
            Assert.AreNotEqual(c.SingleSourceFile, c.ObjectTarget);

            EnsureDeleted(c.ObjectTarget);
            EnsureDeleted(c.PdbFile);
            
            c.CompilerExe = CompilerPath;
            c.SetWorkingDirectory(InitialDir);
            c.SetEnvironment(Compiler.GetEnvironmentDictionary());
            var ec = c.InvokeCompiler(
                c.CommandLine,
                Console.Error.WriteLine, Console.Error.WriteLine, false, null);

            Assert.AreEqual(0, ec);

            Assert.IsTrue(File.Exists(c.ObjectTarget));
        }
All Usage Examples Of CClash.Compiler::SetWorkingDirectory