Ejemplo n.º 1
0
 public ProcessRunArguments(IConsoleApplication application, StringOrFile stdIn, TimeSpan maxRuntime, string processArguments, bool allowCrashReports)
 {
     Application       = application;
     StandardInput     = stdIn;
     ProcessArguments  = processArguments ?? string.Empty;
     AllowCrashReports = allowCrashReports;
     MaxRuntime        = maxRuntime;
 }
Ejemplo n.º 2
0
        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
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
        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;
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ShellWrapper(IConsoleApplication application)
 {
     _application = application;
 }