Skip to content

Commit

Permalink
Added option to customise the time out
Browse files Browse the repository at this point in the history
-
  • Loading branch information
wforums committed Jul 5, 2015
1 parent 1eb5ed9 commit 85d1ebe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CCExtractorTester/Analyzers/Tester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,13 @@ public void Process(object state){

string command = te.Command + String.Format(@" --no_progress_bar -o ""{0}"" ""{1}"" ",producedFile,sampleFile);

RunData rd = runner.Run (command,processError,processOutput);
int timeout = 180;
try {
timeout = int.Parse (config.GetAppSetting ("timeout"));
} catch(FormatException){
}

RunData rd = runner.Run (command,processError,processOutput,timeout);

try {
comparer.CompareAndAddToResult (
Expand Down
5 changes: 5 additions & 0 deletions CCExtractorTester/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class Options {
public string ResultFolder { get; set; }
[Option('h',"comparer",HelpText="The type of comparer to use (overrides the config file)")]
public string Comparer { get; set; }
[Option('o',"timeout",DefaultValue=180,HelpText="The timeout value (in seconds). A test will be aborted if CCExtractor is still running after this point. Must be bigger than 60.")]
public int TimeOut { get; set; }

[ParserState]
public IParserState LastParserState { get; set; }
Expand Down Expand Up @@ -113,6 +115,9 @@ public static void Main (string[] args)
return;
}
}
if (options.TimeOut > 60) {
config.SetAppSetting ("timeout", options.TimeOut.ToString());
}
if (!String.IsNullOrEmpty (options.Comparer)) {
config.SetAppSetting ("Comparer", options.Comparer);
Logger.Info ("Overriding Comparer with: " + options.Comparer);
Expand Down

0 comments on commit 85d1ebe

Please sign in to comment.