Added option to start TestHelper from GUI

This commit is contained in:
Souryo 2016-01-01 10:21:41 -05:00
parent 7795b7ee1d
commit f4613a6ec9
2 changed files with 24 additions and 4 deletions

View file

@ -107,6 +107,7 @@
this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem();
this.menuTimer = new System.Windows.Forms.Timer(this.components);
this.dxViewer = new Mesen.GUI.Controls.DXViewer();
this.mnuRunAllTests = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip.SuspendLayout();
this.SuspendLayout();
//
@ -544,7 +545,8 @@
this.mnuTests.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuTestRun,
this.mnuTestRecordFrom,
this.mnuTestStopRecording});
this.mnuTestStopRecording,
this.mnuRunAllTests});
this.mnuTests.Name = "mnuTests";
this.mnuTests.Size = new System.Drawing.Size(185, 22);
this.mnuTests.Text = "Tests";
@ -661,6 +663,13 @@
this.dxViewer.Size = new System.Drawing.Size(1024, 960);
this.dxViewer.TabIndex = 1;
//
// mnuRunAllTests
//
this.mnuRunAllTests.Name = "mnuRunAllTests";
this.mnuRunAllTests.Size = new System.Drawing.Size(193, 22);
this.mnuRunAllTests.Text = "Run all tests";
this.mnuRunAllTests.Click += new System.EventHandler(this.mnuRunAllTests_Click);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -752,6 +761,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem10;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem11;
private System.Windows.Forms.ToolStripMenuItem mnuPreferences;
private System.Windows.Forms.ToolStripMenuItem mnuRunAllTests;
}
}

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
@ -237,9 +238,13 @@ namespace Mesen.GUI.Forms
private void LoadROM(string filename)
{
ConfigManager.Config.AddRecentFile(filename);
InteropEmu.LoadROM(filename);
UpdateRecentFiles();
if(File.Exists(filename)) {
ConfigManager.Config.AddRecentFile(filename);
InteropEmu.LoadROM(filename);
UpdateRecentFiles();
} else {
MessageBox.Show("File not found.", "Mesen", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void UpdateMenus()
@ -673,5 +678,10 @@ namespace Mesen.GUI.Forms
}
ConfigManager.Config.ApplyConfig();
}
private void mnuRunAllTests_Click(object sender, EventArgs e)
{
Process.Start("TestHelper.exe");
}
}
}