Example #1
0
        static int Main(string[] args)
        {
            bool tests_started = false;
            int  failed_num    = -1;

            Console.WriteLine("Starting tests...");

            try
            {
                testDirsAndFiles = new ArrayList();
                ProcessArguments(args);

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

                tests_started = true;
                failed_num    = 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 (tests_started)
                {
                    testsCollection.WriteLog(Path.Combine(outputDir, "TestLog.htm"), fullLog);
                }
            }

            Console.WriteLine("Done.");

            return(failed_num);
        }
Example #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);
        }
Example #3
0
		static int Main(string[] args)
		{
			bool tests_started = false;
			int failed_num = -1;
			Console.WriteLine("Starting tests...");

			try
			{
				testDirsAndFiles = new ArrayList();
				ProcessArguments(args);

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

				tests_started = true;
				failed_num = 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 (tests_started)
					testsCollection.WriteLog(Path.Combine(outputDir, "TestLog.htm"), fullLog);
			}

			Console.WriteLine("Done.");

			return failed_num;
		}
Example #4
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;
		}