mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Add playwright E2E tests (#2174)
This commit is contained in:
@@ -102,7 +102,8 @@ public enum Platform {
|
||||
public final boolean isSupported;
|
||||
|
||||
// Set once at init, shouldn't be needed after.
|
||||
private static final Platform currentPlatform = getCurrentPlatform();
|
||||
private static Platform currentPlatform = getCurrentPlatform();
|
||||
private static boolean override = false;
|
||||
|
||||
Platform(
|
||||
String description,
|
||||
@@ -119,6 +120,11 @@ public enum Platform {
|
||||
this.nativeLibraryFolderName = nativeLibFolderName;
|
||||
}
|
||||
|
||||
public static void overridePlatform(Platform platform) {
|
||||
currentPlatform = platform;
|
||||
override = true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// Public API
|
||||
|
||||
@@ -128,14 +134,15 @@ public enum Platform {
|
||||
}
|
||||
|
||||
public static boolean isRK3588() {
|
||||
return Platform.isOrangePi()
|
||||
return currentPlatform == LINUX_RK3588_64
|
||||
|| Platform.isOrangePi()
|
||||
|| Platform.isCoolPi4b()
|
||||
|| Platform.isRock5C()
|
||||
|| fileHasText("/proc/device-tree/compatible", "rk3588");
|
||||
}
|
||||
|
||||
public static boolean isQCS6490() {
|
||||
return isRubik();
|
||||
return currentPlatform == LINUX_QCS6490 || Platform.isRubik();
|
||||
}
|
||||
|
||||
public static boolean isRaspberryPi() {
|
||||
@@ -167,6 +174,11 @@ public enum Platform {
|
||||
return runRobotFile.exists();
|
||||
}
|
||||
|
||||
public static boolean isWindows() {
|
||||
var p = getCurrentPlatform();
|
||||
return (p == WINDOWS_32 || p == WINDOWS_64);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
// Debug info related to unknown platforms for debug help
|
||||
@@ -177,6 +189,10 @@ public enum Platform {
|
||||
private static final String UnknownDeviceModelString = "Unknown";
|
||||
|
||||
public static Platform getCurrentPlatform() {
|
||||
if (override) {
|
||||
return currentPlatform;
|
||||
}
|
||||
|
||||
String OS_NAME;
|
||||
if (Platform.OS_NAME != null) {
|
||||
OS_NAME = Platform.OS_NAME;
|
||||
@@ -319,9 +335,4 @@ public enum Platform {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isWindows() {
|
||||
var p = getCurrentPlatform();
|
||||
return (p == WINDOWS_32 || p == WINDOWS_64);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user