mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
tests(common): use JUnit Assume to check for current platform
This commit is contained in:
+3
-7
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user