From 3270f0e014dbeb8a3839506da9a4309e17418a7f Mon Sep 17 00:00:00 2001 From: Akash Yadav Date: Tue, 30 Jul 2024 17:06:54 +0530 Subject: [PATCH] tests(common): use JUnit Assume to check for current platform --- .../androidide/testing/common/LinuxOnlyTestRule.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/testing/commonTest/src/main/java/com/itsaky/androidide/testing/common/LinuxOnlyTestRule.kt b/testing/commonTest/src/main/java/com/itsaky/androidide/testing/common/LinuxOnlyTestRule.kt index 51d8e9576..f7f067708 100644 --- a/testing/commonTest/src/main/java/com/itsaky/androidide/testing/common/LinuxOnlyTestRule.kt +++ b/testing/commonTest/src/main/java/com/itsaky/androidide/testing/common/LinuxOnlyTestRule.kt @@ -18,6 +18,7 @@ package com.itsaky.androidide.testing.common import com.sun.jna.Platform +import org.junit.Assume import org.junit.rules.TestRule import org.junit.runner.Description import org.junit.runners.model.Statement @@ -30,12 +31,7 @@ import org.junit.runners.model.Statement class LinuxOnlyTestRule : TestRule { override fun apply(base: Statement, description: Description?): Statement { - if (Platform.isLinux()) { - return base - } - - return object : Statement() { - override fun evaluate() {} - } + Assume.assumeTrue(Platform.isLinux()) + return base } } \ No newline at end of file