Пример #1
0
        public void RequestRun(ITestSuite suite, ITestLogger logger)
        {
            int testCount = 0;
            foreach (var testCase in suite.TestCases)
            {
                testCount += testCase.Tests.Length;
            }
            TestCount = testCount;
            TestsCompleted = 0;
            TestsFailed = 0;
            TestsIgnored = 0;
            TestsPassed = 0;

            GTestRunner runner = new GTestRunner(logger);
            runner.TestCompleted += RunnerOnTestCompleted;
            runner.RunCompleted += RunnerOnRunCompleted;
            runner.Run(suite);
        }
Пример #2
0
 public void RequestRun(ITestCase cCase, ITestLogger logger)
 {
     TestCount = cCase.Tests.Length;
     TestsCompleted = 0;
     TestsFailed = 0;
     TestsIgnored = 0;
     TestsPassed = 0;
     GTestRunner runner = new GTestRunner(logger);
     runner.TestCompleted += RunnerOnTestCompleted;
     runner.RunCompleted += RunnerOnRunCompleted;
     runner.Run(cCase);
 }
Пример #3
0
        public void RunTests(IEnumerable<string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            VSLogger logger = new VSLogger(frameworkHandle);

            foreach (var source in sources)
            {
                logger.Information(string.Format("Attempting to run tests in {0}", source));

                GTestExtractor extractor = new GTestExtractor(false);
                ITestSuite suite = extractor.ExtractFrom(source);

                VSTracker tracker = new VSTracker(frameworkHandle, suite);
                GTestRunner runner = new GTestRunner(logger, false);
                runner.TestCompleted += tracker.TestCompleted;

                runner.Run(suite);
            }
        }
Пример #4
0
 public void RequestRun(ITest test, ITestLogger logger)
 {
     TestCount = 1;
     TestsCompleted = 0;
     TestsFailed = 0;
     TestsIgnored = 0;
     TestsPassed = 0;
     GTestRunner runner = new GTestRunner(logger);
     runner.TestCompleted += RunnerOnTestCompleted;
     runner.RunCompleted += RunnerOnRunCompleted;
     runner.Run(test);
 }
Пример #5
0
        public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            var settingsProvider =
                runContext.RunSettings.GetSettings(VSTestSettings.SettingsName) as VSTestSettingsService;

            VSTestSettings settings;
            if (settingsProvider != null)
            {
                frameworkHandle.SendMessage(TestMessageLevel.Informational, "Found settings.");
                settings = settingsProvider.Settings;
            }
            else
            {
                frameworkHandle.SendMessage(TestMessageLevel.Informational, "No settings found. Using defaults.");
                settings = new VSTestSettings();
            }

            frameworkHandle.SendMessage(TestMessageLevel.Informational, settings.WorkingDirectory);

            _frameworkHandle = frameworkHandle;

            ITestLogger logger = new VSLogger(frameworkHandle);

            GTestConverter converter = new GTestConverter();
            IEnumerable<ITestSuite> suites = converter.ConvertToGTest(tests.ToArray(), logger);

            foreach (var suite in suites)
            {
                logger.Information(string.Format("Processing suite {0}...", suite.RunTarget));
                VSTracker tracker = new VSTracker(frameworkHandle, suite);
                GTestRunner runner = new GTestRunner(logger, false);

                runner.TestCompleted += tracker.TestCompleted;
                logger.Information(string.Format("Running suite {0}...", suite.RunTarget));
                runner.Run(suite);
            }
        }