Example #1
0
File: Driver.cs Project: ynkbt/moon
        public int RunServer(string drtlist)
        {
            LoadTests(drtlist);
            Screensaver.Inhibit();

            LoggingServer logging_server = new LoggingServer();
            TestRunner    runner         = new TestRunner(tests, Path.GetFullPath(Path.GetDirectoryName(drtlist)), this);

            DbusServices.Register(logging_server);
            DbusServices.Register(runner);

            DbusServices.Start();

            Console.WriteLine("Test runner server has been started, press enter to stop the server.");
            Console.ReadLine();

            DbusServices.Stop();
            return(0);
        }
Example #2
0
File: Driver.cs Project: ynkbt/moon
/*
 *              public int Run (string drtlist)
 *              {
 *                      int return_code = 0;
 *
 *                      LoggingServer logging_server = new LoggingServer ();
 *                      logging_server.Start ();
 *
 *                      Agviewer.SetLoggingServer (logging_server);
 *
 *                      test_run = new TestRun (Path.GetDirectoryName (drtlist), verbose_level, logging_server);
 *
 *                      LoadTests (drtlist);
 *                      Screensaver.Inhibit ();
 *
 *
 *
 *                      foreach (Test test in tests) {
 *
 *                              if (categories != null && !test.IsInCategoryList (categories))
 *                                      continue;
 *
 *                              if (fixtures != null && !TestIsInFixtureList (test))
 *                                      continue;
 *
 *                              if (test.IsKnownFailure && !run_known_failures) {
 *                                      ReportsExecuting (test);
 *                                      RecordResult (test, TestResult.KnownFailure, false);
 *                                      ReportsAddResult (test, TestResult.KnownFailure);
 *                                      continue;
 *                              }
 *
 *                              ReportsExecuting (test);
 *                              TestResult result = test.Execute (compare_to_moon);
 *
 *                              if (logging_server.IsTestResultSet (test.InputFileName)) {
 *                                      result = logging_server.GetTestResult (test.InputFileName);
 *                                      if (result == TestResult.Fail)
 *                                              test.SetFailedReason ("Test LogResult set to FAIL");
 *                              }
 *
 *                              if (!logging_server.IsTestComplete (test.InputFileName)) {
 *                                      result = TestResult.Fail;
 *                                      test.SetFailedReason ("Test did not shut down cleanly.");
 *                              }
 *
 *                              RecordResult (test, result, true);
 *                              ReportsAddResult (test, test.IsKnownFailure ? TestResult.KnownFailure : result);
 *
 *                              if (logging_server.HasShutdownBeenRequested ())
 *                                      break;
 *                      }
 *
 *                      logging_server.Stop ();
 *
 *                      ReportsEndRun ();
 *                      return return_code;
 *              }
 */

        public int Run(string drtlist)
        {
            string drtdir = Path.GetDirectoryName(drtlist);

            if (drtdir == string.Empty || drtdir == null)
            {
                drtdir = Path.GetFullPath(".");
            }
            else
            {
                drtdir = Path.GetFullPath(drtdir);
            }

            LoadTests(drtlist);
            Screensaver.Inhibit();

            LoggingServer logging_server = new LoggingServer();
            TestRunner    runner         = new TestRunner(tests, drtdir, this);

            DbusServices.Register(logging_server);
            DbusServices.Register(runner);

            DbusServices.Start();

            TestRun run = new TestRun(Path.GetDirectoryName(drtlist), verbose_level, tests, reports, logging_server, runner);

            run.IgnoredTests.AddRange(ignored_tests);

            Log.WriteLine("Driver.Run (): starting.");

            int res = run.Run();

            Log.WriteLine("Driver.Run (): finished.");

            DbusServices.Stop();
            return(res);
        }