/// <summary> /// Provides a ProcessExecutionContextArgs structure containing the necessary information to launch the test process. /// Aggregates the BoostTestRunnerCommandLineArgs structure with the command-line arguments specified at configuration stage. /// </summary> /// <param name="args">The Boost Test Framework command line arguments</param> /// <param name="settings">The Boost Test Runner settings</param> /// <returns>A valid ProcessExecutionContextArgs structure to launch the test executable</returns> protected override ProcessExecutionContextArgs GetExecutionContextArgs(BoostTestRunnerCommandLineArgs args, BoostTestRunnerSettings settings) { Code.Require(args, "args"); ProcessExecutionContextArgs info = base.GetExecutionContextArgs(args, settings); BoostTestRunnerCommandLineArgs tmpArgs = args.Clone(); tmpArgs.StandardErrorFile = null; tmpArgs.StandardOutFile = null; CommandEvaluator evaluator = BuildEvaluator(this.Source, tmpArgs, settings); CommandEvaluationResult result = evaluator.Evaluate(this.Settings.ExecutionCommandLine.Arguments); string cmdLineArgs = result.Result; if (!result.MappedVariables.Contains(BoostArgsPlaceholder)) { cmdLineArgs = result.Result + (result.Result.EndsWith(" ", StringComparison.Ordinal) ? string.Empty : " ") + args.ToString(); } BoostTestRunnerCommandLineArgs redirection = new BoostTestRunnerCommandLineArgs { StandardOutFile = args.StandardOutFile, StandardErrorFile = args.StandardErrorFile }; cmdLineArgs += redirection.ToString(); info.FilePath = evaluator.Evaluate(this.Settings.ExecutionCommandLine.FileName).Result; info.Arguments = cmdLineArgs; return(info); }
/// <summary> /// Provides a ProcessStartInfo structure containing the necessary information to launch the test process. /// Aggregates the BoostTestRunnerCommandLineArgs structure with the command-line arguments specified at configuration stage. /// </summary> /// <param name="args">The Boost Test Framework command line arguments</param> /// <param name="settings">The Boost Test Runner settings</param> /// <returns>A valid ProcessStartInfo structure to launch the test executable</returns> protected override ProcessStartInfo GetStartInfo(BoostTestRunnerCommandLineArgs args, BoostTestRunnerSettings settings) { ProcessStartInfo info = base.GetStartInfo(args, settings); CommandEvaluator evaluator = BuildEvaluator(this.Source, args, settings); CommandEvaluationResult result = evaluator.Evaluate(this.Settings.ExecutionCommandLine.Arguments); string cmdLineArgs = result.Result; if (!result.MappedVariables.Contains(BoostArgsPlaceholder)) { cmdLineArgs = result.Result + (result.Result.EndsWith(" ", StringComparison.Ordinal) ? string.Empty : " ") + args.ToString(); } info.FileName = this.Settings.ExecutionCommandLine.FileName; info.Arguments = cmdLineArgs; return(info); }