aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Serov <artem.serov@linaro.org>2021-12-15 18:57:16 +0000
committerArtem Serov <artem.serov@linaro.org>2021-12-15 18:57:16 +0000
commit097e1ba857155510a30c95366ccc9086cec21c93 (patch)
tree9b2317c5169daa25d56617128ed2473bc1b8c4e3
parent7acc95cad1ac8865e9e7d287872223337c8bccf3 (diff)
downloadart-build-scripts-097e1ba857155510a30c95366ccc9086cec21c93.tar.gz
Revert "Extend command line options for test_art_simulator"
This reverts commit 7acc95cad1ac8865e9e7d287872223337c8bccf3. Reason for revert: <fails test> Change-Id: I3a0c576e2e0cef1fabff0bfe0a11af7d1d94b5f6
-rwxr-xr-xtests/test_art_simulator.sh84
-rw-r--r--utils/utils_run.sh24
-rw-r--r--utils/utils_test.sh8
3 files changed, 18 insertions, 98 deletions
diff --git a/tests/test_art_simulator.sh b/tests/test_art_simulator.sh
index 320c4a94..094a4ad3 100755
--- a/tests/test_art_simulator.sh
+++ b/tests/test_art_simulator.sh
@@ -22,7 +22,6 @@ source "${local_path}/../utils/utils.sh"
source "${local_path}/../utils/utils_test.sh"
source "${local_path}/../utils/utils_android.sh"
source "${local_path}/../utils/utils_android_root.sh"
-source "${local_path}/../utils/utils_run.sh"
readonly timer_name="Simulator Test"
readonly lunch_target="armv8"
@@ -51,25 +50,6 @@ usage() {
log I " -h|--help Show this help."
log I " -t|--build-target Build arm64 target images, e.g. core.art"
log I " -s|--sve Enable SVE2 Arm extension"
- log I "-------------------------------------------"
- log I "Test Options:"
- log I " --jobs - a number of jobs on a target. Defaults to CPU count."
- log I " --keep-failures - keep failing tests around (useful for debugging)."
- log I " --keep-going - don't stop at the first failing test."
- log I " --gcstress - use gc stress testing for run-tests."
- log I " --isa-features - specify isa features to be used.
- Possible values: default, runtime, a list of comma-separated
- feature names. When the list is used, '-' before a feature name
- means the ART compiler must not use the feature for code
- generation."
- log I " --dump-cfg <path> - dump .cfg to the specified host full path. Only runs for a"
- log I " single test"
- log I " --gdb-dex2oat - Run dex2oat under lldb. Only runs for a single test."
- log I " --gdb-dex2oat-args - Use LLDB with arguments to debug the compiler (dex2oat)
- Each argument needs to be separated by a semicolon."
- log I "-------------------------------------------"
- log I "Tests:"
- log I " --single-test <test> - run specified test only"
exit 0
}
@@ -81,38 +61,10 @@ declare -A options_format=(
["t"]="r:&build-target"
["sve"]="false"
["s"]="r:&sve"
- ["dump-cfg"]=""
- ["gdb-dex2oat"]="false"
- ["gdb-dex2oat-args"]=""
- ["gcstress"]="false"
- ["isa-features"]=""
- ["jobs"]=""
- ["keep-failures"]="false"
- ["keep-going"]="false"
- ["single-test"]=""
)
-
declare -A options=()
-
-validate_options() {
- if [[ -n "${options["jobs"]}" ]] && [[ ! ${options["jobs"]} =~ ^[0-9]+$ ]]; then
- log E "The --jobs option must be followed by an integer."
- exit 1
- fi
-
- if [[ -n "${options["dump-cfg"]}" ]] && [[ -z "${options["single-test"]}" ]]; then
- log E "Can only dump .cfg for a single test."
- exit 1
- fi
-
- if [[ "${options["gdb-dex2oat"]}" == "true" ]] && [[ -z "${options["single-test"]}" ]]; then
- log E "Can only run the debugger on dex2oat for a single test."
- exit 1
- fi
-}
-
prepare_workspace() {
local -ar patch_change_ids=(
"${sim_patch_change_id}"
@@ -137,10 +89,6 @@ prepare_workspace() {
fi
done
- if ${options["keep-failures"]}; then
- set_environment_keep_test_failures
- fi
-
# According to art/test/README.chroot.md, the test script needs to set this
# env variable when building ART minimal tree.
export SOONG_ALLOW_MISSING_DEPENDENCIES=true
@@ -162,39 +110,25 @@ prepare_workspace() {
}
test_simulator() {
- if [[ -n ${options["single-test"]} ]]; then
- test_single "64" "simulator" "${job_count}" "$(declare -p options)"
- else
- section_starter "simulator" "host"
- run_test_unwrapped "run-test" "optimizing" "" "64" "simulator" "${job_count}" \
- "$(declare -p options)"
- local -r return_code=$?
- section_ender "simulator" "host" "${return_code}" "${options["keep-going"]}"
- fi
-}
-
-set_job_count() {
- job_count=${JCPU_COUNT}
- if [[ -n "${options["jobs"]}" ]]; then
- job_count="${options["jobs"]}"
- fi
+ start_section "simulator"
+ disable_error_on_unset_expansion
+ set_environment_keep_test_failures
+ local -r test_command="art/test.py -v -j${JCPU_COUNT} --simulate-arm64 --optimizing --run-test"
+ log I "Running ${test_command}"
+ ${test_command}
+ local -r return_code=$?
+ enable_error_on_unset_expansion
+ end_section "simulator" "${return_code}"
}
main() {
exit_on_failure arguments_parser options_format options -- "$@"
-
readonly options
-
- validate_options
-
dump_options
- set_job_count
-
start_test "${timer_name}"
prepare_workspace
-
test_simulator
end_test "${timer_name}"
diff --git a/utils/utils_run.sh b/utils/utils_run.sh
index 9364354b..b1cd905f 100644
--- a/utils/utils_run.sh
+++ b/utils/utils_run.sh
@@ -30,22 +30,12 @@ readonly art="$(get_art_dir)"
# ${2}: test section
# ${3}: test name
# ${4}: bitness (32/64)
-# ${5}: host/target/simulator
+# ${5}: host/target
# ${6}: job count (CPU Count when on host)
# ${7}: options
run_test_with_python_runner() {
declare -A local_options=${7#*=}
- local test_command="art/test.py -v -j${6}"
-
- local test_environment="$5"
-
- if [[ "${test_environment}" == "simulator" ]]; then
- test_command+=" --simulate-arm64"
- test_environment="host"
- fi
-
- test_command+=" --${test_environment} --ndebuggable"
-
+ local test_command="art/test.py -v -j${6} --${5} --ndebuggable"
if ${local_options["gcstress"]}; then
test_command+=" --gcstress"
fi
@@ -53,7 +43,7 @@ run_test_with_python_runner() {
test_command+=" --dump-cfg ${local_options["dump-cfg"]}"
fi
if ${local_options["gdb-dex2oat"]}; then
- if [[ "${test_environment}" != "host" ]]; then
+ if [[ "$5" != "host" ]]; then
log E "The --gdb-dex2oat option is only available for host."
return 1
fi
@@ -79,7 +69,7 @@ run_test_with_python_runner() {
# ${2}: test section
# ${3}: test name
# ${4}: bitness (32/64)
-# ${5}: host/target/simulator
+# ${5}: host/target
# ${6}: job count (CPU Count when on host)
# ${7}: options
run_test_unwrapped() {
@@ -120,7 +110,7 @@ find_gtests() {
#
# Arguments
# ${1}: bitness (32/64)
-# ${2}: host/target/simulator
+# ${2}: host/target
# ${3}: job count (CPU Count when on host)
# ${4}: options
test_single() {
@@ -129,10 +119,6 @@ test_single() {
local return_code=0
local section_name="TEST_SINGLE_"
if is_single_test_gtest "${test_name}"; then
- if [ "$2" == "simulator" ]; then
- log E "gtest not supported for simulator yet."
- return_code=1
- fi
section_name+="gtest_$1"
section_starter "${section_name}" "${2}"
if [ "$2" == "host" ]; then
diff --git a/utils/utils_test.sh b/utils/utils_test.sh
index ddff8bb1..3a41de8f 100644
--- a/utils/utils_test.sh
+++ b/utils/utils_test.sh
@@ -91,9 +91,9 @@ print_summary_and_exit_if_failed_and_not_continue() {
#
# Arguments:
# ${1}: section name
-# ${2}: host/target/simulator
+# ${2}: host/target
section_starter() {
- if [[ "$2" == "host" || "$2" == "simulator" ]]; then
+ if [[ "$2" == "host" ]]; then
start_section "$1"
elif [[ "$2" == "target" ]]; then
start_adb_section "$1"
@@ -108,11 +108,11 @@ section_starter() {
#
# Arguments:
# ${1}: section name
-# ${2}: host/target/simulator
+# ${2}: host/target
# ${3}: return code
# ${4}: keep-going option
section_ender(){
- if [[ "$2" == "host" || "$2" == "simulator" ]]; then
+ if [[ "$2" == "host" ]]; then
end_section "$1" "$3"
elif [[ "$2" == "target" ]]; then
end_adb_section "$1" "$3"