diff --git a/app/core/src/main/java/com/topjohnwu/magisk/test/Environment.kt b/app/core/src/main/java/com/topjohnwu/magisk/test/Environment.kt index 5f5eaa979..599b17fb8 100644 --- a/app/core/src/main/java/com/topjohnwu/magisk/test/Environment.kt +++ b/app/core/src/main/java/com/topjohnwu/magisk/test/Environment.kt @@ -42,33 +42,30 @@ class Environment : BaseTest { } @Test - fun setupMagisk() { + fun setupEnvironment() { runBlocking { assertTrue( "Magisk setup failed", MagiskInstaller.Emulator(TimberLog, TimberLog).exec() ) } - } - @Test - fun setupLsposed() { - assumeTrue(lsposed()) - - val notify = object : DownloadNotifier { - override val context = appContext - override fun notifyUpdate(id: Int, editor: (Notification.Builder) -> Unit) {} - } - val processor = DownloadProcessor(notify) - val zip = appContext.cachedFile("lsposed.zip") - runBlocking { - testContext.assets.open("lsposed.zip").use { - processor.handleModule(it, zip.toUri()) + if (lsposed()) { + val notify = object : DownloadNotifier { + override val context = appContext + override fun notifyUpdate(id: Int, editor: (Notification.Builder) -> Unit) {} + } + val processor = DownloadProcessor(notify) + val zip = appContext.cachedFile("lsposed.zip") + runBlocking { + testContext.assets.open("lsposed.zip").use { + processor.handleModule(it, zip.toUri()) + } + assertTrue( + "LSPosed installation failed", + FlashZip(zip.toUri(), TimberLog, TimberLog).exec() + ) } - assertTrue( - "LSPosed installation failed", - FlashZip(zip.toUri(), TimberLog, TimberLog).exec() - ) } } diff --git a/scripts/test_common.sh b/scripts/test_common.sh index 2887943b6..61c065210 100644 --- a/scripts/test_common.sh +++ b/scripts/test_common.sh @@ -53,9 +53,7 @@ run_setup() { local app='com.topjohnwu.magisk.test/com.topjohnwu.magisk.test.AppTestRunner' # Run setup through the test app - am_instrument '.Environment#setupMagisk' $app - # Install LSPosed - am_instrument '.Environment#setupLsposed' $app + am_instrument '.Environment#setupEnvironment' $app } run_tests() {