[fix] failing virtual devices tests when another device is selected
@@ -54,7 +54,10 @@ public abstract class TornadoTestBase {
}
}
- if (!wasDeviceInspected) {
+ /* Virtual devices support a single device. Therefore, it doesn't make sense to change the device even if
+ a different device is set through the 'tornado.unittests.device' property
+ */
+ if (!wasDeviceInspected && !getVirtualDeviceEnabled()) {
Tuple2<Integer, Integer> pairDriverDevice = getDriverAndDeviceIndex();
int driverIndex = pairDriverDevice.f0();
if (driverIndex != 0) {
@@ -71,6 +74,10 @@ public abstract class TornadoTestBase {
}
}
+ private boolean getVirtualDeviceEnabled() {
+ return Boolean.parseBoolean(System.getProperty("tornado.virtual.device", "False"));
+ }
+
private Tuple2<Integer, Integer> getDriverAndDeviceIndex() {
String driverAndDevice = System.getProperty("tornado.unittests.device", "0:0");
String[] propertyValues = driverAndDevice.split(":");
