mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-12 14:23:18 +00:00
Install and test LSPosed through test app
This commit is contained in:
@@ -26,4 +26,5 @@ dependencies {
|
||||
implementation(libs.test.runner)
|
||||
implementation(libs.test.rules)
|
||||
implementation(libs.test.junit)
|
||||
implementation(libs.test.uiautomator)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,17 @@ import androidx.test.runner.AndroidJUnitRunner
|
||||
|
||||
class TestRunner : AndroidJUnitRunner() {
|
||||
override fun onCreate(arguments: Bundle) {
|
||||
// Support short-hand ".ClassName"
|
||||
arguments.getString("class")?.let {
|
||||
val classArg = it.split(",").joinToString(separator = ",") { clz ->
|
||||
if (clz.startsWith(".")) {
|
||||
"com.topjohnwu.magisk.test$clz"
|
||||
} else {
|
||||
clz
|
||||
}
|
||||
}
|
||||
arguments.putString("class", classArg)
|
||||
}
|
||||
// Force using the target context's classloader to run tests
|
||||
arguments.putString("classLoader", TestClassLoader::class.java.name)
|
||||
super.onCreate(arguments)
|
||||
|
||||
Reference in New Issue
Block a user