aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkos Denke <akos.denke@linaro.org>2021-11-03 04:22:34 -0400
committerAkos Denke <akos.denke@linaro.org>2021-11-03 06:49:28 -0400
commitb241e5d728535adf3c93fe0f9f3830d5a1f445a8 (patch)
tree9b2317c5169daa25d56617128ed2473bc1b8c4e3
parent572d7439e1781a038589521fc49cc02833e8e31d (diff)
downloadart-build-scripts-b241e5d728535adf3c93fe0f9f3830d5a1f445a8.tar.gz
Merge simulator test script with the SVE version.
Change-Id: Icaf5de400631b47ab099f2240bff56f5a03645c4
-rwxr-xr-xtests/test_art_simulator.sh56
-rwxr-xr-xtests/test_art_simulator_sve2.sh124
2 files changed, 44 insertions, 136 deletions
diff --git a/tests/test_art_simulator.sh b/tests/test_art_simulator.sh
index aac1603f..094a4ad3 100755
--- a/tests/test_art_simulator.sh
+++ b/tests/test_art_simulator.sh
@@ -23,15 +23,33 @@ source "${local_path}/../utils/utils_test.sh"
source "${local_path}/../utils/utils_android.sh"
source "${local_path}/../utils/utils_android_root.sh"
-readonly patch_change_id="I3be88806135f6e4110650ec3233fedc6cf4a7a1e"
readonly timer_name="Simulator Test"
readonly lunch_target="armv8"
+readonly sim_patch_change_id="I3be88806135f6e4110650ec3233fedc6cf4a7a1e"
+readonly sim_patch_change_number="5071"
+
+readonly -a sve_patch_change_ids=(
+ "I346423f7a5ab11be1e9ec3178a9e1e5f69f114ad" # SIMD checker tests
+ "I47f018d228f46607e68ea7273ed983c7577cb784" # SVE in VIXL
+ "If757e7a6c7f6fe0e907a5ed2faf0b0b538132ab0" # enable SVE
+)
+readonly -a sve_patch_change_numbers=(
+ "4303" # SIMD checker tests
+ "5203" # SVE in VIXL
+ "5204" # enable SVE
+)
+if [[ "${!sve_patch_change_ids[@]}" != "${!sve_patch_change_numbers[@]}" ]]; then
+ log E "The number of patches does not match in sve_patch_change_ids and sve_patch_change_numbers"
+ abort
+fi
+
usage() {
log I "$0"
log I "This script is used to run the ART simulator test on host."
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"
exit 0
}
@@ -41,21 +59,35 @@ declare -A options_format=(
["h"]="r:&help"
["build-target"]="false"
["t"]="r:&build-target"
+ ["sve"]="false"
+ ["s"]="r:&sve"
)
declare -A options=()
prepare_workspace() {
- sim_downloaded="false"
- sim_patch_hash=$(git --no-pager -C art log --format=format:%H -1 \
- --grep "Change-Id: ${patch_change_id}")
- if [[ "${sim_patch_hash}" == "" ]]; then
- log I "WARNING: Cherry picking the required patch, this will appear on your branch history"
- log I "Use repo sync --local-only --detach art to remove it, uncommitted changes will be
- kept in the working directory but local commits will be unlinked"
- sim_downloaded="true"
- safe repo download --cherry-pick "art" "5071"
- fi
+ local -ar patch_change_ids=(
+ "${sim_patch_change_id}"
+ $([[ "${options[sve]}" == "true" ]] && echo "${sve_patch_change_ids[@]}")
+ )
+ local -ar patch_change_numbers=(
+ "${sim_patch_change_number}"
+ $([[ "${options[sve]}" == "true" ]] && echo "${sve_patch_change_numbers[@]}")
+ )
+
+ local any_patch_downloaded="false"
+ local idx
+ for idx in "${!patch_change_ids[@]}"; do
+ local patch_hash=$(git --no-pager -C art log --format=format:%H -1 \
+ --grep "Change-Id: ${patch_change_ids[idx]}")
+ if [[ "${patch_hash}" == "" ]]; then
+ log I "WARNING: Cherry picking the required patch, this will appear on your branch history"
+ log I "Use repo sync --local-only --detach art to remove it, uncommitted changes will be
+ kept in the working directory but local commits will be unlinked"
+ safe repo download --cherry-pick "art" "${patch_change_numbers[idx]}"
+ any_patch_downloaded="true"
+ fi
+ done
# According to art/test/README.chroot.md, the test script needs to set this
# env variable when building ART minimal tree.
@@ -66,7 +98,7 @@ prepare_workspace() {
# If downloading the patch then we need to rebuild the target
# regardless of if the build_target option is given
if [[ "${options[build-target]}" == "true" ]] ||
- [[ "${sim_downloaded}" == "true" ]]; then
+ [[ "${any_patch_downloaded}" == "true" ]]; then
log I "Building target"
select_android_target "arm" "${lunch_target}"
build_target "64"
diff --git a/tests/test_art_simulator_sve2.sh b/tests/test_art_simulator_sve2.sh
deleted file mode 100755
index 1136ed04..00000000
--- a/tests/test_art_simulator_sve2.sh
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2021, Linaro Ltd.
-# All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Run the ART tests on the VIXL Simulator with SVE2 enabled
-
-readonly local_path=$(dirname "$0")
-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"
-
-readonly timer_name="Simulator Test with SVE2"
-readonly lunch_target="armv8"
-
-readonly -a patch_change_ids=(
- "I3be88806135f6e4110650ec3233fedc6cf4a7a1e" # simulator
- "I346423f7a5ab11be1e9ec3178a9e1e5f69f114ad" # SIMD checker tests
- "I47f018d228f46607e68ea7273ed983c7577cb784" # SVE in VIXL
- "If757e7a6c7f6fe0e907a5ed2faf0b0b538132ab0" # enable SVE
-)
-readonly -a patch_change_numbers=(
- "5071" # simulator
- "4303" # SIMD checker tests
- "5203" # SVE in VIXL
- "5204" # enable SVE
-)
-if [[ "${!patch_change_ids[@]}" != "${!patch_change_numbers[@]}" ]]; then
- log E "The number of patches does not match in patch_change_ids and patch_change_numbers"
- abort
-fi
-
-usage() {
- log I "$0"
- log I "This script is used to run the ART simulator test on host with SVE2 enabled."
- log I " -h|--help Show this help."
- log I " -t|--build-target Build arm64 target images, e.g. core.art"
- exit 0
-}
-
-# shellcheck disable=SC2034
-declare -A options_format=(
- ["help"]="p:usage()"
- ["h"]="r:&help"
- ["build-target"]="false"
- ["t"]="r:&build-target"
-)
-
-declare -A options=()
-
-prepare_workspace() {
- local any_patch_downloaded="false"
- local idx
- for idx in "${!patch_change_ids[@]}"; do
- local patch_hash=$(git --no-pager -C art log --format=format:%H -1 \
- --grep "Change-Id: ${patch_change_ids[idx]}")
- if [[ "${patch_hash}" == "" ]]; then
- log I "WARNING: Cherry picking the required patch, this will appear on your branch history"
- log I "Use repo sync --local-only --detach art to remove it, uncommitted changes will be
- kept in the working directory but local commits will be unlinked"
- safe repo download --cherry-pick "art" "${patch_change_numbers[idx]}"
- any_patch_downloaded="true"
- fi
- done
-
- # 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
-
- source_android_environment_default
-
- # If downloading the patch then we need to rebuild the target
- # regardless of if the build_target option is given
- if [[ "${options[build-target]}" == "true" ]] ||
- [[ "${any_patch_downloaded}" == "true" ]]; then
- log I "Building target"
- select_android_target "arm" "${lunch_target}"
- build_target "64"
- fi
-
- setup_android_target "${lunch_target}"
- set_environment_host
- build_host
-}
-
-test_simulator() {
- start_section "simulator_sve2"
- 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_sve2" "${return_code}"
-}
-
-main() {
- exit_on_failure arguments_parser options_format options -- "$@"
- readonly options
- dump_options
-
- start_test "${timer_name}"
-
- prepare_workspace
- test_simulator
-
- end_test "${timer_name}"
-}
-
-main "$@"