コード例 #1
0
        public void RunTests(IEnumerable <string> sources, IRunContext runContext, IFrameworkHandle testExecutionRecorder)
        {
            launcher = new TestLauncher();

            foreach (var source in sources)
            {
                launcher.AddFilePattern(source);
            }

            RunTests(runContext, testExecutionRecorder);
        }
コード例 #2
0
        public void RunTests(IEnumerable <string> sources, IRunContext runContext, ITestExecutionRecorder testExecutionRecorder)
        {
            _launcher = new TestLauncher();
            foreach (string source in sources)
            {
                _launcher.AddFilePattern(source);
            }


            RunTests(testExecutionRecorder);
        }
コード例 #3
0
        public void RunTests(IEnumerable<string> sources, IRunContext runContext, IFrameworkHandle testExecutionRecorder)
        {
            launcher = new TestLauncher();

            foreach (var source in sources)
            {
                launcher.AddFilePattern(source);
            }

            RunTests(runContext, testExecutionRecorder);
        }
コード例 #4
0
 public static void Main()
 {
     using (TextWriter tw = new StreamWriter("RunTests.log"))
     {
         var logger = new TextLogger(tw);
         RuntimeBootstrap.Initialize(new RuntimeSetup(), logger);
         TestLauncher launcher = new TestLauncher();
         launcher.AddFilePattern("RunTests.exe");
         TestLauncherResult result = launcher.Run();
         Console.WriteLine(result.ResultSummary);
     }
 }
コード例 #5
0
        public void RunTests(IEnumerable <TestCase> tests, IRunContext runContext, IFrameworkHandle testExecutionRecorder)
        {
            launcher = new TestLauncher();

            foreach (var test in tests)
            {
                launcher.AddFilePattern(test.Source);
            }

            SetTestFilter(tests);

            RunTests(runContext, testExecutionRecorder);
        }
コード例 #6
0
ファイル: GallioTask.cs プロジェクト: still-adam-k/mbunit-v3
 private void AddAssemblies(TestLauncher launcher)
 {
     if (Files != null)
     {
         foreach (FileSet fs in Files)
         {
             foreach (string f in fs.FileNames)
             {
                 launcher.AddFilePattern(f);
             }
         }
     }
 }
コード例 #7
0
        public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle testExecutionRecorder)
        {
            launcher = new TestLauncher();

            foreach (var test in tests)
            {
                launcher.AddFilePattern(test.Source);
            }

            SetTestFilter(tests);

            RunTests(runContext, testExecutionRecorder);
        }
コード例 #8
0
        //not picking up
        public void RunTests(IEnumerable <TestCase> tests, IRunContext runContext, ITestExecutionRecorder testExecutionRecorder)
        {
            _launcher = new TestLauncher();
            _launcher.RuntimeSetup = new RuntimeSetup();
            //_launcher.TestProject.

            foreach (var test in tests)
            {
                _launcher.AddFilePattern(test.Source);
                _launcher.TestExecutionOptions.FilterSet = FilterUtils.ParseTestFilterSet("ExactType:" + test.DisplayName);
            }

            RunTests(testExecutionRecorder);
        }
コード例 #9
0
ファイル: Driver.cs プロジェクト: dczupek/Formatting
        public static int Main()
        {
            NativeConsole console = NativeConsole.Instance;

            var launcher = new TestLauncher
                {
                    EchoResults = true,
                    Logger = new FilteredLogger(new RichConsoleLogger(console), Verbosity.Normal),
                    ProgressMonitorProvider = new RichConsoleProgressMonitorProvider(console),
                    RuntimeSetup = new RuntimeSetup(),
                    TestProject = { TestRunnerFactoryName = StandardTestRunnerFactoryNames.Local }
                };

            string gallioBin =
                Environment.GetEnvironmentVariable(GallioBinEnvironmentVariable) ??
                InstallationConfiguration.LoadFromRegistry().InstallationFolder;

            if(string.IsNullOrEmpty(gallioBin))
            {
                Console.Error.WriteLine("Cannot find Gallio installation directory.");
                Console.Error.WriteLine("Specify it with \"{0}\" environment variable.", GallioBinEnvironmentVariable);
                return 1;
            }

            launcher.AddFilePattern(typeof(Driver).Assembly.Location);
            launcher.RuntimeSetup.AddPluginDirectory(gallioBin);

            TestLauncherResult result = launcher.Run();

            ConsoleColor originalConsoleColor = console.ForegroundColor;

            console.ForegroundColor = result.ResultCode == ResultCode.Success
                                          ? ConsoleColor.DarkGreen
                                          : ConsoleColor.Red;

            console.WriteLine();
            console.WriteLine(result.ResultSummary);
            console.WriteLine();

            console.ForegroundColor = originalConsoleColor;

            if (result.ResultCode != ResultCode.Success && Debugger.IsAttached)
            {
                Debugger.Break();
            }

            return result.ResultCode;
        }
コード例 #10
0
        public static int Main()
        {
            NativeConsole console = NativeConsole.Instance;

            var launcher = new TestLauncher
            {
                EchoResults             = true,
                Logger                  = new FilteredLogger(new RichConsoleLogger(console), Verbosity.Normal),
                ProgressMonitorProvider = new RichConsoleProgressMonitorProvider(console),
                RuntimeSetup            = new RuntimeSetup(),
                TestProject             = { TestRunnerFactoryName = StandardTestRunnerFactoryNames.Local }
            };

            string gallioBin =
                Environment.GetEnvironmentVariable(GallioBinEnvironmentVariable) ??
                InstallationConfiguration.LoadFromRegistry().InstallationFolder;

            if (string.IsNullOrEmpty(gallioBin))
            {
                Console.Error.WriteLine("Cannot find Gallio installation directory.");
                Console.Error.WriteLine("Specify it with \"{0}\" environment variable.", GallioBinEnvironmentVariable);
                return(1);
            }

            launcher.AddFilePattern(typeof(Driver).Assembly.Location);
            launcher.RuntimeSetup.AddPluginDirectory(gallioBin);

            TestLauncherResult result = launcher.Run();

            ConsoleColor originalConsoleColor = console.ForegroundColor;

            console.ForegroundColor = result.ResultCode == ResultCode.Success
                                ? ConsoleColor.DarkGreen
                                : ConsoleColor.Red;

            console.WriteLine();
            console.WriteLine(result.ResultSummary);
            console.WriteLine();

            console.ForegroundColor = originalConsoleColor;

            if (result.ResultCode != ResultCode.Success && Debugger.IsAttached)
            {
                Debugger.Break();
            }

            return(result.ResultCode);
        }
コード例 #11
0
ファイル: GallioTask.cs プロジェクト: dougrathbone/mbunit-v3
 private void AddAssemblies(TestLauncher launcher)
 {
     if (Files != null)
     {
         foreach (FileSet fs in Files)
         {
             foreach (string f in fs.FileNames)
             {
                 launcher.AddFilePattern(f);
             }
         }
     }
 }