Specify EXCLUDE_FILTERS after INCLUDE_FILTERS when launching Android CTS, to make it clearer that exclude filters take the precedence on include filters. This change is not strictly necessary, according to the documentation exclude filters take the precedence anyway, see https://source.android.com/docs/core/tests/tradefed/testing/through-suite/option-passing#pass_filters_to_the_suite So this change is added only to document the behavior rather then to control it. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34479>
45 lines
1.5 KiB
Bash
Executable File
45 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck disable=SC2086 # we want word splitting
|
|
# shellcheck disable=SC1091 # paths only become valid at runtime
|
|
|
|
. "${SCRIPTS_DIR}/setup-test-env.sh"
|
|
|
|
export PATH=/android-tools/android-cts/jdk/bin/:/android-tools/build-tools:$PATH
|
|
export JAVA_HOME=/android-tools/android-cts/jdk
|
|
|
|
# Wait for the appops service to show up
|
|
while [ "$($ADB shell dumpsys -l | grep appops)" = "" ] ; do sleep 1; done
|
|
|
|
SKIP_FILE="$INSTALL/${GPU_VERSION}-android-cts-skips.txt"
|
|
|
|
EXCLUDE_FILTERS=""
|
|
if [ -e "$SKIP_FILE" ]; then
|
|
EXCLUDE_FILTERS="$(grep -v -E "(^#|^[[:space:]]*$)" "$SKIP_FILE" | sed -s 's/.*/--exclude-filter "\0" /g')"
|
|
fi
|
|
|
|
INCLUDE_FILE="$INSTALL/${GPU_VERSION}-android-cts-include.txt"
|
|
|
|
if [ -e "$INCLUDE_FILE" ]; then
|
|
INCLUDE_FILTERS="$(grep -v -E "(^#|^[[:space:]]*$)" "$INCLUDE_FILE" | sed -s 's/.*/--include-filter "\0" /g')"
|
|
else
|
|
INCLUDE_FILTERS=$(printf -- "--include-filter %s " $ANDROID_CTS_MODULES | sed -e 's/ $//g')
|
|
fi
|
|
|
|
set +e
|
|
eval "/android-tools/android-cts/tools/cts-tradefed" run commandAndExit cts-dev \
|
|
$INCLUDE_FILTERS \
|
|
$EXCLUDE_FILTERS
|
|
|
|
[ "$(grep "^FAILED" /android-tools/android-cts/results/latest/invocation_summary.txt | tr -d ' ' | cut -d ':' -f 2)" = "0" ]
|
|
|
|
# shellcheck disable=SC2034 # EXIT_CODE is used by the script that sources this one
|
|
EXIT_CODE=$?
|
|
set -e
|
|
|
|
section_switch cuttlefish_results "cuttlefish: gathering the results"
|
|
|
|
cp -r "/android-tools/android-cts/results/latest"/* $RESULTS_DIR
|
|
cp -r "/android-tools/android-cts/logs/latest"/* $RESULTS_DIR
|
|
|
|
section_end cuttlefish_results
|