Example #1
0
 /// <summary>
 /// Starts the process of running selected tests in the assembly.
 /// </summary>
 /// <param name="executor">The executor.</param>
 /// <param name="testCases">The test cases to run.</param>
 /// <param name="executionMessageSink">The message sink to report results back to.</param>
 /// <param name="executionOptions">The options to be used during test execution.</param>
 public static void RunTests(this ITestFrameworkExecutor executor,
                             IEnumerable <ITestCase> testCases,
                             IMessageSinkWithTypes executionMessageSink,
                             ITestFrameworkExecutionOptions executionOptions)
 {
     executor.RunTests(testCases, MessageSinkAdapter.Wrap(executionMessageSink), executionOptions);
 }
Example #2
0
        // Hmm. testCases is serialised, so can't be an arbitrary IEnumerable<>
        public void RunTests(IList <ITestCase> testCases)
        {
            // If there are no test cases, the Finished event is never set
            Debug.Assert(testCases.Count > 0);

            var options = TestFrameworkOptions.ForExecution(environment.TestAssemblyConfiguration);

            // If the test hosts have requested all concurrency to be disabled, make sure we
            // also make reporting of test messages synchronous. E.g. continuous testing needs
            // to know when a tests starts/finishes. If we report that asynchronously, it can't
            // accurately track what code is affected by which tests
            if (environment.DisableAllConcurrency)
            {
                options.SetSynchronousMessageReporting(true);
            }

            Logger.LogVerbose("Starting execution");
            LogExecutionOptions(options);

            var visitor = new TestExecutionVisitor(runContext);

            executor.RunTests(testCases, visitor, options);
            visitor.Finished.WaitOne();
        }
Example #3
0
 /// <summary>
 /// Starts the process of running the selected xUnit.net v2 tests.
 /// </summary>
 /// <param name="testCases">The test cases to run; if null, all tests in the assembly are run.</param>
 /// <param name="messageSink">The message sink to report results back to.</param>
 /// <param name="executionOptions">The options to be used during test execution.</param>
 public void Run(IEnumerable <ITestCase> testCases, IMessageSink messageSink, XunitExecutionOptions executionOptions)
 {
     executor.RunTests(testCases, messageSink, executionOptions);
 }
Example #4
0
 /// <summary>
 /// Starts the process of running the selected xUnit.net v2 tests.
 /// </summary>
 /// <param name="testCases">The test cases to run; if null, all tests in the assembly are run.</param>
 /// <param name="messageSink">The message sink to report results back to.</param>
 /// <param name="executionOptions">The options to be used during test execution.</param>
 public void RunTests(IEnumerable <ITestCase> testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions)
 {
     executor.RunTests(testCases, CreateOptimizedRemoteMessageSink(messageSink), executionOptions);
 }
 public void RunTests(IEnumerable <ITestCase> testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions)
 {
     _testCases = testCases;
     _executor.RunTests(testCases, new SpySink(executionMessageSink, this), executionOptions);
 }
Example #6
0
 /// <summary>
 /// Starts the process of running the selected xUnit.net v2 tests.
 /// </summary>
 /// <param name="testCases">The test cases to run; if null, all tests in the assembly are run.</param>
 /// <param name="messageSink">The message sink to report results back to.</param>
 /// <param name="executionOptions">The options to be used during test execution.</param>
 public void RunTests(IEnumerable <ITestCase> testCases, IMessageSink messageSink, ITestFrameworkExecutionOptions executionOptions)
 {
     executor.RunTests(testCases, messageSink, executionOptions);
 }