mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-26 01:51:40 +00:00
Skip Vision System Sim Tests on Windows (#1581)
This commit is contained in:
@@ -28,6 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
import static org.photonvision.UnitTestUtils.waitForSequenceNumber;
|
||||
|
||||
import edu.wpi.first.apriltag.AprilTag;
|
||||
@@ -56,6 +57,7 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import org.photonvision.common.hardware.Platform;
|
||||
import org.photonvision.estimation.OpenCVHelp;
|
||||
import org.photonvision.estimation.TargetModel;
|
||||
import org.photonvision.estimation.VisionEstimation;
|
||||
@@ -74,15 +76,19 @@ class VisionSystemSimTest {
|
||||
|
||||
@BeforeAll
|
||||
public static void setUp() {
|
||||
WpilibLoader.loadLibraries();
|
||||
assertTrue(WpilibLoader.loadLibraries());
|
||||
|
||||
try {
|
||||
if (!PhotonTargetingJniLoader.load()) fail();
|
||||
assertTrue(PhotonTargetingJniLoader.load());
|
||||
} catch (UnsatisfiedLinkError | IOException e) {
|
||||
e.printStackTrace();
|
||||
fail(e);
|
||||
}
|
||||
|
||||
OpenCVHelp.forceLoadOpenCV();
|
||||
|
||||
// See #1574 - flakey on windows
|
||||
assumeTrue(!Platform.isWindows());
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
|
||||
@@ -68,7 +68,6 @@ public class WpilibLoader {
|
||||
"ntcorejni",
|
||||
"wpinetjni",
|
||||
"wpiHaljni",
|
||||
"wpi",
|
||||
"cscorejni",
|
||||
"apriltagjni");
|
||||
|
||||
|
||||
@@ -18,12 +18,14 @@
|
||||
package wpiutil_extras;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
import edu.wpi.first.hal.HAL;
|
||||
import java.io.IOException;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.photonvision.common.hardware.Platform;
|
||||
import org.photonvision.jni.PhotonTargetingJniLoader;
|
||||
import org.photonvision.jni.QueuedFileLogger;
|
||||
import org.photonvision.jni.WpilibLoader;
|
||||
@@ -48,10 +50,10 @@ public class FileLoggerTest {
|
||||
|
||||
@Test
|
||||
public void smoketest() throws InterruptedException {
|
||||
var logger = new QueuedFileLogger("/var/log/kern.log");
|
||||
for (int i = 0; i < 100; i++) {
|
||||
Thread.sleep(1000);
|
||||
assumeTrue(Platform.isLinux());
|
||||
|
||||
var logger = new QueuedFileLogger("/var/log/kern.log");
|
||||
for (int i = 0; i < 1; i++) {
|
||||
for (var line : logger.getNewlines()) {
|
||||
System.out.println(" ->:" + line);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user