mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Add unit tests for ZipExtractor
Implement AppTest with unit tests for ZipExtractor verifying remote boot image extraction from both factory image packages and OTA update packages using HTTP range requests. Also add an app-test sub-command to scripts/avd.sh to run AppTest via instrumentation on connected emulators. Assisted-by: Gemini 3.8 Flash
This commit is contained in:
@@ -315,6 +315,20 @@ live_test_main() {
|
||||
done
|
||||
}
|
||||
|
||||
app_test_main() {
|
||||
local apks=($(print_apks "$@"))
|
||||
local pkg='com.topjohnwu.magisk.test'
|
||||
local app="$pkg/$pkg.AppTestRunner"
|
||||
for apk in "${apks[@]}"; do
|
||||
# Cleanup
|
||||
adb shell pm uninstall com.topjohnwu.magisk || true
|
||||
adb install -r -g $apk
|
||||
adb install -r -g out/test.apk
|
||||
am_instrument '.AppTest' $app
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
test )
|
||||
shift
|
||||
@@ -327,6 +341,11 @@ case "$1" in
|
||||
set -x
|
||||
live_test_main "$@"
|
||||
;;
|
||||
app-test )
|
||||
shift
|
||||
set -x
|
||||
app_test_main "$@"
|
||||
;;
|
||||
run )
|
||||
shift
|
||||
trap cleanup EXIT
|
||||
|
||||
Reference in New Issue
Block a user