From dae619b006f7f0b18774f3d9e1b0c10c788fa827 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 1 Dec 2017 23:44:11 -0800 Subject: [PATCH] Add error reporting to AbstractComsSetup test initialization. (#800) --- .../first/wpilibj/test/AbstractComsSetup.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java index fd3b04b13b..1db2e5e5b0 100644 --- a/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java +++ b/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java @@ -46,16 +46,22 @@ public abstract class AbstractComsSetup { */ static { if (!initialized) { - // Set some implementations so that the static methods work properly - RobotBase.initializeHardwareConfiguration(); - HAL.observeUserProgramStarting(); - DriverStation.getInstance().getAlliance(); + try { + // Set some implementations so that the static methods work properly + RobotBase.initializeHardwareConfiguration(); + HAL.observeUserProgramStarting(); + DriverStation.getInstance().getAlliance(); - ds = new MockDS(); - ds.start(); + ds = new MockDS(); + ds.start(); - LiveWindow.setEnabled(false); - TestBench.out().println("Started coms"); + LiveWindow.setEnabled(false); + TestBench.out().println("Started coms"); + } catch (Exception ex) { + TestBench.out().println("Exception during AbstractComsSetup initialization: " + ex); + ex.printStackTrace(TestBench.out()); + throw ex; + } // Wait until the robot is enabled before starting the tests int enableCounter = 0;