Move AbstractBackport test in testbase module
Bug: b/380808556
Change-Id: Ibe9dff3696a90c9b9c363405c1e76354a5589a5b
diff --git a/src/test/java/com/android/tools/r8/desugar/backports/AbstractBackportTest.java b/src/test/testbase/java/com/android/tools/r8/desugar/backports/AbstractBackportTest.java
similarity index 94%
rename from src/test/java/com/android/tools/r8/desugar/backports/AbstractBackportTest.java
rename to src/test/testbase/java/com/android/tools/r8/desugar/backports/AbstractBackportTest.java
index 4c2c44a..c9e7983 100644
--- a/src/test/java/com/android/tools/r8/desugar/backports/AbstractBackportTest.java
+++ b/src/test/testbase/java/com/android/tools/r8/desugar/backports/AbstractBackportTest.java
@@ -36,7 +36,7 @@
import org.junit.Assert;
import org.junit.Test;
-abstract class AbstractBackportTest extends TestBase {
+public abstract class AbstractBackportTest extends TestBase {
protected final TestParameters parameters;
private final ClassInfo targetClass;
private final ClassInfo testClass;
@@ -85,22 +85,22 @@
}
}
- AbstractBackportTest(TestParameters parameters, Class<?> targetClass,
- Class<?> testClass) {
+ protected AbstractBackportTest(
+ TestParameters parameters, Class<?> targetClass, Class<?> testClass) {
this(parameters, new ClassInfo(targetClass), new ClassInfo(testClass), null, null);
}
- AbstractBackportTest(
+ protected AbstractBackportTest(
TestParameters parameters, Class<?> targetClass, List<byte[]> testClassFileData) {
this(parameters, new ClassInfo(targetClass), new ClassInfo(testClassFileData), null, null);
}
- AbstractBackportTest(
+ protected AbstractBackportTest(
TestParameters parameters, String className, List<byte[]> testClassFileData) {
this(parameters, new ClassInfo(className), new ClassInfo(testClassFileData), null, null);
}
- AbstractBackportTest(
+ protected AbstractBackportTest(
TestParameters parameters, byte[] targetClassFileData, List<byte[]> testClassFileData) {
this(
parameters,
@@ -110,8 +110,8 @@
null);
}
- AbstractBackportTest(TestParameters parameters, Class<?> targetClass,
- Path testJar, String testClassName) {
+ public AbstractBackportTest(
+ TestParameters parameters, Class<?> targetClass, Path testJar, String testClassName) {
this(parameters, new ClassInfo(targetClass), null, testJar, testClassName);
}
@@ -140,7 +140,7 @@
invokeStaticCounts.put(AndroidApiLevel.B.getLevel(), 0);
}
- void registerTarget(AndroidApiLevel apiLevel, int invokeStaticCount) {
+ protected void registerTarget(AndroidApiLevel apiLevel, int invokeStaticCount) {
invokeStaticCounts.put(apiLevel.getLevel(), invokeStaticCount);
}
@@ -149,7 +149,7 @@
return invokeStaticCounts.get(key);
}
- void ignoreInvokes(String methodName) {
+ protected void ignoreInvokes(String methodName) {
ignoredInvokes.add(methodName);
}
@@ -250,7 +250,7 @@
}
/** JUnit {@link Assert} isn't available in the VM runtime. This is a mini mirror of its API. */
- static abstract class MiniAssert {
+ public abstract static class MiniAssert {
static void assertTrue(boolean value) {
assertEquals(true, value);
}
diff --git a/src/test/java/com/android/tools/r8/desugar/backports/IgnoreInvokes.java b/src/test/testbase/java/com/android/tools/r8/desugar/backports/IgnoreInvokes.java
similarity index 72%
rename from src/test/java/com/android/tools/r8/desugar/backports/IgnoreInvokes.java
rename to src/test/testbase/java/com/android/tools/r8/desugar/backports/IgnoreInvokes.java
index 2e61664..76aa62c 100644
--- a/src/test/java/com/android/tools/r8/desugar/backports/IgnoreInvokes.java
+++ b/src/test/testbase/java/com/android/tools/r8/desugar/backports/IgnoreInvokes.java
@@ -11,13 +11,12 @@
import java.lang.annotation.Target;
/**
- * Denote a method that contains invoke instructions on the target class which should be ignored
- * in the counts. This is useful for using other functionality of the target class to verify the
+ * Denote a method that contains invoke instructions on the target class which should be ignored in
+ * the counts. This is useful for using other functionality of the target class to verify the
* behavior of the backport.
*
- * Methods with this annotation will never be inlined.
+ * <p>Methods with this annotation will never be inlined.
*/
@Target(METHOD)
@Retention(RUNTIME)
-@interface IgnoreInvokes {
-}
+public @interface IgnoreInvokes {}