Exemple #1
0
        static int Main(string[] args)
        {
            var  sw             = Stopwatch.StartNew();
            bool testingStarted = false;

            Console.WriteLine("Starting tests...");
            try
            {
                ProcessArguments(args);

                testsCollection = new TestsCollection(testDirsAndFiles, verbose, clean, compileOnly,
                                                      benchmarks, numberOfBenchmarkRuns, concurrencyLevel, maxThreads);
                testsCollection.LoadTests();

                testingStarted = true;
                return(testsCollection.RunTests(loader, compiler, php));
            }
            catch (InvalidArgumentException e)
            {
                Console.WriteLine(e.Message);
                ShowHelp();
                Console.ReadLine();
            }
            catch (TestException e)
            {
                Console.WriteLine("Testing failed: " + e.Message);
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.Write("Unexpected error: ");
                Console.WriteLine(e.Message);
                Console.ReadLine();
            }
            finally
            {
                if (testingStarted)
                {
                    testsCollection.WriteLog(Path.Combine(outputDir, "TestLog.htm"), fullLog);
                    Console.WriteLine();
                    Console.WriteLine("Done. " + testsCollection.GetStatusMessage());
                    Console.WriteLine("Time: " + sw.Elapsed);
                }
            }

            return(0);
        }
Exemple #2
0
		static int Main(string[] args)
		{
		    var sw = Stopwatch.StartNew();
			bool testingStarted = false;
			Console.WriteLine("Starting tests...");
			try
			{
				ProcessArguments(args);

				testsCollection = new TestsCollection(testDirsAndFiles, verbose, clean, compileOnly,
					                                  benchmarks, numberOfBenchmarkRuns, concurrencyLevel, maxThreads);
				testsCollection.LoadTests();

				testingStarted = true;
				return testsCollection.RunTests(loader, compiler, php);
			}
			catch (InvalidArgumentException e)
			{
				Console.WriteLine(e.Message);
				ShowHelp();
				Console.ReadLine();
			}
			catch (TestException e)
			{
				Console.WriteLine("Testing failed: " + e.Message);
				Console.ReadLine();
			}
			catch (Exception e)
			{
				Console.Write("Unexpected error: ");
				Console.WriteLine(e.Message);
				Console.ReadLine();
			}
			finally
			{
				if (testingStarted)
				{
				    testsCollection.WriteLog(Path.Combine(outputDir, "TestLog.htm"), fullLog);
		            Console.WriteLine();
                    Console.WriteLine("Done. " + testsCollection.GetStatusMessage());
                    Console.WriteLine("Time: " + sw.Elapsed);
				}
			}

			return 0;
		}