public ProcessRunArguments(IConsoleApplication application, StringOrFile stdIn, TimeSpan maxRuntime, string processArguments, bool allowCrashReports) { Application = application; StandardInput = stdIn; ProcessArguments = processArguments ?? string.Empty; AllowCrashReports = allowCrashReports; MaxRuntime = maxRuntime; }
static async Task Main(string[] args) { //ncrunch: no coverage start RegisterServices(); IServiceScope scope = _serviceProvider.CreateScope(); IConsoleApplication consoleApplication = scope.ServiceProvider.GetRequiredService <IConsoleApplication>(); await consoleApplication .Run() .ConfigureAwait(true); DisposeServices(); //ncrunch: no coverage end }
public ProcessRunResult Run( IConsoleApplication application, TimeSpan maxRuntime, StringOrFile stdIn, string processArguments = null, bool allowCrashReports = true ) { ProcessRunArguments args = new ProcessRunArguments( application, stdIn, maxRuntime, processArguments, allowCrashReports ); return(Run(args)); }
bool TryGetConsoleApplication(BatchEvaluationProblem problem, out IConsoleApplication application) { mCancellationToken.ThrowIfCancellationRequested(); string path = Path.Combine( mCompetitor.Directory, problem.Identifier + ".exe" ); if (!File.Exists(path)) { application = null; return(false); } application = new FileSystemConsoleApplication(path, CheckerCore.CrashReporting.CrashReportFinder.Instance); return(true); }
static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; _consoleApplication = ConsoleHost .CreateDefaultBuilder(args, new ConsoleHostConfigurationOptions { ConsulConfigurationOptions = new ConsulConfigurationOptions { AppsettingsFileName = "appsettings-async.json" } }) .Build() as IConsoleApplication; Console.WriteLine(JsonConvert.SerializeObject(_consoleApplication.Configuration)); Console.ReadKey(); }
public SolutionEvaluationTask( Action <Delegate, object[]> eventDispatcher, CancellationToken cancellationToken, IConsoleApplication mApplication, IReadOnlyList <SolutionTest> mTests ) : base(eventDispatcher, cancellationToken) { if (mApplication == null) { throw new ArgumentNullException(nameof(mApplication)); } if (mTests == null) { throw new ArgumentNullException(nameof(mTests)); } this.mApplication = mApplication; this.mTests = mTests; }
/// <summary> /// Constructor /// </summary> public ShellWrapper(IConsoleApplication application) { _application = application; }