Skip to content

Commit

Permalink
drop support for pdb file caching (pdb files get merged if they exist…
Browse files Browse the repository at this point in the history
… already so are not a deterministic output)

increase compiler client timeout to ~5 sec (up from 0.5 sec)
  • Loading branch information
unknown committed Feb 8, 2014
1 parent c13650d commit 350233f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 28 deletions.
26 changes: 13 additions & 13 deletions CClash.Tests/CompilerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@ public void ParseSupportedArgs(params string[] argv)
[TestCase("/c", "test-sources\\exists.c", "/Zi", "/Fowhatever.obj")]
[TestCase("/c", "test-sources\\exists.c", "/Zi", "/Fotest-sources")]
[TestCase("/c", "test-sources\\exists.c", "/Zi", "/Fdtest-sources\\stuff.pdb")]
public void ParseSupportedPdbArgs(params string[] argv)
public void ParseUnSupportedPdbArgs(params string[] argv)
{
var c = new Compiler();
c.CompilerExe = CompilerPath;
Assert.IsFalse(c.ProcessArguments(argv));
}

[Test]
[TestCase("/c", "test-sources\\exists.c", "/Zi","/Z7")]
[TestCase("/c", "test-sources\\exists.c", "/Zi", "/Fowhatever.obj", "/Z7")]
[TestCase("/c", "test-sources\\exists.c", "/Zi", "/Fotest-sources", "/Z7")]
[TestCase("/c", "test-sources\\exists.c", "/Zi", "/Fdtest-sources\\stuff.pdb", "/Z7")]
public void ParseSupportedPdbArgs(params string[] argv) {
var c = new Compiler();
c.CompilerExe = CompilerPath;
Assert.IsTrue(c.ProcessArguments(argv));
Assert.IsTrue(c.GeneratePdb);
Assert.IsNotNullOrEmpty(c.PdbFile);
EnsureDeleted(c.PdbFile);
EnsureDeleted(c.ObjectTarget);
var stderr = new StringBuilder();
var stdout = new StringBuilder();
var ec = c.InvokeCompiler(c.CommandLine,
x => stderr.AppendLine(x),
x => stdout.AppendLine(x), false, null);
Assert.AreEqual(0, ec);
Assert.IsTrue(File.Exists(c.ObjectTarget));
Assert.IsTrue(File.Exists(c.PdbFile));
Assert.IsFalse(c.GeneratePdb);
}

[Test]
Expand Down
20 changes: 5 additions & 15 deletions CClash/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ public bool ProcessArguments(string[] args)

case "/Z7":
GeneratePdb = false;
PdbFile = null;
break;

case "/Yu":
Expand Down Expand Up @@ -442,22 +443,11 @@ public bool ProcessArguments(string[] args)
var f = Path.GetFileNameWithoutExtension(SingleSourceFile) + ".obj";
ObjectTarget = Path.Combine(Environment.CurrentDirectory, f);
}
if (GeneratePdb && PdbFile == null)
{
for ( int x = 14; x > 8; x-- )
{
if ( CompilerExe.Contains(string.Format("Microsoft Visual Studio {0}.0",x)) )
{
var f = string.Format("vc{0}0.pdb", x);
PdbFile = Path.Combine(Environment.CurrentDirectory, f);
break;
}
}
if ( PdbFile == null ) {
Logging.Emit("could not work out compiler version for auto generated pdb");
return false;
}

if (GeneratePdb) {
return false;
}

}

}
Expand Down
Binary file modified cclash.v11.suo
Binary file not shown.

0 comments on commit 350233f

Please sign in to comment.