Let's admit it's time to move to gradle #3014

only:daemons are everywhere
This commit is contained in:
rusefillc 2023-07-04 10:54:47 -04:00
parent cac95341d7
commit 476606d51a
5 changed files with 25 additions and 16 deletions

View File

@ -3,10 +3,23 @@ package com.rusefi;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import java.util.Set;
public class CmdJUnitRunner {
public static void runHardwareTestAndExit(Class[] classes) {
boolean isOk = runHardwareTest(classes);
Set<Thread> threads = Thread.getAllStackTraces().keySet();
System.out.println("Have we left any non-daemon threads?");
System.out.printf("%-15s \t %-15s \t %-15s \t %s\n", "Name", "State", "Priority", "isDaemon");
for (Thread t : threads) {
System.out.printf("%-15s \t %-15s \t %-15d \t %s\n", t.getName(), t.getState(), t.getPriority(), t.isDaemon());
}
System.exit(isOk ? 0 : -1);
}
/**
* @return true if test is a SUCCESS, false if a FAILURE
* @param classes
* @return true if test is a SUCCESS, false if a FAILURE
*/
public static boolean runHardwareTest(Class[] classes) {
JUnitCore junit = new JUnitCore();

View File

@ -9,7 +9,7 @@ import com.rusefi.io.CommandQueue;
/**
* dead?
*
* <p>
* The following jumper wires are used to test some subsystems as realistically as possible:
* PD1 <=> PC6
* PD2 <=> PA5
@ -21,23 +21,21 @@ import com.rusefi.io.CommandQueue;
* 2/22/2015
*/
public class HwCiF4Discovery {
private final static Class[] tests = {MiscTest.class,
CommonFunctionalTest.class,
PwmHardwareTest.class,
VssHardwareLoopTest.class,
HighRevTest.class};
public static void main(String[] args) {
/**
* trying a random hack https://github.com/rusefi/rusefi/issues/4772
*/
CommandQueue.DEFAULT_TIMEOUT = 4950;
boolean isOk = runHardwareTest();
if (!isOk)
System.exit(-1);
CmdJUnitRunner.runHardwareTestAndExit(tests);
}
static boolean runHardwareTest() {
return CmdJUnitRunner.runHardwareTest(
new Class[]{MiscTest.class,
CommonFunctionalTest.class,
PwmHardwareTest.class,
VssHardwareLoopTest.class,
HighRevTest.class});
return CmdJUnitRunner.runHardwareTest(tests);
}
}

View File

@ -5,11 +5,9 @@ import com.rusefi.proteus.ProteusAnalogTest;
public class HwCiF4Proteus {
public static void main(String[] args) {
boolean isOk = CmdJUnitRunner.runHardwareTest(new Class[]{
CmdJUnitRunner.runHardwareTestAndExit(new Class[]{
MiscTest.class,
ProteusAnalogTest.class,
});
if (!isOk)
System.exit(-1);
}
}

View File

@ -24,7 +24,7 @@ import static com.rusefi.io.can.Elm327Connector.ELM327_DEFAULT_BAUDRATE;
public class PortDetector {
private final static Logging log = Logging.getLogging(PortDetector.class);
private static final NamedThreadFactory AUTO_DETECT_PORT = new NamedThreadFactory("AutoDetectPort");
private static final NamedThreadFactory AUTO_DETECT_PORT = new NamedThreadFactory("ECU AutoDetectPort", true);
public static final String AUTO = "auto";
public enum DetectorMode {

View File

@ -44,7 +44,7 @@ import static com.rusefi.config.generated.Fields.*;
*/
public class BinaryProtocol {
private static final Logging log = getLogging(BinaryProtocol.class);
private static final ThreadFactory THREAD_FACTORY = new NamedThreadFactory("text pull");
private static final ThreadFactory THREAD_FACTORY = new NamedThreadFactory("ECU text pull", true);
private static final String USE_PLAIN_PROTOCOL_PROPERTY = "protocol.plain";
private static final String CONFIGURATION_RUSEFI_BINARY = "current_configuration.rusefi_binary";