Exemplo n.º 1
0
        internal static int Main(string[] args)
        {
            Logger.Log("RunTest command line");
            Logger.Log(string.Join(" ", args));

            var options = Options.Parse(args);

            if (options == null)
            {
                Options.PrintUsage();
                return(ExitFailure);
            }

            // Setup cancellation for ctrl-c key presses
            var cts = new CancellationTokenSource();

            Console.CancelKeyPress += delegate
            {
                cts.Cancel();
            };

            var result = Run(options, cts.Token).GetAwaiter().GetResult();

            CheckTotalDumpFilesSize();
            return(result);
        }
Exemplo n.º 2
0
        internal static int Main(string[] args)
        {
            var options = Options.Parse(args);

            if (options == null)
            {
                Options.PrintUsage();
                return(1);
            }

            // Setup cancellation for ctrl-c key presses
            var cts = new CancellationTokenSource();

            Console.CancelKeyPress += delegate
            {
                cts.Cancel();
            };

            ITestExecutor testExecutor = new ProcessTestExecutor(options);

            if (options.UseCachedResults)
            {
                testExecutor = new CachingTestExecutor(options, testExecutor, new LocalDataStorage());
            }

            var testRunner = new TestRunner(options, testExecutor);
            var start      = DateTime.Now;

            Console.WriteLine("Running {0} test assemblies", options.Assemblies.Count());

            var orderedList = OrderAssemblyList(options.Assemblies);
            var result      = testRunner.RunAllAsync(orderedList, cts.Token).Result;
            var span        = DateTime.Now - start;

            foreach (var assemblyPath in options.MissingAssemblies)
            {
                ConsoleUtil.WriteLine(ConsoleColor.Red, $"The file '{assemblyPath}' does not exist, is an invalid file name, or you do not have sufficient permissions to read the specified file.");
            }

            Logger.Finish();

            if (!result)
            {
                ConsoleUtil.WriteLine(ConsoleColor.Red, "Test failures encountered: {0}", span);
                return(1);
            }

            Console.WriteLine("All tests passed: {0}", span);
            return(options.MissingAssemblies.Any() ? 1 : 0);
        }
Exemplo n.º 3
0
        internal static int Main(string[] args)
        {
            var options = Options.Parse(args);

            if (options == null)
            {
                Options.PrintUsage();
                return(ExitFailure);
            }

            // Setup cancellation for ctrl-c key presses
            var cts = new CancellationTokenSource();

            Console.CancelKeyPress += delegate
            {
                cts.Cancel();
            };

            return(RunCore(options, cts.Token).GetAwaiter().GetResult());
        }