예제 #1
0
        public static Summary Run(Benchmark[] benchmarks, IConfig config, Func <Job, IToolchain> toolchainProvider)
        {
            var resolver = DefaultResolver;

            config = BenchmarkConverter.GetFullConfig(benchmarks.FirstOrDefault()?.Target.Type, config);

            var title = GetTitle(benchmarks);
            var rootArtifactsFolderPath = GetRootArtifactsFolderPath();

            using (var logStreamWriter = Portability.StreamWriter.FromPath(Path.Combine(rootArtifactsFolderPath, title + ".log")))
            {
                var logger = new CompositeLogger(config.GetCompositeLogger(), new StreamLogger(logStreamWriter));
                benchmarks = GetSupportedBenchmarks(benchmarks, logger, toolchainProvider, resolver);
                var artifactsToCleanup = new List <string>();

                try
                {
                    return(Run(benchmarks, logger, title, config, rootArtifactsFolderPath, toolchainProvider, resolver, artifactsToCleanup));
                }
                finally
                {
                    logger.WriteLineHeader("// * Artifacts cleanup *");
                    Cleanup(artifactsToCleanup);
                }
            }
        }
예제 #2
0
        public static Summary Run(Benchmark[] benchmarks, IConfig config)
        {
            var targetType = benchmarks?.FirstOrDefault()?.Target.Type;

            return(BenchmarkRunnerCore.Run(
                       new BenchmarkRunInfo(benchmarks, targetType, BenchmarkConverter.GetFullConfig(targetType, config)),
                       ToolchainExtensions.GetToolchain));
        }
예제 #3
0
        internal static Summary Run(IList <Benchmark> benchmarks, IConfig config)
        {
            config = BenchmarkConverter.GetFullConfig(benchmarks.FirstOrDefault()?.Target.Type, config);

            var title = GetTitle(benchmarks);

            EnsureNoMoreThanOneBaseline(benchmarks, title);

            using (var logStreamWriter = new StreamWriter(title + ".log"))
            {
                var logger  = new CompositeLogger(config.GetCompositeLogger(), new StreamLogger(logStreamWriter));
                var summary = Run(benchmarks, logger, title, config);
                config.GetCompositeExporter().ExportToFiles(summary);
                return(summary);
            }
        }
예제 #4
0
        internal static Summary Run(Benchmark[] benchmarks, IConfig config, Func <Job, IToolchain> toolchainProvider)
        {
            var resolver = DefaultResolver;

            config = BenchmarkConverter.GetFullConfig(benchmarks.FirstOrDefault()?.Target.Type, config);

            var title = GetTitle(benchmarks);
            var rootArtifactsFolderPath = GetRootArtifactsFolderPath();

            using (var logStreamWriter = Portability.StreamWriter.FromPath(Path.Combine(rootArtifactsFolderPath, title + ".log")))
            {
                var logger = new CompositeLogger(config.GetCompositeLogger(), new StreamLogger(logStreamWriter));
                benchmarks = GetSupportedBenchmarks(benchmarks, logger, toolchainProvider, resolver);

                return(Run(benchmarks, logger, title, config, rootArtifactsFolderPath, toolchainProvider, resolver));
            }
        }
예제 #5
0
        internal static Summary Run(Benchmark[] benchmarks, IConfig config)
        {
            config = BenchmarkConverter.GetFullConfig(benchmarks.FirstOrDefault()?.Target.Type, config);

            var title = GetTitle(benchmarks);
            var rootArtifactsFolderPath = GetRootArtifactsFolderPath();

            using (var logStreamWriter = Portability.StreamWriter.FromPath(Path.Combine(rootArtifactsFolderPath, title + ".log")))
            {
                var logger = new CompositeLogger(config.GetCompositeLogger(), new StreamLogger(logStreamWriter));
                benchmarks = GetSupportedBenchmarks(benchmarks, logger);

                var summary = Run(benchmarks, logger, title, config, rootArtifactsFolderPath);
                if (!summary.HasCriticalValidationErrors)
                {
                    config.GetCompositeExporter().ExportToFiles(summary).ToArray();
                }
                return(summary);
            }
        }