basic hw in the loop - pwm self validation #2028

This commit is contained in:
rusefillc 2020-12-12 20:22:58 -05:00
parent ba3a83667b
commit 9e451defb4
7 changed files with 37 additions and 16 deletions

View File

@ -27,12 +27,12 @@ import static com.rusefi.waves.EngineReport.isCloseEnough;
* @author Andrey Belomutskiy * @author Andrey Belomutskiy
* 3/5/14 * 3/5/14
*/ */
public class AutoTest { public class FunctionalTestsSuite {
private final LinkManager linkManager; private final LinkManager linkManager;
private final EcuTestHelper ecu; private final EcuTestHelper ecu;
public AutoTest(LinkManager linkManager, CommandQueue commandQueue) { public FunctionalTestsSuite(LinkManager linkManager, CommandQueue commandQueue) {
ecu = new EcuTestHelper(commandQueue); ecu = new EcuTestHelper(commandQueue);
this.linkManager = linkManager; this.linkManager = linkManager;
} }

View File

@ -20,8 +20,8 @@ import static com.rusefi.Timeouts.SECOND;
* Andrey Belomutskiy, (c) 2013-2020 * Andrey Belomutskiy, (c) 2013-2020
* 2/22/2015 * 2/22/2015
*/ */
public class RealHwTest { public class RealHardwareTestLauncher {
private static final Logging log = getLogging(RealHwTest.class); private static final Logging log = getLogging(RealHardwareTestLauncher.class);
public static final String HW_TESTS_START_UP_SLEEP = "hw_tests_start_up_sleep"; public static final String HW_TESTS_START_UP_SLEEP = "hw_tests_start_up_sleep";
private static final int STARTUP_SLEEP = Integer.getInteger(HW_TESTS_START_UP_SLEEP, 0); private static final int STARTUP_SLEEP = Integer.getInteger(HW_TESTS_START_UP_SLEEP, 0);
@ -69,6 +69,6 @@ public class RealHwTest {
throw new IllegalStateException("firmwareVersion has not arrived"); throw new IllegalStateException("firmwareVersion has not arrived");
// now run common part of the test which should be same on real hardware and simulator // now run common part of the test which should be same on real hardware and simulator
new AutoTest(linkManager, linkManager.getCommandQueue()).mainTestBody(); new FunctionalTestsSuite(linkManager, linkManager.getCommandQueue()).mainTestBody();
} }
} }

View File

@ -2,7 +2,11 @@ package com.rusefi;
import com.rusefi.io.LinkManager; import com.rusefi.io.LinkManager;
public class SimulatorFunctionalTest { /**
* this class runs rusEFI functional tests against rusEFI simulator
* As of Dec 2020 this seems very broken?
*/
public class SimulatorFunctionalTestLaunche {
public static void main(String[] args) { public static void main(String[] args) {
Thread.setDefaultUncaughtExceptionHandler((t, e) -> { Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
e.printStackTrace(); e.printStackTrace();
@ -18,7 +22,7 @@ public class SimulatorFunctionalTest {
try { try {
LinkManager linkManager = new LinkManager(); LinkManager linkManager = new LinkManager();
IoUtil.connectToSimulator(linkManager, startSimulator); IoUtil.connectToSimulator(linkManager, startSimulator);
new AutoTest(linkManager, linkManager.getCommandQueue()).mainTestBody(); new FunctionalTestsSuite(linkManager, linkManager.getCommandQueue()).mainTestBody();
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
failed = true; failed = true;

View File

@ -1,4 +1,4 @@
<project default="jar"> <project default="build">
<property name="jar_file_folder" value="../java_console_binary"/> <property name="jar_file_folder" value="../java_console_binary"/>
<property name="jar_file" value="${jar_file_folder}/rusefi_console.jar"/> <property name="jar_file" value="${jar_file_folder}/rusefi_console.jar"/>
<property name="server_jar_file" value="${jar_file_folder}/rusefi_server.jar"/> <property name="server_jar_file" value="${jar_file_folder}/rusefi_server.jar"/>
@ -24,6 +24,8 @@
</javac> </javac>
</target> </target>
<target name="build" depends="jar, test"/>
<target name="autoupdate_jar" depends="autoupdate_compile"> <target name="autoupdate_jar" depends="autoupdate_compile">
<tstamp> <tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/> <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
@ -71,7 +73,9 @@
<compilerarg line="- -add-exports java.xml/com.sun.org.apache.xml.internal.serialize=ALL-UNNAMED"/> <compilerarg line="- -add-exports java.xml/com.sun.org.apache.xml.internal.serialize=ALL-UNNAMED"/>
--> -->
</javac> </javac>
</target>
<target name="test" depends="compile">
<junit fork="no" <junit fork="no"
maxmemory="512m" maxmemory="512m"
printsummary="yes" printsummary="yes"
@ -83,6 +87,7 @@
<classpath <classpath
path="build/classes:lib/junit.jar:${lib_list}:lib/commons-logging.jar"/> path="build/classes:lib/junit.jar:${lib_list}:lib/commons-logging.jar"/>
<batchtest todir="build"> <batchtest todir="build">
<!-- at the moment we do NOT have any tests matching this pattern - all hardware tests are not inside 'test' folders -->
<fileset dir="autotest/src" includes="**/test/**/*Test.java"/> <fileset dir="autotest/src" includes="**/test/**/*Test.java"/>
<fileset dir="autoupdate/src" includes="**/test/**/*Test.java"/> <fileset dir="autoupdate/src" includes="**/test/**/*Test.java"/>
<fileset dir="io/src/test/java" includes="**/test/**/*Test.java"/> <fileset dir="io/src/test/java" includes="**/test/**/*Test.java"/>
@ -93,7 +98,6 @@
<fileset dir="logging/src" includes="**/test/**/*Test.java"/> <fileset dir="logging/src" includes="**/test/**/*Test.java"/>
</batchtest> </batchtest>
</junit> </junit>
</target> </target>
<target name="server_jar" depends="jar"> <target name="server_jar" depends="jar">
@ -181,8 +185,23 @@
</target> </target>
<target name="real_hardware_functional_test" depends="jar"> <target name="real_hardware_functional_test" depends="jar">
<java classpath="${jar_file}" classname="com.rusefi.RealHwTest" failonerror="true"> <java classpath="${jar_file}" classname="com.rusefi.RealHardwareTestLauncher" failonerror="true">
</java> </java>
<junit fork="no"
maxmemory="512m"
printsummary="yes"
haltonfailure="yes">
<jvmarg value="-ea"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<formatter type="brief"/>
<classpath
path="build/classes:lib/junit.jar:${lib_list}:lib/commons-logging.jar"/>
<batchtest todir="build">
<fileset dir="autotest/src" includes="**/*Test.java"/>
</batchtest>
</junit>
</target> </target>
<target name="before_IDEA_Build"> <target name="before_IDEA_Build">

View File

@ -5,7 +5,6 @@ import com.rusefi.autoupdate.AutoupdateUtil;
import com.rusefi.io.LinkManager; import com.rusefi.io.LinkManager;
import com.rusefi.io.serial.BaudRateHolder; import com.rusefi.io.serial.BaudRateHolder;
import com.rusefi.maintenance.*; import com.rusefi.maintenance.*;
import com.rusefi.ts_plugin.AudioPlayback;
import com.rusefi.ui.util.HorizontalLine; import com.rusefi.ui.util.HorizontalLine;
import com.rusefi.ui.util.URLLabel; import com.rusefi.ui.util.URLLabel;
import com.rusefi.ui.util.UiUtils; import com.rusefi.ui.util.UiUtils;
@ -266,7 +265,7 @@ public class StartupFrame {
} }
private void runFunctionalHardwareTest() { private void runFunctionalHardwareTest() {
boolean isSuccess = RealHwTest.runHardwareTest(); boolean isSuccess = RealHardwareTestLauncher.runHardwareTest();
JOptionPane.showMessageDialog(null, "Function test passed: " + isSuccess + "\nSee log folder for details."); JOptionPane.showMessageDialog(null, "Function test passed: " + isSuccess + "\nSee log folder for details.");
} }
}; };

View File

@ -2,7 +2,6 @@ package com.rusefi.tools;
import com.fathzer.soft.javaluator.DoubleEvaluator; import com.fathzer.soft.javaluator.DoubleEvaluator;
import com.opensr5.ConfigurationImage; import com.opensr5.ConfigurationImage;
import com.opensr5.Logger;
import com.opensr5.ini.IniFileModel; import com.opensr5.ini.IniFileModel;
import com.opensr5.io.ConfigurationImageFile; import com.opensr5.io.ConfigurationImageFile;
import com.rusefi.*; import com.rusefi.*;
@ -214,7 +213,7 @@ public class ConsoleTools {
private static void runFunctionalTest(String[] args) throws InterruptedException { private static void runFunctionalTest(String[] args) throws InterruptedException {
// passing port argument if it was specified // passing port argument if it was specified
String[] toolArgs = args.length == 1 ? new String[0] : new String[]{args[1]}; String[] toolArgs = args.length == 1 ? new String[0] : new String[]{args[1]};
RealHwTest.main(toolArgs); RealHardwareTestLauncher.main(toolArgs);
} }
private static void runHeadless(String[] args) { private static void runHeadless(String[] args) {

View File

@ -1,7 +1,7 @@
package com.rusefi.ui.widgets; package com.rusefi.ui.widgets;
import com.fathzer.soft.javaluator.DoubleEvaluator; import com.fathzer.soft.javaluator.DoubleEvaluator;
import com.rusefi.AutoTest; import com.rusefi.FunctionalTestsSuite;
import com.rusefi.FileLog; import com.rusefi.FileLog;
import com.rusefi.InfixConverter; import com.rusefi.InfixConverter;
import com.rusefi.NamedThreadFactory; import com.rusefi.NamedThreadFactory;
@ -189,7 +189,7 @@ public class AnyCommand {
return null; return null;
} }
}; };
AutoTest.assertRpmDoesNotJump(rpm, settleTime, durationTime, callback, linkManager.getCommandQueue()); FunctionalTestsSuite.assertRpmDoesNotJump(rpm, settleTime, durationTime, callback, linkManager.getCommandQueue());
} }
}).start(); }).start();
} }