public void WriteBenchmark(BenchmarkFinalResults results)
 {
     foreach (var o in _outputs)
     {
         o.WriteBenchmark(results);
     }
 }
Пример #2
0
        public void WriteBenchmark(BenchmarkFinalResults results)
        {
            BenchmarkStdOut(results, "DATA");
            foreach (var metric in results.Data.StatsByMetric.Values)
            {
                BenchmarkStdOut(results, string.Format("{0}: Max: {2:n} {1}, Average: {3:n} {1}, Min: {4:n} {1}, StdDev: {5:n} {1}", metric.Name,
                                                       metric.Unit, metric.Stats.Max, metric.Stats.Average, metric.Stats.Min, metric.Stats.StandardDeviation));

                BenchmarkStdOut(results, string.Format("{0}: Max / s: {2:n} {1}, Average / s: {3:n} {1}, Min / s: {4:n} {1}, StdDev / s: {5:n} {1}", metric.Name,
                                                       metric.Unit, metric.PerSecondStats.Max, metric.PerSecondStats.Average, metric.PerSecondStats.Min, metric.PerSecondStats.StandardDeviation));
            }

            if (results.AssertionResults.Count > 0)
            {
                BenchmarkStdOut(results, "ASSERTIONS");
                foreach (var assertion in results.AssertionResults)
                {
                    if (assertion.Passed)
                    {
                        BenchmarkStdOut(results, assertion.Message);
                    }
                    else
                    {
                        BenchmarkStdErr(results, assertion.Message);
                    }
                }
            }

            if (results.Data.IsFaulted)
            {
                BenchmarkStdErr(results, "EXCEPTIONS");
                foreach (var exception in results.Data.Exceptions)
                {
                    BenchmarkStdErr(results, exception.ToString());
                }
            }

            if (results.Data.IsFaulted || results.AssertionResults.Any(x => !x.Passed))
            {
                _outputWriter.WriteLine($"##teamcity[testFailed name=\'{Escape(results.BenchmarkName)}\' message=\'Failed at least one assertion or threw exception.\']");
            }
        }
Пример #3
0
        public void WriteBenchmark(BenchmarkFinalResults results)
        {
            BenchmarkStdOut(results, "DATA");
            foreach (var metric in results.Data.StatsByMetric.Values)
            {
                BenchmarkStdOut(results, string.Format("{0}: Max: {2:n} {1}, Average: {3:n} {1}, Min: {4:n} {1}, StdDev: {5:n} {1}", metric.Name,
                    metric.Unit, metric.Stats.Max, metric.Stats.Average, metric.Stats.Min, metric.Stats.StandardDeviation));

                BenchmarkStdOut(results, string.Format("{0}: Max / s: {2:n} {1}, Average / s: {3:n} {1}, Min / s: {4:n} {1}, StdDev / s: {5:n} {1}", metric.Name,
                    metric.Unit, metric.PerSecondStats.Max, metric.PerSecondStats.Average, metric.PerSecondStats.Min, metric.PerSecondStats.StandardDeviation));
            }

            if (results.AssertionResults.Count > 0)
            {
                BenchmarkStdOut(results, "ASSERTIONS");
                foreach (var assertion in results.AssertionResults)
                {
                    if(assertion.Passed)
                        BenchmarkStdOut(results, assertion.Message);
                    else
                    {
                        BenchmarkStdErr(results, assertion.Message);
                    }
                }
            }

            if (results.Data.IsFaulted)
            {
                BenchmarkStdErr(results, "EXCEPTIONS");
                foreach (var exception in results.Data.Exceptions)
                {
                   BenchmarkStdErr(results, exception.ToString());
                }
            }

            if (results.Data.IsFaulted || results.AssertionResults.Any(x => !x.Passed))
            {
                _outputWriter.WriteLine($"##teamcity[testFailed name=\'{Escape(results.BenchmarkName)}\' message=\'Failed at least one assertion or threw exception.\']");
            }
        }
Пример #4
0
 private void BenchmarkStdErr(BenchmarkFinalResults results, string str)
 {
     _outputWriter.WriteLine($"##teamcity[testStdErr name=\'{Escape(results.BenchmarkName)}\' out=\'{Escape(str)}\']");
 }
 public void WriteBenchmark(BenchmarkFinalResults results)
 {
     //no-op
 }
Пример #6
0
 public void WriteBenchmark(BenchmarkFinalResults results)
 {
     //no-op
 }
 public void WriteBenchmark(BenchmarkFinalResults results)
 {
     foreach(var o in _outputs)
         o.WriteBenchmark(results);
 }
Пример #8
0
 private void BenchmarkStdOut(BenchmarkFinalResults results, string str)
 {
     _outputWriter.WriteLine($"##teamcity[testStdOut name=\'{Escape(results.BenchmarkName)}\' out=\'{Escape(str)}\']");
 }