Exemplo n.º 1
0
        private static void ProcessTestSummaryTransformers(CommandLine commandLine, TestCaseSummary testResultsSummary)
        {
            var transformers = SummaryTransformerFactory.GetTransformers(new FileSystemWrapper());

            foreach (var transformer in transformers.Where(x => commandLine.UnmatchedArguments.ContainsKey(x.Name)))
            {
                var path = commandLine.UnmatchedArguments[transformer.Name];
                transformer.Transform(testResultsSummary, path);
            }
        }
Exemplo n.º 2
0
        public void ReturnsSummaryTransformers_AsPerSummaryTransformerFactory()
        {
            var expected = SummaryTransformerFactory.GetTransformers(GetFileSystemWrapper());
            var actual   = new SummaryTransformerProvider().GetTransformers(GetFileSystemWrapper());

            foreach (var actualTransformer in actual)
            {
                var matchingByType = expected.FirstOrDefault(x => x.GetType() == actualTransformer.GetType());

                Assert.NotNull(matchingByType);
                Assert.Equal(matchingByType.Name, actualTransformer.Name);
                Assert.Equal(matchingByType.Description, actualTransformer.Description);
            }

            Assert.Equal(expected.Count(), actual.Count());
        }
Exemplo n.º 3
0
        static void PrintUsage()
        {
            string executableName = Path.GetFileNameWithoutExtension(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);

            Console.WriteLine();
            Console.WriteLine("usage: {0} [options]", executableName);
            Console.WriteLine("usage: {0} <testFile> [options]", executableName);
            Console.WriteLine();
            Console.WriteLine("Valid options:");
            Console.WriteLine("  /silent                : Do not output running test count");
            Console.WriteLine("  /teamcity              : Forces TeamCity mode (normally auto-detected)");
            Console.WriteLine("  /wait                  : Wait for input after completion");
            Console.WriteLine("  /failOnError           : Return a non-zero exit code if any script errors or timeouts occurs");
            Console.WriteLine("  /failOnScriptError     : Alias for failOnError (deprecated)");
            Console.WriteLine("  /debug                 : Print debugging information and tracing to console");
            Console.WriteLine("  /trace                 : Logs tracing information to chutzpah.log");
            Console.WriteLine("  /openInBrowser         : Launch the tests in the default browser");
            Console.WriteLine("  /timeoutMilliseconds   : Amount of time to wait for a test file to finish before failing. (Defaults to {0})", Constants.DefaultTestFileTimeout);
            Console.WriteLine("  /parallelism [n]       : Max degree of parallelism for Chutzpah. Defaults to number of CPUs + 1");
            Console.WriteLine("                         : If you specify more than 1 the test output may be a bit jumbled");
            Console.WriteLine("  /path path             : Adds a path to a folder or file to the list of test paths to run.");
            Console.WriteLine("                         : Specify more than one to add multiple paths.");
            Console.WriteLine("                         : If you give a folder, it will be scanned for testable files.");
            Console.WriteLine("                         : (e.g. /path test1.html /path testFolder)");
            Console.WriteLine("  /file path             : Alias for /path (deprecated)");
            Console.WriteLine("  /vsoutput              : Print output in a format that the VS error list recognizes");
            Console.WriteLine("  /coverage              : Enable coverage collection");
            Console.WriteLine("  /coverageIncludes pat  : Only instrument files that match the given shell patterns (in glob format), comma separated.");
            Console.WriteLine("  /coverageExcludes pat  : Don't instrument files that match the given shell pattern (in glob format), comma separated.");
            Console.WriteLine("  /compilercachefile     : File where compiled scripts can be cached. Defaults to a file in the temp directory.");
            Console.WriteLine("  /compilercachesize     : The maximum size of the cache in Mb. Defaults to 32Mb.");
            Console.WriteLine("  /testMode              : The mode to test in (All, Html, AllExceptHTML, TypeScript, CoffeeScript, JavaScript)");
            Console.WriteLine("  /showFailureReport     : Show a failure report after the test run. Usefull if you have a large number of tests.");


            foreach (var transformer in SummaryTransformerFactory.GetTransformers(new FileSystemWrapper()))
            {
                Console.WriteLine("  /{0} filename        : {1}", transformer.Name, transformer.Description);
            }

            Console.WriteLine();
        }
Exemplo n.º 4
0
        static void PrintUsage()
        {
            string executableName = Path.GetFileNameWithoutExtension(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);

            Console.WriteLine();
            Console.WriteLine("usage: {0} [options]", executableName);
            Console.WriteLine("usage: {0} <testFile> [options]", executableName);
            Console.WriteLine();
            Console.WriteLine("Valid options:");
            Console.WriteLine("  /nologo                      : Do not show the copyright message");
            Console.WriteLine("  /silent                      : Do not output running test count");
            Console.WriteLine("  /teamcity                    : Forces TeamCity mode (normally auto-detected)");
            Console.WriteLine("  /wait                        : Wait for input after completion");
            Console.WriteLine("  /failOnError                 : Return a non-zero exit code if any script errors or timeouts occurs");
            Console.WriteLine("  /debug                       : Print debugging information and tracing to console");
            Console.WriteLine("  /trace                       : Logs tracing information to chutzpah.log");
            Console.WriteLine("  /openInBrowser               : Launch the tests in the default browser");
            Console.WriteLine("  /parallelism [n]             : Max degree of parallelism for Chutzpah. Defaults to number of CPUs + 1");
            Console.WriteLine("                               : If you specify more than 1 the test output may be a bit jumbled");
            Console.WriteLine("  /path path                   : Adds a path to a folder or file to the list of test paths to run.");
            Console.WriteLine("                               : Specify more than one to add multiple paths.");
            Console.WriteLine("                               : If you give a folder, it will be scanned for testable files.");
            Console.WriteLine("                               : (e.g. /path test1.html /path testFolder)");
            Console.WriteLine("  /vsoutput                    : Print output in a format that the VS error list recognizes");
            Console.WriteLine("  /coverage                    : Enable coverage collection");
            Console.WriteLine("  /showFailureReport           : Show a failure report after the test run. Usefull if you have a large number of tests.");
            Console.WriteLine("  /settingsFileEnvironment     : Sets the environment properties for a chutzpah.json settings file.");
            Console.WriteLine("                               : Specify more than one to add multiple environments.");
            Console.WriteLine("                               : (e.g. settingsFilePath;prop1=val1;prop2=val2).");



            foreach (var transformer in SummaryTransformerFactory.GetTransformers(new FileSystemWrapper()))
            {
                Console.WriteLine("  /{0} filename              : {1}", transformer.Name, transformer.Description);
            }

            Console.WriteLine();
        }
Exemplo n.º 5
0
 public void Supports_JUnitXmlTransformer()
 {
     Assert.True(SummaryTransformerFactory.GetTransformers(GetFileSystemWrapper()).Any(x => x.GetType() == typeof(JUnitXmlTransformer)));
 }