Exemplo n.º 1
0
 public void Run()
 {
     this.IsRunning = true;
     try
     {
         this.MyExecutor.Run(this.MyName, this.MyKey, this.SqlDialect, this.ExportFileName, this.UseFs);
         if (Send)
         {
             List <string> files = new List <string>();
             files.Add(ExportFileName);
             try
             {
                 MyExecutor.SendFiles(files, MyKey.ToString());
                 MessageBox.Show("File sent successfully. (" + ExportFileName + ")");
             }
             catch (Exception e)
             {
                 MessageBox.Show("File was not sent successfully: " + e.Message);
             }
         }
         else
         {
             MessageBox.Show("Completed succesfully. Data are saved on disk! " + this.ExportFileName);
         }
     }
     catch (Exception ex)
     {
         string msg = ex.Message;
         Logger.Log(msg);
         MessageBox.Show(msg);
     }
     this.IsRunning = false;
 }
Exemplo n.º 2
0
        public void CustomToolchain()
        {
            var logger = new OutputLogger(output);

            var generator = new MyGenerator();
            var builder = new MyBuilder();
            var executor = new MyExecutor();
            var myToolchain = new Toolchain("My", generator, builder, executor);
            var job = Job.Default.With(myToolchain).With(Mode.SingleRun).WithLaunchCount(1).WithWarmupCount(1).WithTargetCount(1);

            var config = DefaultConfig.Instance.With(job).With(logger);
            BenchmarkRunner.Run<ToolchainTest>(config);
            Assert.True(generator.Done);
            Assert.True(builder.Done);
            Assert.True(executor.Done);
        }
Exemplo n.º 3
0
        public void CustomToolchain()
        {
            var logger = new OutputLogger(output);

            var generator   = new MyGenerator();
            var builder     = new MyBuilder();
            var executor    = new MyExecutor();
            var myToolchain = new Toolchain("My", generator, builder, executor);
            var job         = Job.Default.With(myToolchain).With(Mode.SingleRun).WithLaunchCount(1).WithWarmupCount(1).WithTargetCount(1);

            var config = DefaultConfig.Instance.With(job).With(logger);

            BenchmarkRunner.Run <ToolchainTest>(config);
            Assert.True(generator.Done);
            Assert.True(builder.Done);
            Assert.True(executor.Done);
        }
Exemplo n.º 4
0
        public void CustomToolchainsAreSupported()
        {
            var logger = new OutputLogger(Output);

            var generator   = new MyGenerator();
            var builder     = new MyBuilder();
            var executor    = new MyExecutor();
            var myToolchain = new Toolchain("My", generator, builder, executor);
            var job         = Job.Dry.With(myToolchain);
            var config      = CreateSimpleConfig(logger).With(job);

            CanExecute <ToolchainBenchmark>(config, fullValidation: false);

            Assert.True(generator.Done);
            Assert.True(builder.Done);
            Assert.True(executor.Done);
        }
        public void CustomToolchainsAreSupported()
        {
            var logger = new OutputLogger(Output);

            var generator = new MyGenerator();
            var builder = new MyBuilder();
            var executor = new MyExecutor();
            var myToolchain = new Toolchain("My", generator, builder, executor);
            var job = new Job(Job.Dry) { Infrastructure = { Toolchain = myToolchain} };
            var config = CreateSimpleConfig(logger).With(job);

            CanExecute<ToolchainBenchmark>(config, fullValidation: false);

            Assert.True(generator.Done);
            Assert.True(builder.Done);
            Assert.True(executor.Done);
        }
Exemplo n.º 6
0
        public void CustomToolchain()
        {
            var generator = new MyGenerator();
            var builder = new MyBuilder();
            var executor = new MyExecutor();
            var plugins = BenchmarkPluginBuilder.CreateEmpty().
                AddToolchain(new BenchmarkToolchainBuilder(
                    BenchmarkToolchain.Custom1,
                    (benchmark, logger) => generator,
                    (benchmark, logger) => builder,
                    (benchmark, logger) => executor));
            new BenchmarkRunner(plugins).Run<ToolchainTest>();
            Assert.True(generator.Done);
            Assert.True(builder.Done);
            Assert.True(executor.Done);

            Assert.Throws<NotSupportedException>(() => new BenchmarkRunner(BenchmarkPluginBuilder.CreateEmpty()).Run<ToolchainTest>());
        }
        public void CustomToolchain()
        {
            var generator = new MyGenerator();
            var builder   = new MyBuilder();
            var executor  = new MyExecutor();
            var plugins   = BenchmarkPluginBuilder.CreateEmpty().
                            AddToolchain(new BenchmarkToolchainBuilder(
                                             BenchmarkToolchain.Custom1,
                                             (benchmark, logger) => generator,
                                             (benchmark, logger) => builder,
                                             (benchmark, logger) => executor));

            new BenchmarkRunner(plugins).Run <ToolchainTest>();
            Assert.True(generator.Done);
            Assert.True(builder.Done);
            Assert.True(executor.Done);

            Assert.Throws <NotSupportedException>(() => new BenchmarkRunner(BenchmarkPluginBuilder.CreateEmpty()).Run <ToolchainTest>());
        }