Move isCuttlefish() to helper classes
We skip some tests when running on Cuttlefish, typically because nested
virtualization is too slow and the tests time out, but logic has been
duplicated across multiple test files. Clean things up by adding a new
common host/device helper VirtualizationTestHelper and make both the
MicrodroidHostTestCaseBase and MicrodroidDeviceTestBase share the same
logic.
Test: m MicrodroidTestApp ComposBenchmarkApp MicrodroidHostTestCases
Change-Id: Ibb9d25fc40818ffeb971d366dea409f8ee55ef48
diff --git a/tests/helper/Android.bp b/tests/helper/Android.bp
index 679fbfe..e7760e2 100644
--- a/tests/helper/Android.bp
+++ b/tests/helper/Android.bp
@@ -3,11 +3,18 @@
}
java_library_static {
+ name: "VirtualizationTestHelper",
+ srcs: ["src/java/com/android/virt/**/*.java"],
+ host_supported: true,
+}
+
+java_library_static {
name: "MicroroidDeviceTestHelper",
- srcs: ["src/java/**/*.java"],
+ srcs: ["src/java/com/android/microdroid/**/*.java"],
static_libs: [
"androidx.test.runner",
"androidx.test.ext.junit",
+ "VirtualizationTestHelper",
"truth-prebuilt",
],
libs: ["android.system.virtualmachine"],