Disable verbose output by default

This commit is contained in:
topjohnwu 2024-06-21 02:45:48 -07:00
parent 2f8f3dc266
commit 313532dcaa
2 changed files with 23 additions and 7 deletions

View File

@ -118,6 +118,8 @@ jobs:
sudo udevadm trigger --name-match=kvm
- name: AVD test
env:
AVD_TEST_VERBOSE: 1
run: scripts/avd_test.sh ${{ matrix.version }} ${{ matrix.type }}
test-32:
@ -155,4 +157,5 @@ jobs:
- name: AVD test
env:
FORCE_32_BIT: 1
AVD_TEST_VERBOSE: 1
run: scripts/avd_test.sh ${{ matrix.version }}

View File

@ -3,7 +3,7 @@
emu="$ANDROID_SDK_ROOT/emulator/emulator"
avd="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager"
sdk="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager"
emu_args_base='-no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -read-only -no-snapshot -show-kernel'
emu_args_base='-no-window -no-audio -no-boot-anim -gpu swiftshader_indirect -read-only -no-snapshot'
lsposed_url='https://github.com/LSPosed/LSPosed/releases/download/v1.9.2/LSPosed-v1.9.2-7024-zygisk-release.zip'
boot_timeout=600
emu_pid=
@ -99,8 +99,15 @@ test_emu() {
print_title "* Testing $pkg ($variant)"
"$emu" @test $emu_args &
emu_pid=$!
if [ -n "$AVD_TEST_VERBOSE" ]; then
"$emu" @test $emu_args &
emu_pid=$!
adb logcat &
else
"$emu" @test $emu_args 2>/dev/null &
emu_pid=$!
fi
wait_emu wait_for_boot
adb shell 'PATH=$PATH:/debug_ramdisk magisk -v'
@ -118,6 +125,9 @@ test_emu() {
fi
adb reboot
if [ -n "$AVD_TEST_VERBOSE" ]; then
adb logcat &
fi
wait_emu wait_for_boot
# Run app tests
@ -177,17 +187,20 @@ run_test() {
memory=8192
fi
local emu_args="$emu_args_base -memory $memory"
emu_args="$emu_args_base -memory $memory"
if [ -n "$AVD_TEST_VERBOSE" ]; then
emu_args="$emu_args -show-kernel"
fi
# Setup emulator
"$sdk" --channel=3 $pkg
echo no | "$avd" create avd -f -n test -k $pkg
restore_backup $ramdisk
restore_backup $features
# Launch stock emulator
print_title "* Launching $pkg"
restore_backup $ramdisk
restore_backup $features
"$emu" @test $emu_args &
"$emu" @test $emu_args 2>/dev/null &
emu_pid=$!
wait_emu wait_for_bootanim