Added GUI testing to the base Makefile

This commit is contained in:
Marcus Rockwell 2024-03-28 17:17:33 -05:00
parent ab32e65068
commit b6ff7ec3f1
4 changed files with 8 additions and 21 deletions
Makefile
trick_source/java/src

@ -293,7 +293,7 @@ premade:
################################################################################
# This target runs Trick's Unit-tests and simulation-tests.
test: unit_test sim_test
test: unit_test sim_test gui_test
@ echo "All tests completed sucessfully"
test32: sim_test32
@ -319,6 +319,9 @@ sim_test32:
pytest:
make -C share/trick/pymods/trick
gui_test:
@ $(MAKE) -C trick_source/java test
COVERAGE_DIRS = trick_source/sim_services \
trick_source/trick_utils/var_binary_parser \
trick_source/trick_utils/unicode \

@ -346,7 +346,7 @@ public class SimControlApplication extends TrickApplication implements PropertyC
/**
* Helper method for starting monitors for sim status as well as health status.
*/
private void startStatusMonitors() {
protected void startStatusMonitors() {
MonitorSimStatusTask monitorSimStatusTask = new MonitorSimStatusTask(this);
monitorSimStatusTask.addPropertyChangeListener(this);
getContext().getTaskService().execute(monitorSimStatusTask);

@ -32,4 +32,7 @@ public class HeadlessSimControlApplication extends SimControlApplication {
@Override
protected void updateGUI() { /* UNUSED */ }
@Override
protected void startStatusMonitors() { /* UNUSED */}
}

@ -33,8 +33,6 @@ import trick.common.utils.VariableServerConnection;
*/
public class SimControlApplicationTest extends ApplicationTest {
private final static String SIM_DIR = "/test/SIM_gui_testing";
private final ByteArrayOutputStream stdContent = new ByteArrayOutputStream();
private final PrintStream originalStd = System.out;
private final ByteArrayOutputStream errContent = new ByteArrayOutputStream();
private final PrintStream originalErr = System.err;
@ -87,21 +85,6 @@ public class SimControlApplicationTest extends ApplicationTest {
simProc.destroy();
}
@Before
public void setUp() {
// System.setOut(new PrintStream(stdContent));
// System.setErr(new PrintStream(errContent));
}
@After
public void tearDown() {
// System.setOut(originalStd);
// System.setErr(originalErr);
// stdContent.reset();
// errContent.reset();
}
@Test
public void testStartSim() throws IOException {
// ARRANGE
@ -126,7 +109,6 @@ public class SimControlApplicationTest extends ApplicationTest {
} while (mode != 5 && count < 100000);
// ASSERT
System.out.println(errContent.toString());
assertTrue("Sim Mode is not MODE_RUN(5)\nMODE_ID=" + mode, mode == MODE_RUN);
// CLEAN UP
@ -161,7 +143,6 @@ public class SimControlApplicationTest extends ApplicationTest {
} while (mode != 1 && count < 100000);
// ASSERT
System.out.println(errContent.toString());
assertTrue("Sim Mode is not MODE_FREEZE (1)\nMODE_ID=" + mode, mode == MODE_FREEZE);
}