Disable retrace tests when not testing r8lib

Change-Id: I431746dcb73ebdbce2013e36c73fb976eb077c94
diff --git a/src/test/java/com/android/tools/r8/cf/bootstrap/BootstrapCurrentEqualityTest.java b/src/test/java/com/android/tools/r8/cf/bootstrap/BootstrapCurrentEqualityTest.java
index 1a6717f..d1dc197 100644
--- a/src/test/java/com/android/tools/r8/cf/bootstrap/BootstrapCurrentEqualityTest.java
+++ b/src/test/java/com/android/tools/r8/cf/bootstrap/BootstrapCurrentEqualityTest.java
@@ -10,6 +10,7 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assume.assumeTrue;
 
 import com.android.tools.r8.CompilationMode;
 import com.android.tools.r8.ExternalR8TestCompileResult;
@@ -154,9 +155,7 @@
     // Produce r81 = R8Lib(R8WithDeps) and r82 = R8LibNoDeps + Deps(R8WithDeps) and test that r81 is
     // equal to r82. This test should only run if we are testing r8lib and we expect both R8libs to
     // be built by gradle. If we are not testing with R8Lib, do not run this test.
-    if (!ToolHelper.isTestingR8Lib()) {
-      return;
-    }
+    assumeTrue(ToolHelper.isTestingR8Lib());
     Path runR81 =
         testForExternalR8(parameters.getBackend(), parameters.getRuntime())
             .useProvidedR8(ToolHelper.R8LIB_JAR)
diff --git a/src/test/java/com/android/tools/r8/retrace/RetraceCommandLineTests.java b/src/test/java/com/android/tools/r8/retrace/RetraceCommandLineTests.java
index 24c15e3..3fb600a 100644
--- a/src/test/java/com/android/tools/r8/retrace/RetraceCommandLineTests.java
+++ b/src/test/java/com/android/tools/r8/retrace/RetraceCommandLineTests.java
@@ -297,7 +297,8 @@
     if (testExternal) {
       // The external dependency is built on top of R8Lib. If test.py is run with
       // no r8lib, do not try and run the external R8 Retrace since it has not been built.
-      assumeTrue(Files.exists(ToolHelper.R8LIB_JAR));
+      assumeTrue(ToolHelper.isTestingR8Lib());
+      assertTrue(Files.exists(ToolHelper.R8LIB_JAR));
       List<String> command = new ArrayList<>();
       command.add(ToolHelper.getSystemJavaExecutable());
       command.add("-ea");
diff --git a/src/test/java/com/android/tools/r8/retrace/RetraceTests.java b/src/test/java/com/android/tools/r8/retrace/RetraceTests.java
index e4332b9..70c7e15 100644
--- a/src/test/java/com/android/tools/r8/retrace/RetraceTests.java
+++ b/src/test/java/com/android/tools/r8/retrace/RetraceTests.java
@@ -7,6 +7,7 @@
 import static junit.framework.TestCase.assertEquals;
 import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeTrue;
 
@@ -374,7 +375,8 @@
       assumeTrue(testParameters.isCfRuntime());
       // The external dependency is built on top of R8Lib. If test.py is run with
       // no r8lib, do not try and run the external R8 Retrace since it has not been built.
-      assumeTrue(Files.exists(ToolHelper.R8LIB_JAR));
+      assumeTrue(ToolHelper.isTestingR8Lib());
+      assertTrue(Files.exists(ToolHelper.R8LIB_JAR));
       Path path = temp.newFolder().toPath();
       Path mappingFile = path.resolve("mapping");
       Files.write(mappingFile, stackTraceForTest.mapping().getBytes());