[CI] add mobile ci test config

Signed-off-by: wuhuiquan <wuhuiquan4@huawei.com>
This commit is contained in:
wuhuiquan
2024-12-20 09:34:40 +08:00
parent d9cca0c60a
commit 1796fcde61
6 changed files with 155 additions and 113 deletions
+4 -3
View File
@@ -1,11 +1,12 @@
[
{
"Name": "Rust",
"License": "MIT",
"License File": "COPYRIGHT",
"License": "Apache-2.0;MIT",
"License File": "LICENSE-APACHE;LICENSE-MIT",
"Version Number": "1.72.0",
"Owner": "qilin.wang@huawei.com",
"Upstream URL": "https://github.com/rust-lang/rust",
"Description": "A language empowering everyone to build reliable and efficient software."
"Description": "A language empowering everyone to build reliable and efficient software.",
"Dependencies": ["LLVM"]
}
]
+80 -66
View File
@@ -1,66 +1,80 @@
tests/ui/allocator/no_std-alloc-error-handler-custom.rs
tests/ui/allocator/no_std-alloc-error-handler-default.rs
tests/ui/async-await/issue-86507.rs
tests/ui/async-await/issues/issue-62009-1.rs
tests/ui/closure_context/issue-26046-fn-mut.rs
tests/ui/closure_context/issue-26046-fn-once.rs
tests/ui/confuse-field-and-method/issue-18343.rs
tests/ui/confuse-field-and-method/issue-33784.rs
tests/ui/confuse-field-and-method/issue-2392.rs
tests/ui/extern-flag/force-extern.rs
tests/ui/extern-flag/no-force-extern.rs
tests/ui/extern-flag/redundant-force-extern.rs
tests/ui/higher-ranked/trait-bounds/issue-30786.rs
tests/ui/impl-trait/nested-return-type2-tait2.rs
tests/ui/functions-closures/fn-help-with-err.rs
tests/ui/impl-trait/nested-return-type2-tait3.rs
tests/ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.rs
tests/ui/impl-trait/issues/issue-86800.rs
tests/ui/impl-trait/normalize-tait-in-const.rs
tests/ui/issues/issue-21763.rs
tests/ui/issues/issue-41880.rs
tests/ui/higher-ranked/trait-bounds/future.rs#classic
tests/ui/hygiene/panic-location.rs
tests/ui/intrinsics/const-eval-select-backtrace-std.rs
tests/ui/layout/valid_range_oob.rs
tests/ui/intrinsics/const-eval-select-backtrace.rs
tests/ui/meta/no_std-extern-libc.rs
tests/ui/mismatched_types/issue-36053-2.rs
tests/ui/mir/validate/storage-live.rs
tests/ui/never_type/fallback-closure-wrap.rs#fallback
tests/ui/panics/default-backtrace-ice.rs
tests/ui/issues/issue-87707.rs
tests/ui/panics/fmt-only-once.rs
tests/ui/panics/issue-47429-short-backtraces.rs
tests/ui/panics/location-detail-panic-no-column.rs
tests/ui/panics/location-detail-panic-no-file.rs
tests/ui/panics/location-detail-panic-no-line.rs
tests/ui/panics/location-detail-unwrap-no-file.rs
tests/ui/panics/location-detail-panic-no-location-info.rs
tests/ui/panics/runtime-switch.rs
tests/ui/panics/short-ice-remove-middle-frames-2.rs
tests/ui/panics/short-ice-remove-middle-frames.rs
tests/ui/treat-err-as-bug/delay_span_bug.rs
tests/ui/treat-err-as-bug/err.rs
tests/ui/typeck/issue-31173.rs
tests/ui/typeck/return_type_containing_closure.rs
tests/ui/test-attrs/test-thread-capture.rs
tests/ui/test-attrs/test-thread-nocapture.rs
tests/ui/test-attrs/test-panic-abort-nocapture.rs
tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.rs
tests/ui/test-attrs/test-panic-abort.rs
tests/ui/recursion/issue-83150.rs
tests/ui/process/multi-panic.rs
tests/ui/abi/stack-probes.rs
tests/ui/backtrace.rs
tests/ui/runtime/backtrace-debuginfo.rs
tests/ui/std-backtrace.rs
tests/ui/abi/stack-probes-lto.rs
tests/rustdoc-ui/issues/issue-98690.rs
tests/rustdoc-ui/ice-bug-report-url.rs
tests/rustdoc-ui/doctest/failed-doctest-output.rs
tests/run-make/short-ice
tests/run-make/libtest-json
tests/run-make/libtest-junit
tests/run-make/inaccessible-temp-dir
tests/codegen/issues/issue-114312.rs
[all]tests/ui/allocator/no_std-alloc-error-handler-custom.rs
[all]tests/ui/allocator/no_std-alloc-error-handler-default.rs
[ohos]tests/ui/async-await/issue-86507.rs
[ohos]tests/ui/async-await/issues/issue-62009-1.rs
[ohos]tests/ui/closure_context/issue-26046-fn-mut.rs
[ohos]tests/ui/closure_context/issue-26046-fn-once.rs
[ohos]tests/ui/confuse-field-and-method/issue-18343.rs
[all]tests/ui/confuse-field-and-method/issue-33784.rs
[all]tests/ui/confuse-field-and-method/issue-2392.rs
[all]tests/ui/extern-flag/force-extern.rs
[all]tests/ui/extern-flag/no-force-extern.rs
[all]tests/ui/extern-flag/redundant-force-extern.rs
[all]tests/ui/higher-ranked/trait-bounds/issue-30786.rs
[ohos]tests/ui/impl-trait/nested-return-type2-tait2.rs
[all]tests/ui/functions-closures/fn-help-with-err.rs
[ohos]tests/ui/impl-trait/nested-return-type2-tait3.rs
[all]tests/ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.rs
[all]tests/ui/impl-trait/issues/issue-86800.rs
[all]tests/ui/impl-trait/normalize-tait-in-const.rs
[all]tests/ui/issues/issue-21763.rs
[ohos]tests/ui/issues/issue-41880.rs
[all]tests/ui/higher-ranked/trait-bounds/future.rs#classic
[all]tests/ui/hygiene/panic-location.rs
[all]tests/ui/intrinsics/const-eval-select-backtrace-std.rs
[all]tests/ui/layout/valid_range_oob.rs
[all]tests/ui/intrinsics/const-eval-select-backtrace.rs
[all]tests/ui/meta/no_std-extern-libc.rs
[all]tests/ui/mismatched_types/issue-36053-2.rs
[all]tests/ui/mir/validate/storage-live.rs
[ohos]tests/ui/never_type/fallback-closure-wrap.rs#fallback
[all]tests/ui/panics/default-backtrace-ice.rs
[all]tests/ui/issues/issue-87707.rs
[all]tests/ui/panics/fmt-only-once.rs
[all]tests/ui/panics/issue-47429-short-backtraces.rs
[all]tests/ui/panics/location-detail-panic-no-column.rs
[all]tests/ui/panics/location-detail-panic-no-file.rs
[all]tests/ui/panics/location-detail-panic-no-line.rs
[all]tests/ui/panics/location-detail-unwrap-no-file.rs
[all]tests/ui/panics/location-detail-panic-no-location-info.rs
[all]tests/ui/panics/runtime-switch.rs
[all]tests/ui/panics/short-ice-remove-middle-frames-2.rs
[all]tests/ui/panics/short-ice-remove-middle-frames.rs
[all]tests/ui/treat-err-as-bug/delay_span_bug.rs
[all]tests/ui/treat-err-as-bug/err.rs
[all]tests/ui/typeck/issue-31173.rs
[ohos]tests/ui/typeck/return_type_containing_closure.rs
[all]tests/ui/test-attrs/test-thread-capture.rs
[all]tests/ui/test-attrs/test-thread-nocapture.rs
[all]tests/ui/test-attrs/test-panic-abort-nocapture.rs
[all]tests/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.rs
[all]tests/ui/test-attrs/test-panic-abort.rs
[all]tests/ui/recursion/issue-83150.rs
[all]tests/ui/process/multi-panic.rs
[all]tests/ui/abi/stack-probes.rs
[all]tests/ui/backtrace.rs
[all]tests/ui/runtime/backtrace-debuginfo.rs
[all]tests/ui/std-backtrace.rs
[all]tests/ui/abi/stack-probes-lto.rs
[ohos]tests/rustdoc-ui/issues/issue-98690.rs
[all]tests/rustdoc-ui/ice-bug-report-url.rs
[all]tests/rustdoc-ui/doctest/failed-doctest-output.rs
[all]tests/run-make/short-ice
[all]tests/run-make/libtest-json
[all]tests/run-make/libtest-junit
[ohos]tests/run-make/inaccessible-temp-dir
[all]tests/codegen/issues/issue-114312.rs
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-attr-no-sanitize.rs#x86_64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-attr-no-sanitize.rs#aarch64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs#aarch64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs#x86_64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs#x86_64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs#aarch64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle.rs#aarch64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs#aarch64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle.rs#x86_64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs#aarch64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs#x86_64
[mobile]tests/codegen/sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs#x86_64
[mobile]tests/codegen/sanitizer-kcfi-emit-type-metadata-trait-objects.rs#aarch64
[mobile]tests/codegen/sanitizer-kcfi-emit-type-metadata-trait-objects.rs#x86_64
+61 -1
View File
@@ -143,4 +143,64 @@ export_ohos_path() {
export PATH=${rust_tools}/clang/ohos/linux-x86_64/llvm/bin:$PATH
export PATH=${rust_tools}/cmake/linux-x86/bin:$PATH
fi
}
}
download_rust() {
local pre_rust_date="2023-07-13"
mkdir -p ${rust_source_dir}/build/cache/${pre_rust_date}
if [ "${host_platform}" = "linux" ] && [ ${host_cpu} = "x86_64" ]; then
if [ ! -d "${root_build_dir}/opensource" ]; then
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.72.0.xml" -at opensource
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.71.0_linux.xml" -at opensource
fi
elif [ "${host_platform}" = "darwin" ]; then
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.72.0.xml" -at opensource
if [ ${host_cpu} = "x86_64" ]; then
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.71.0_mac_x86.xml" -at opensource
elif [ ${host_cpu} = "arm64" ]; then
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.71.0_mac_arm.xml" -at opensource
fi
fi
cp ${root_build_dir}/opensource/Rust/1.71.0/* ${rust_source_dir}/build/cache/${pre_rust_date}
}
get_exclude_file() {
while read line; do
if [ -z "$line" ]; then
break
fi
# get fail repository
tag=$(echo $line | cut -d ']' -f 1 | tr -d '[')
# get fail test case
content=$(echo $line | cut -d ']' -f 2-)
case $tag in
"all")
exclude_file="$exclude_file --exclude $content"
;;
"mobile")
if [ "${1}" = "mobile" ]; then
exclude_file="$exclude_file --exclude $content"
fi
;;
"ohos")
if [ "${1}" = "ohos" ]; then
exclude_file="$exclude_file --exclude $content"
fi
;;
*)
echo "Unknown tag: $tag"
;;
esac
done < ${shell_path}/exclude_test.txt
}
get_test_suite() {
test_suite_dir=("assembly" "codegen" "codegen-units" "incremental" "mir-opt"
"pretty" "run-coverage" "run-coverage-rustdoc" "run-make" "run-make-fulldeps"
"run-pass-valgrind" "rustdoc" "rustdoc-js" "rustdoc-js-std"
"rustdoc-json" "rustdoc-ui" "ui" "ui-fulldeps")
for element in "${test_suite_dir[@]}"
do
all_test_suite="${all_test_suite} tests/${element}"
done
}
+3 -22
View File
@@ -7,9 +7,9 @@ readonly rust_source_dir="${shell_path}/.."
readonly ci_shell_dir="${root_build_dir}/build/rustbuild/"
readonly install_path="${rust_source_dir}/build/dist"
readonly output_install="${root_build_dir}/output/"
readonly oh_tools="/usr1/mobile_cpu/BiSheng/bin"
readonly oh_tools="/opt/buildtools/mobile_cpu/BiSheng/bin"
readonly mingw_tools="/opt/buildtools/llvm-mingw-20220906/bin"
readonly bep_home="/opt/buildtools/secBepkit-2.2.0"
readonly bep_home="/opt/buildtools/secBepkit-2.2.0.2"
readonly old_version="xxxxx"
new_version="xxxxx"
bep_build=false
@@ -44,25 +44,6 @@ parse_options() {
return 0
}
download_rust() {
local pre_rust_date="2023-07-13"
mkdir -p ${rust_source_dir}/build/cache/${pre_rust_date}
if [ "${host_platform}" = "linux" ] && [ ${host_cpu} = "x86_64" ]; then
if [ ! -d "${root_build_dir}/opensource" ]; then
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.72.0.xml" -at opensource
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.71.0_linux.xml" -at opensource
fi
elif [ "${host_platform}" = "darwin" ]; then
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.72.0.xml" -at opensource
if [ ${host_cpu} = "x86_64" ]; then
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.71.0_mac_x86.xml" -at opensource
elif [ ${host_cpu} = "arm64" ]; then
artget pull -ap "${root_build_dir}/opensource" -os "${ci_shell_dir}/rust1.71.0_mac_arm.xml" -at opensource
fi
fi
cp ${root_build_dir}/opensource/Rust/1.71.0/* ${rust_source_dir}/build/cache/${pre_rust_date}
}
bep_prepare() {
# bep patch
if [ -n "$(grep -rn "HashMap" $root_build_dir/rust/vendor/compiler_builtins/build.rs)" ];then
@@ -152,6 +133,7 @@ main() {
if [ ${bep_build} = true ]; then
bep_prepare
lock_bep_time
fi
pushd ${rust_source_dir}
@@ -159,7 +141,6 @@ main() {
popd
if [ ${bep_build} = true ]; then
lock_bep_time
collect_build_result
unlock_bep_time
fi
+1 -1
View File
@@ -53,13 +53,13 @@ main() {
pushd ${rust_source_dir}
export_ohos_path
python3 ./x.py dist
collect_build_result
if [ "${host_platform}" = "linux" ]; then
check_build_result aarch64-unknown-linux-ohos
fi
popd
echo "Building the rust toolchain Completed"
}
+6 -20
View File
@@ -8,9 +8,10 @@ readonly rust_tools="${root_build_dir}/prebuilts"
readonly rust_static_dir="${root_build_dir}/rust_download"
readonly oh_tools="${rust_tools}/ohos-sdk/linux/12/native/llvm/bin"
readonly mingw_tools="${rust_tools}/mingw-w64/ohos/linux-x86_64/clang-mingw/bin"
exclude_file=""
all_test_suite=""
source ${shell_path}/function.sh
exclude_file=""
main() {
detect_platform
@@ -26,27 +27,12 @@ main() {
pushd ${rust_source_dir}
export_ohos_path
while read line; do
if [ -z "$line" ]; then
break
fi
exclude_file="$exclude_file --exclude $line"
done < ${shell_path}/exclude_test.txt
test_suite_dir=("assembly" "codegen" "codegen-units" "incremental" "mir-opt"
"pretty" "run-coverage" "run-coverage-rustdoc" "run-make" "run-make-fulldeps"
"run-pass-valgrind" "rustdoc" "rustdoc-js" "rustdoc-js-std"
"rustdoc-json" "rustdoc-ui" "ui" "ui-fulldeps")
all_test_suite=""
for element in "${test_suite_dir[@]}"
do
all_test_suite="${all_test_suite} tests/${element}"
done
get_test_suite
get_exclude_file "ohos"
python3 ./x.py test --stage=2 ${all_test_suite} $exclude_file --no-fail-fast
popd
echo "test the rust toolchain Completed"
}
main
main