Ejemplo n.º 1
0
        void btnLoadResults_Click(object sender, EventArgs e)
        {
            var form = new OpenFileDialog
            {
                DefaultExt       = ".json",
                Filter           = ".json (Benchmark batch results)|*.json",
                InitialDirectory = lastUsedBatchFolder ?? springPaths.WritableDirectory,
                Title            = "Load results of benchmark run"
            };

            if (form.ShowDialog() == DialogResult.OK)
            {
                batchResult = BatchRunResult.Load(form.FileName);
                if (batchResult != null)
                {
                    btnGraphs.Enabled    = true;
                    btnDataSheet.Enabled = true;

                    tbResults.Clear();
                    foreach (var run in batchResult.RunEntries)
                    {
                        tbResults.AppendText(string.Format("== RUN {0} {1} ==\n", run.TestCase, run.Benchmark));
                        tbResults.AppendText(run.RawLog);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void RunTests(SpringPaths paths) {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            isAborted = false;
            var result = new BatchRunResult();
            bool usingOptirun = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("OPTIRUN"));

            foreach (var tr in TestCases) {
                foreach (var b in Benchmarks) {
                    if (isAborted) return;
                    b.ModifyModInfo(tr);
                    string log = null;
                    try {
                        run = new SpringRun();
                        log = run.Start(paths, tr, b);
                    } catch (Exception ex) {
                        Trace.TraceError(ex.ToString());
                    } finally {
                        b.RestoreModInfo();
                    }
                    try {
                        if(usingOptirun) { // leave some time for optimus/primus to rest 
                           Thread.Sleep(5000);
                        }
                        result.AddRun(tr, b, log);
                        RunCompleted(tr, b, log);
                    } catch (Exception ex) {
                        Trace.TraceError(ex.ToString());
                    }
                }
            }
            if (isAborted) return;
            AllCompleted(result);
        }
Ejemplo n.º 3
0
 void TestedBatchOnAllCompleted(BatchRunResult result)
 {
     result.SaveFiles(lastUsedBatchFolder ?? springPaths.WritableDirectory);
     batchResult = result;
     InvokeIfNeeded(() =>
     {
         btnStart.Enabled     = true;
         btnStop.Enabled      = false;
         btnDataSheet.Enabled = true;
         btnGraphs.Enabled    = true;
         MessageBox.Show("Test batch run complete, please open the graph and datasheet by pressing buttons on the left");
     });
 }
Ejemplo n.º 4
0
        public void RunTests(SpringPaths paths)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            isAborted = false;
            var  result       = new BatchRunResult();
            bool usingOptirun = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("OPTIRUN"));

            foreach (var tr in TestCases)
            {
                foreach (var b in Benchmarks)
                {
                    if (isAborted)
                    {
                        return;
                    }
                    b.ModifyModInfo(tr);
                    string log = null;
                    try {
                        run = new SpringRun();
                        log = run.Start(paths, tr, b);
                    } catch (Exception ex) {
                        Trace.TraceError(ex.ToString());
                    } finally {
                        b.RestoreModInfo();
                    }
                    try {
                        if (usingOptirun)  // leave some time for optimus/primus to rest
                        {
                            Thread.Sleep(5000);
                        }
                        result.AddRun(tr, b, log);
                        RunCompleted(tr, b, log);
                    } catch (Exception ex) {
                        Trace.TraceError(ex.ToString());
                    }
                }
            }
            if (isAborted)
            {
                return;
            }
            AllCompleted(result);
        }
Ejemplo n.º 5
0
        void TestedBatchOnAllCompleted(BatchRunResult result) {
            result.SaveFiles(lastUsedBatchFolder ?? springPaths.WritableDirectory);
            batchResult = result;
            InvokeIfNeeded(() =>
            {
                btnStart.Enabled = true;
                btnStop.Enabled = false;
                btnDataSheet.Enabled = true;
                btnGraphs.Enabled = true;
                MessageBox.Show("Test batch run complete, please open the graph and datasheet by pressing buttons on the left");
            });

        }
Ejemplo n.º 6
0
        void btnLoadResults_Click(object sender, EventArgs e) {
            var form = new OpenFileDialog
            {
                DefaultExt = ".json",
                Filter = ".json (Benchmark batch results)|*.json",
                InitialDirectory = lastUsedBatchFolder ?? springPaths.WritableDirectory,
                Title = "Load results of benchmark run"
            };
            if (form.ShowDialog() == DialogResult.OK) {
                batchResult = BatchRunResult.Load(form.FileName);
                if (batchResult != null) {
                    btnGraphs.Enabled = true;
                    btnDataSheet.Enabled = true;

                    tbResults.Clear();
                    foreach (var run in batchResult.RunEntries) {
                        tbResults.AppendText(string.Format("== RUN {0} {1} ==\n", run.TestCase, run.Benchmark));
                        tbResults.AppendText(run.RawLog);
                    }
                }
            }
        }
Ejemplo n.º 7
0
 public GraphsForm(BatchRunResult results) {
     this.results = results;
     InitializeComponent();
 }
Ejemplo n.º 8
0
 public GraphsForm(BatchRunResult results)
 {
     this.results = results;
     InitializeComponent();
 }