From acef972a5557839ab84377b73324db4ef003e3ed Mon Sep 17 00:00:00 2001 From: triton Date: Tue, 6 May 2014 16:56:57 +0100 Subject: [PATCH] Added support for a "dry run" option that does not write anything to disk. --- src/Generator/Driver.cs | 4 +++- src/Generator/Options.cs | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs index 0dca66ab..531432e1 100644 --- a/src/Generator/Driver.cs +++ b/src/Generator/Driver.cs @@ -470,7 +470,9 @@ namespace CppSharp } } - driver.WriteCode(outputs); + if (!driver.Options.DryRun) + driver.WriteCode(outputs); + if (driver.Options.IsCSharpGenerator) driver.CompileCode(); } diff --git a/src/Generator/Options.cs b/src/Generator/Options.cs index 68dda98d..deec8d7d 100644 --- a/src/Generator/Options.cs +++ b/src/Generator/Options.cs @@ -54,7 +54,15 @@ namespace CppSharp // General options public bool Quiet; public bool ShowHelpText; - public bool OutputDebug; + public bool OutputDebug; + + /// + /// Set to true to simulate generating without actually writing + /// any output to disk. This can be useful to activate while + /// debugging the parser generator so generator bugs do not get + /// in the way while iterating. + /// + public bool DryRun; // Parser options public List Headers;