From 832a4f933504eb755d61f0a7573afd85d480de6a Mon Sep 17 00:00:00 2001
From: Eric
Date: Fri, 30 May 2025 09:16:35 +0800
Subject: [PATCH] Revert "[test] Add test scripts"
This reverts commit 8ab65f704cd81f3941221fea78011e6b7cabf160.
Signed-off-by: Eric
---
test/README.md | 51 -------
test/llvm-ggw/job_runner.Jenkinsfile | 73 ----------
test/llvm-ggw/job_wrapper.groovy | 131 -----------------
test/local-jenkins/ci_daily.sh | 169 ----------------------
test/local-jenkins/run_test.sh | 143 ------------------
test/local-jenkins/send_email.py | 87 -----------
test/sanitizer-ggw/build_project.sh | 100 -------------
test/sanitizer-ggw/job_runner.Jenkinsfile | 93 ------------
test/sanitizer-ggw/job_wrapper.groovy | 135 -----------------
test/sanitizer-ggw/test_project.sh | 109 --------------
10 files changed, 1091 deletions(-)
delete mode 100644 test/README.md
delete mode 100644 test/llvm-ggw/job_runner.Jenkinsfile
delete mode 100644 test/llvm-ggw/job_wrapper.groovy
delete mode 100644 test/local-jenkins/ci_daily.sh
delete mode 100644 test/local-jenkins/run_test.sh
delete mode 100644 test/local-jenkins/send_email.py
delete mode 100644 test/sanitizer-ggw/build_project.sh
delete mode 100644 test/sanitizer-ggw/job_runner.Jenkinsfile
delete mode 100644 test/sanitizer-ggw/job_wrapper.groovy
delete mode 100644 test/sanitizer-ggw/test_project.sh
diff --git a/test/README.md b/test/README.md
deleted file mode 100644
index f86e4c58734f..000000000000
--- a/test/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Test Scripts
-
-This folder hosts a collection of example scripts designed for testing various components of the LLVM project. These scripts facilitate the building, testing, and reporting processes for `llvm-ggw`, `sanitizer-ggw`, and local Jenkins setups.
-
-## Directory Structure
-
-* **`llvm-ggw/`**: Contains scripts and configuration files for triggering and running tests related to the `llvm-ggw` component.
- * `job_runner.Jenkinsfile`: Jenkins pipeline script that triggers the `llvm-ggw` test suite.
- * `job_wrapper.groovy`: Groovy script used for configuring Jenkins jobs specifically for `llvm-ggw` testing.
-
-* **`sanitizer-ggw/`**: Holds scripts responsible for building and testing the `sanitizer-ggw` project.
- * `build_project.sh`: Shell script to build the `sanitizer-ggw` project.
- * `job_runner.Jenkinsfile`: Jenkins pipeline script that triggers the `sanitizer-ggw` test suite.
- * `job_wrapper.groovy`: Groovy script used for configuring Jenkins jobs specifically for `sanitizer-ggw` testing.
- * `test_project.sh`: Shell script to execute tests on the `sanitizer-ggw` project.
-
-* **`local-jenkins/`**: Houses scripts used in a local Jenkins environment.
- * `ci_daily.sh`: Shell script for daily continuous integration tasks.
- * `run_test.sh`: Shell script to execute the test suite.
- * `send_email.py`: Python script to send email notifications (presumably for test results).
-
-## Test suites
-
-* **`llvm-ggw`**: Test suite for llvm regression tests、unit tests、ace super test、llvm benchmark、llvmts.
- * `unit tests`: Unit tests are written using Google Test and Google Mock and are located in the llvm/unittests directory.
- * `regression tests`: The regression tests are small pieces of code that test a specific feature of LLVM or trigger a specific bug in LLVM. These tests are located in the llvm/test directory.
- * `ace super test`: Comprehensive test and validation suite for compilers and library support for the programming languages C and C++.
- * `llvm benchmark`: The test-suite contains benchmark and test programs. It comes with tools to collect metrics such as benchmark runtime, compilation time and code size.
- * `llvmts`: The suite comes with tools to collect metrics such as benchmark runtime, compilation time and code size, see:https://llvm.org/docs/TestSuiteGuide.html.
-
-* **`sanitizer-ggw`**: Test suite for compiler-rt, currently we support asan、 cfi、 gwp_asan、hwasan、tsan、ubsan, These tests are located in the llvm/compiler-rt/test directory.
-
-* **`local-jenkins`**: Local copy of sanitizer daily tests.
-
-The 'llvm-ggw' and 'sanitizer-ggw' test suite are used for blue-zone gitee verification, and 'local-jenkins' is used for yellow-zone development.
-
-## Usage
-
-These scripts are intended to be used as examples and starting points. You should modify them according to your specific project requirements and testing environment. Refer to the individual script files for more detailed usage instructions.
-
-## Prerequisites
-
-Before using these scripts, ensure you have the following prerequisites in place:
-
-* Jenkins
-* Python
-* Necessary build tools and dependencies for LLVM and related projects.
-
-## Contributing
-
-Contributions are welcome! If you find any issues or have improvements to the scripts, please feel free to submit a pull request. Make sure to follow the existing coding style and include appropriate test cases where applicable.
diff --git a/test/llvm-ggw/job_runner.Jenkinsfile b/test/llvm-ggw/job_runner.Jenkinsfile
deleted file mode 100644
index cdd8e92318f4..000000000000
--- a/test/llvm-ggw/job_runner.Jenkinsfile
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (c) 2024 Huawei Device Co., Ltd.
- * 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.
- */
-echo 'BZ PRE MERGE LLVM'
-String libBranchName = params?.ark_ci_revision ?: 'master'
-def lib = library("llvm_ci_helpers@${libBranchName}").com.x.rnd.devops
-def stageStatus = lib.StagesStatus.new()
-
-// Init helpers
-echo 'initDepTree'
-helpers.initDepTree()
-echo 'initRepoManifest'
-helpers.initRepoManifest()
-echo 'initRunParams'
-helpers.initRunParams()
-
-env.REPO_TYPE = 'repo_emui'
-env.NEXUS_REPO = 'nexus-cn-yz.devops-spb.rnd.x.com'
-env.NEXUS_PROTOCOL = 'https'
-
-def errorException = 'none'
-String ciStatus = 'passed'
-
-env.PIPELINE_NAME = 'LLVM'
-
-// Init stage
-// echo 'runPreMergeInitStage'
-// pipeStages.runPreMergeInitStage()
-
-//We define default image here but we need to change it for each job
-echo 'getImage'
-String image = helpers.getImage()
-Map cloud = ['cloud' : 'ark-cloud', 'template' : ['panda-1cpu-proxy', 'panda-1cpu'], 'image' : image]
-
-echo 'Prepare'
-try {
- config = libraryResource('gitlab_wrapper.yml')
- Map job = (Map) readYaml(text: config)
- echo 'Config ready'
-
- // Get the first job from yaml. It is assumed that there is only one
- revJobName = job.keySet().find { true }
- // Save checkReposRegexFilter to the job params
- job[revJobName].checkReposRegexFilter = []
- echo "JOB: ${revJobName}"
-
- // Generate and run the stage
- stg = helpers.prepareOneStage(cloud, revJobName, job[revJobName], stageStatus)
- stg.call()
-} catch (ex) {
- ciStatus = 'failed'
- errorException = ex
- echo "Failed: ${ex}"
-}
-
-if (helpers.wasPipelineCanceled(errorException)) {
- ciStatus = 'cancelled'
-}
-
-pipeStages.runSendResultStage(ciStatus)
-
-helpers.processCiStatus(ciStatus, errorException)
diff --git a/test/llvm-ggw/job_wrapper.groovy b/test/llvm-ggw/job_wrapper.groovy
deleted file mode 100644
index 2b2bf6188322..000000000000
--- a/test/llvm-ggw/job_wrapper.groovy
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
- * 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.
- */
-
-import java.time.LocalDateTime
-import groovy.json.JsonOutput
-import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
-import net.sf.json.JSONObject
-
-
-/* groovylint-disable-next-line UnusedMethodParameter */
-void launchLLVMGitlabCI(stageParams) {
- echo "stageParams ${stageParams}"
-
- response = ggApi.getRunParams(helpers.runParams.ggRunId)
- echo "Response: ${response}"
- def slurper = new groovy.json.JsonSlurper()
- def result = slurper.parseText(response)
-
- BZ_LLVM_PROJECT_USER_URL = result.origins[0]
- echo "BZ_LLVM_PROJECT_USER_URL = ${BZ_LLVM_PROJECT_USER_URL}"
- PR_NUMBER = result.prs[0].split('/')[1]
- echo "PR_NUMBER = ${PR_NUMBER}"
- if (BZ_LLVM_PROJECT_USER_URL.endsWith(".git")) {
- BZ_LLVM_PROJECT_USER_URL = BZ_LLVM_PROJECT_USER_URL.replace(".git", "")
- echo "changed BZ_LLVM_PROJECT_USER_URL = ${BZ_LLVM_PROJECT_USER_URL}"
- }
- BZ_MUSL_USER_URL = ""
- TARGET_FILTER = "ohos"
- REF_BRANCH = "x/blue-zone-open-harmonyos"
- ADD_BUILD_PARAMS = "--no-build-x86_64 --no-build-mipsel --no-build-arm --no-build-riscv64 --no-build windows,lldb-server,check-api"
- TARGET_DEVICE = "hdc-device"
- TARGET_TRIPLE = "aarch64-linux-ohos"
- DEVLIB_TARGET_TYPE = "OHOS"
- DEVLIB_CONN_TYPE = "HDC"
- HDC_FARM_URL = "https://ark-hdc-farm-yz.devops-spb.rnd.x.com"
- HDC_DEVICE_CI_LABEL = "LLVM-CI"
- HDC_DEVICE_ARCH_LABEL = "AARCH64"
-
- if (result.custom[0]) {
- SUBSET_FILTER = result.custom[0]
- } else {
- SUBSET_FILTER = "toolchain_simple"
- }
-
- if (!SUBSET_FILTER.contains("toolchain")) {
- SUBSET_FILTER = "toolchain_simple"
- }
-
- echo "subset from gitee ${SUBSET_FILTER}"
- def file_diff_content = sh(returnStdout: true, script: """curl https://gitee.com/openharmony/third_party_llvm-project/pulls/${PR_NUMBER}.diff""")
- LLDB_CHANGED = file_diff_content.contains("+++ b/lldb")
-
- echo "LLDB_CHANGED = ${LLDB_CHANGED}"
-
- if (SUBSET_FILTER == 'toolchain_debugger' || LLDB_CHANGED) {
- ADD_BUILD_PARAMS = "--no-build-x86_64 --no-build-mipsel --no-build-arm --no-build-riscv64 --no-build windows"
- }
- withCredentials([string(credentialsId: 'LLVM_CI_TOKEN', variable: 'LLVM_CI_TOKEN'),
- string(credentialsId: 'LLVM_ACCESS_TOKEN', variable: 'LLVM_ACCESS_TOKEN')
- ]) {
- try {
-
- response = sh(returnStdout: true, script: """curl -X POST \
- --fail \
- -F token=${LLVM_CI_TOKEN} \
- -F ref=${REF_BRANCH} \
- -F variables[BZ_LLVM_PROJECT_USER_URL]=${BZ_LLVM_PROJECT_USER_URL} \
- -F variables[BZ_MUSL_USER_URL]=${BZ_MUSL_USER_URL} \
- -F variables[TOOLCHAIN_MANIFEST_NAME]=llvm-toolchain.xml \
- -F variables[MANIFEST_REPOSITORY_URL]=https://gitee.com/openharmony/manifest.git \
- -F variables[TOOLCHAIN_MANIFEST]=master \
- -F variables[TARGET_FILTER]=${TARGET_FILTER} \
- -F variables[BUILD_FAST]=true \
- -F variables[SUBSET_FILTER]=${SUBSET_FILTER} \
- -F variables[ADD_BUILD_PARAMS]="${ADD_BUILD_PARAMS}" \
- -F variables[TARGET_DEVICE]="${TARGET_DEVICE}" \
- -F variables[TARGET_TRIPLE]="${TARGET_TRIPLE}" \
- -F variables[DEVLIB_TARGET_TYPE]="${DEVLIB_TARGET_TYPE}" \
- -F variables[DEVLIB_CONN_TYPE]="${DEVLIB_CONN_TYPE}" \
- -F variables[HDC_FARM_URL]="${HDC_FARM_URL}" \
- -F variables[HDC_DEVICE_CI_LABEL]="${HDC_DEVICE_CI_LABEL}" \
- -F variables[HDC_DEVICE_ARCH_LABEL]="${HDC_DEVICE_ARCH_LABEL}" \
- https://rnd-gitlab-msc.x.com/api/v4/projects/3091/trigger/pipeline
- """)
- sh(label: 'Install jq', script: 'apt-get update && apt-get install --no-install-recommends -y jq')
-
- JSONObject respJson = readJSON(text: response)
- pipeId = respJson['id']
- echo "Triggered ${respJson['web_url']}"
- sh(label: 'Detailed gitlab response:', script: "echo ${response}")
- sh(label: 'Wait GitLab CI to finish', script: """while true; do \
- sleep 20; \
- curl --header 'PRIVATE-TOKEN: ${LLVM_ACCESS_TOKEN}' \
- https://rnd-gitlab-msc.x.com/api/v4/projects/3091/pipelines/${pipeId} 2>/dev/null | \
- jq .finished_at | \
- grep null || break; \
- done
- """)
- } catch (FlowInterruptedException ex) {
- echo "in FlowInterruptedException"
- response = sh(returnStdout: true, label: 'Get GitLab CI cancel', script:
- """curl --request POST --header 'PRIVATE-TOKEN: ${LLVM_ACCESS_TOKEN}' \
- https://rnd-gitlab-msc.x.com/api/v4/projects/3091/pipelines/${pipeId}/cancel
- """)
- respJson = readJSON(text: response)
- sh(label: "status: ${respJson['status']}", script: "echo ${response}")
- } finally {
- response = sh(returnStdout: true, label: 'Get GitLab CI result', script:
- """curl --header 'PRIVATE-TOKEN: ${LLVM_ACCESS_TOKEN}' \
- https://rnd-gitlab-msc.x.com/api/v4/projects/3091/pipelines/${pipeId}
- """)
- respJson = readJSON(text: response)
- sh(label: "status: ${respJson['status']}", script: "echo ${response}")
- if (respJson['status'] != 'success') {
- error("GitLab CI failed: ${respJson['web_url']}/failures")
- }
- }
- }
-}
diff --git a/test/local-jenkins/ci_daily.sh b/test/local-jenkins/ci_daily.sh
deleted file mode 100644
index 44720dc4e181..000000000000
--- a/test/local-jenkins/ci_daily.sh
+++ /dev/null
@@ -1,169 +0,0 @@
-#! /bin/bash
-
-# Copyright (c) 2025 Huawei Device Co., Ltd.
-# 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.
-
-echo "Params: $*"
-
-# 初始化变量
-BRANCH='master'
-ENABLE_INIT=0
-ENABLE_SYNC=0
-ENABLE_BUILD=0
-PR_NUMBER=''
-BUILD_TAG=''
-BUILD_URL=''
-START_TIME=$(date +%s)
-
-# 逐个处理参数
-for arg in "$@"
-do
- case $arg in
- --branch=*)
- BRANCH="${arg#*=}"
- ENABLE_INIT=1
- shift # 移除已处理的参数
- ;;
- --build=*)
- ENABLE_BUILD="${arg#*=}"
- shift
- ;;
- --sync=*)
- ENABLE_SYNC="${arg#*=}"
- shift
- ;;
- --buildTag=*)
- BUILD_TAG="${arg#*=}"
- shift
- ;;
- --buildURL=*)
- BUILD_URL="${arg#*=}"
- shift
- ;;
- --pr_number=*)
- PR_NUMBER="${arg#*=}"
- shift
- ;;
- *)
- esac
-done
-
-if [ "$ENABLE_INIT" = 1 ]; then
- echo "llvm-project switch to branch: $BRANCH"
- cd ~/llvm/toolchain/llvm-project
- git fetch
- git reset --hard
- git switch -c $BRANCH
- git checkout $BRANCH
- git pull origin $BRANCH
-else
- echo "current branch $BRANCH"
-fi
-
-if [ "$ENABLE_SYNC" = 1 ]; then
- cd ~/llvm
- echo "repo sync..."
- repo sync -c
-else
- echo "skip repo sync..."
-fi
-
-if [ -n "$PR_NUMBER" ]; then
- echo "pr编号为 $PR_NUMBER..."
- cd ~/llvm/toolchain/llvm-project
- git fetch https://gitee.com/openharmony/third_party_llvm-project.git pull/$PR_NUMBER/head:pr_$PR_NUMBER
- git checkout pr_$PR_NUMBER
-else
- echo "无--pr_number参数"
-fi
-
-if [ "$ENABLE_BUILD" = 1 ]; then
- echo "build start..."
- cd ~/llvm
- python3 ./toolchain/llvm-project/llvm-build/build.py --no-lto --enable-assertions --no-build-x86_64 --no-build-mipsel --no-build-arm --no-build-riscv64 --no-build windows,lldb-server,check-api
-else
- echo "skip build..."
-fi
-
-echo "running compiler-rt sanitizer tests..."
-TESTS=("cfi" "asan" "ubsan" "hwasan" "tsan" "gwp_asan")
-FAILED_TESTS=()
-EXIT_CODE=0
-SUMMARY=()
-
-cd ~/llvm/test-suites/
-rm -rf ~/llvm/test-suites/build
-mkdir -p ~/llvm/test-suites/build
-
-# set lit timeout to 120s
-sed -i 's/timeout=[0-9]\+/timeout=120/g' ~/llvm/toolchain/llvm-project/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_common.py
-
-# run TESTS
-for TEST in "${TESTS[@]}"; do
- TEST_RESULT="$TEST.result"
- touch $TEST_RESULT
- > $TEST_RESULT
-
- TEST_LOG="$TEST.log"
- touch $TEST_LOG
- > $TEST_LOG
-
- ~/llvm/test-suites/run_test.sh $TEST 0 |& tee $TEST_LOG
-
- if grep -q "Failed Tests" $TEST_LOG; then
- echo "sanitizer $TEST has failed tests."
- grep -A 500 "Failed Tests" $TEST_LOG >> $TEST_RESULT
- FAILED_TESTS+=("$TEST")
- elif grep -q "Unexpectedly" $TEST_LOG; then
- echo "sanitizer $TEST has unexpected behavior."
- grep -A 500 "Unexpectedly" $TEST_LOG >> $TEST_RESULT
- FAILED_TESTS+=("$TEST")
- else
- echo "All $TEST tests passed."
- grep -A 20 "Testing Time" $TEST_LOG >> $TEST_RESULT
- fi
-done
-
-# gen test summary
-if [ ${#FAILED_TESTS[@]} -ne 0 ]; then
- SUMMARY+="The following tests failed: "
- for FAILED_TEST in "${FAILED_TESTS[@]}"; do
- SUMMARY+=" [$FAILED_TEST] "
- done
- EXIT_CODE=1
-else
- SUMMARY+="All sanitizer tests passed."
-fi
-
-END_TIME=$(date +%s) # 记录结束时间,以秒为单位
-RUNTIME=$((END_TIME - START_TIME)) # 计算时间差,以秒为单位
-
-HOURS=$((RUNTIME / 3600))
-MINUTES=$(((RUNTIME % 3600) / 60))
-SECONDS=$((RUNTIME % 60))
-
-# 格式化时间字符串,注意处理小时数为0的情况
-if [ $HOURS -gt 0 ]; then
- TIME_STR="${HOURS}h ${MINUTES}m ${SECONDS}s"
-else
- TIME_STR="${MINUTES}m ${SECONDS}s"
-fi
-
-RESULT="${SUMMARY} (Cost ${TIME_STR}). see $BUILD_URL for detail."
-SUBJECT="[LLVM-sanitizers][$BUILD_TAG]"
-echo "$SUBJECT $RESULT"
-
-# send email
-python3 ~/llvm/test-suites/send_email.py "${SUBJECT}" "${RESULT}" "${TESTS[@]}"
-
-exit $EXIT_CODE
diff --git a/test/local-jenkins/run_test.sh b/test/local-jenkins/run_test.sh
deleted file mode 100644
index 87519d9f5f3c..000000000000
--- a/test/local-jenkins/run_test.sh
+++ /dev/null
@@ -1,143 +0,0 @@
-#! /bin/bash
-
-# Copyright (c) 2025 Huawei Device Co., Ltd.
-# 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.
-
-SANITIZER="asan"
-if [ "$#" -gt 0 ]; then
- SANITIZER=$1
- shift
-fi
-
-ENABLE_FILTER=0
-if [ $# -eq 2 ]; then
- ENABLE_FILTER=$2
-fi
-
-export PYTHONUNBUFFERED=1
-
-WORK_DIR=${PWD}
-echo "globle config..."
-
-LLVM_PROJECT_DIR=~/llvm/toolchain/llvm-project
-LLVM_CMAKE_DIR=${WORK_DIR}/cmake/Modules
-TOOLCHAIN_BIN_PATH=~/llvm/prebuilts/clang/ohos/linux-x86_64/clang-15.0.4/bin
-
-#sed the llvm cmake
-CMAKE_TOOLCHAIN_PATH=~/llvm/prebuilts/clang/ohos/linux-x86_64/clang-15.0.4/lib/cmake/llvm/LLVMExports.cmake
-sed -i '1159,1176 s/FATAL_ERROR/WARNING/g' ${CMAKE_TOOLCHAIN_PATH}
-
-HOS_TMPDIR="/data/local/tmp"
-SYSROOT=~/llvm/out/sysroot
-LLVM_RT_DIR=${WORK_DIR}/llvm-install/lib/clang/15.0.4
-LLVM_CONFIG_PATH="${TOOLCHAIN_BIN_PATH}/llvm-config"
-
-TARGET_TRIPLE="aarch64-linux-ohos"
-EXTRA_FLAGS="-fno-emulated-tls"
-DEVICE_COMPILE_FLAGS="--target=${TARGET_TRIPLE} --sysroot=${SYSROOT} -v ${EXTRA_FLAGS} -O0 -fuse-ld=lld -stdlib=libc++"
-DEVICE_LINKER_FLAGS="-Wl,-rpath,${HOS_TMPDIR},--allow-shlib-undefined,--unresolved-symbols=ignore-all"
-BUILD_TEST="ON"
-
-export HDC=~/bin/hdc
-export HDC_UTID=3ZF0124617000063
-export HDC_SERVER_IP_PORT=100.103.89.xxx:8710
-export HDC_CMD="$HDC -s $HDC_SERVER_IP_PORT -t $HDC_UTID"
-export PHONE_SYMBOLIZER_PATH="/system/bin/llvm-symbolizer"
-export HOS_RUN_VERBOSE=1
-
-echo "cmake config..."
-~/llvm/prebuilts/cmake/linux-x86/bin/cmake \
- ${LLVM_PROJECT_DIR}/compiler-rt \
- -G Ninja \
- -DCMAKE_SYSTEM_NAME=OHOS \
- -DOHOS=ON \
- -DCMAKE_AR="${TOOLCHAIN_BIN_PATH}/llvm-ar" \
- -DLLVM_CONFIG_PATH="${LLVM_CONFIG_PATH}" \
- -DCMAKE_ASM_COMPILER_TARGET="${TARGET_TRIPLE}" \
- -DCMAKE_ASM_FLAGS="${DEVICE_COMPILE_FLAGS}" \
- -DCMAKE_C_COMPILER="${TOOLCHAIN_BIN_PATH}/clang" \
- -DCMAKE_C_COMPILER_TARGET="${TARGET_TRIPLE}" \
- -DCMAKE_C_FLAGS="${DEVICE_COMPILE_FLAGS}" \
- -DCMAKE_CXX_COMPILER="${TOOLCHAIN_BIN_PATH}/clang++" \
- -DCMAKE_CXX_COMPILER_TARGET="${TARGET_TRIPLE}" \
- -DCMAKE_CXX_FLAGS="${DEVICE_COMPILE_FLAGS}" \
- -DCMAKE_EXE_LINKER_FLAGS="${DEVICE_COMPILE_FLAGS} ${DEVICE_LINKER_FLAGS}" \
- -DCOMPILER_RT_BUILD_BUILTINS=OFF \
- -DCOMPILER_RT_BUILD_LIBFUZZER=ON \
- -DCOMPILER_RT_BUILD_MEMPROF=OFF \
- -DCOMPILER_RT_BUILD_PROFILE=ON \
- -DCOMPILER_RT_BUILD_SANITIZERS=ON \
- -DCOMPILER_RT_BUILD_XRAY=OFF \
- -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \
- -DCOMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF \
- -DCOMPILER_RT_INCLUDE_TESTS="${BUILD_TEST}" \
- -DCOMPILER_RT_CAN_EXECUTE_TESTS="${BUILD_TEST}" \
- -DCOMPILER_RT_TEST_COMPILER="${TOOLCHAIN_BIN_PATH}/clang" \
- -DCOMPILER_RT_TEST_COMPILER_CFLAGS="${DEVICE_COMPILE_FLAGS}" \
- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \
- -DCMAKE_BUILD_TYPE=Release \
- -DCOMPILER_RT_OUTPUT_DIR="${LLVM_RT_DIR}"
-
-echo "cmake compile..."
-ninja compiler-rt -j16
-
-SAN_FILTER="${SANITIZER}"
-if [ "$SANITIZER" = "all" ]; then
- SAN_FILTER="*"
-fi
-
-echo "copy to llvm-install..."
-CLANG_PATH="llvm-install/lib/clang/15.0.4/lib/aarch64-linux-ohos/"
-for file in $(find ./${CLANG_PATH} -type f -name "*${SAN_FILTER}*.a*"); do
- echo "$file"
- cp "$file" ~/llvm/out/${CLANG_PATH}
-done
-
-echo "copy to phone..."
-${HDC_CMD} target mount
-
-for file in $(find ./${CLANG_PATH} -type f -name "*${SAN_FILTER}*.so"); do
- md5sum "$file"
- ${HDC_CMD} file send "$file" /system/lib64
- ${HDC_CMD} shell md5sum /system/lib64/"*${SAN_FILTER}*.so"
-done
-
-${HDC_CMD} file send ./llvm-symbolizer /system/bin
-${HDC_CMD} shell chmod +x /system/bin/llvm-symbolizer
-export LLVM_SYMBOLIZER_PATH="/system/bin/llvm-symbolizer"
-
-# filter list for hwasan fails
-if [ "$ENABLE_FILTER" = 1 ] && [ "$SANITIZER" = "hwasan" ]; then
- export LIT_FILTER_OUT="TestCases/Linux/reuse-threads.cpp\
-|TestCases/double-free.c\
-|TestCases/stack-uas.c\
-|TestCases/deep-recursion.c\
-|TestCases/halt-on-error.cpp\
-|TestCases/heap-buffer-overflow-into.c\
-|TestCases/hwasan_symbolize.cpp\
-|TestCases/malloc_bisect.c\
-|TestCases/mem-intrinsics.c\
-|TestCases/print-module-map.c\
-|TestCases/realloc-after-free.c\
-|TestCases/tag_in_free.c\
-|TestCases/uaf_with_rb_distance.c\
-|TestCases/use-after-free.c"
-fi
-
-# change lit timeout
-echo "change lit timeout..."
-find ${LLVM_PROJECT_DIR} -name hdc.py -exec sed -i 's/timeout=[0-9]\+/timeout=60/g' {} \; -print
-
-echo "run $SANITIZER tests..."
-
-ninja check-${SANITIZER} -v -j1
diff --git a/test/local-jenkins/send_email.py b/test/local-jenkins/send_email.py
deleted file mode 100644
index f07735a8735d..000000000000
--- a/test/local-jenkins/send_email.py
+++ /dev/null
@@ -1,87 +0,0 @@
-
-# Copyright (c) 2025 Huawei Device Co., Ltd.
-# 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.
-
-import smtplib
-from email.mime.multipart import MIMEMultipart
-from email.mime.base import MIMEBase
-from email.mime.text import MIMEText
-from email import encoders
-import os
-import sys
-
-# SMTP服务器配置
-smtp_server = 'smtp.x.com'
-smtp_port = 25
-sender_id = 'test'
-sender_email= ''
-sender_password = ''
-receiver_email = ['1@x.com', '2@x.com', '3@x.com', '4@x.com']
-#receiver_email = ['1@x.com']
-# 定义包含文件夹路径的列表
-sanitizers = sys.argv[3:]
-
-# 创建一个MIMEMultipart对象
-message = MIMEMultipart()
-message['From'] = sender_email
-message['To'] = ', '.join(receiver_email)
-message['Subject'] = sys.argv[1]
-
-# 创建表头
-html_table_rows = []
-html_table_rows.append('测试类型 | 测试结果 |
')
-
-# 遍历文件夹列表
-for sanitizer in sanitizers:
- # 构建文件路径
- file_path = os.path.join('./', sanitizer+'.result')
-
- # 检查文件是否存在
- if os.path.exists(file_path):
- # 读取文件内容
- with open(file_path, 'r', encoding='utf-8') as file:
- content = file.read()
-
- # 创建一个表格行,包含测试类型和结果
- html_table_rows.append(f'{sanitizer} | {content.replace(os.linesep, " ")} |
')
-
-# 将所有的表格行组合成一个完整的表格
-html_table = '' + ''.join(html_table_rows) + '
'
-
-# HTML邮件内容
-html_content = f"""
-
-
-
- {sys.argv[2]} |
-
-
-
-"""
-
-# 设置邮件正文
-message.attach(MIMEText(html_content, 'html', 'utf-8'))
-
-# 发送邮件
-try:
- server = smtplib.SMTP(smtp_server, smtp_port)
- server.starttls() # 如果SMTP服务器支持TLS
- server.login(sender_id, sender_password)
- server.sendmail(sender_email, receiver_email, message.as_string())
- print("send result email successfully!")
-except Exception as e:
- print(f"send result email failed: {e}")
-finally:
- server.quit()
diff --git a/test/sanitizer-ggw/build_project.sh b/test/sanitizer-ggw/build_project.sh
deleted file mode 100644
index 85ceb93c1a54..000000000000
--- a/test/sanitizer-ggw/build_project.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#! /bin/bash
-
-# Copyright (c) 2025 Huawei Device Co., Ltd.
-# 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.
-
-echo "llvm-sanitizer:job start..."
-source ${ROOT_DIR}/jenkins-ci/scripts/llvm_helpers.sh
-
-#Environmental preparation
-echo "llvm-sanitizer:Environmental preparation..."
-sudo apt-get update
-sudo apt-get -y install build-essential swig python3-dev libedit-dev libncurses5-dev binutils-dev gcc-multilib abigail-tools
-
-echo "llvm-sanitizer:download_third_party_llvm..."
-check_deps
-prepare_git
-download_third_party_llvm
-
-# update llvm prebuilts
-cd ${ROOT_DIR}
-echo "llvm-sanitizer:env_prepare..."
-./toolchain/llvm-project/llvm-build/env_prepare.sh
-
-# add pr_number
-cd "${ROOT_DIR}/toolchain/llvm-project"
-if [[ -z "${PR_NUMBER}" || "${PR_NUMBER}" =~ ^\s*$ ]]; then
- echo "PR_NUMBER is empty or whitespace, skipping git operations."
-else
- echo "PR_NUMBER = ${PR_NUMBER}"
- wget https://gitee.com/openharmony/third_party_llvm-project/pulls/${PR_NUMBER}.diff
- git apply ${PR_NUMBER}.diff
-fi
-
-# build llvm-project
-echo "llvm-sanitizer:build..."
-python3 ${ROOT_DIR}/toolchain/llvm-project/llvm-build/build.py --no-lto --no-build windows --enable-assertions --no-build-x86_64 --no-build-mipsel --no-build-arm --no-build-riscv64 --no-build windows,lldb-server,check-api
-
-# build compiler-rt
-WORK_DIR=${PWD}
-LLVM_PROJECT_DIR=${ROOT_DIR}/toolchain/llvm-project
-TOOLCHAIN_BIN_PATH=${ROOT_DIR}/out/llvm-install/bin
-
-HOS_TMPDIR="/data/local/tmp"
-SYSROOT=${ROOT_DIR}/out/sysroot
-LLVM_RT_DIR=${WORK_DIR}/llvm-install/lib/clang/15.0.4
-LLVM_CONFIG_PATH="${TOOLCHAIN_BIN_PATH}/llvm-config"
-
-TARGET_TRIPLE="aarch64-linux-ohos"
-EXTRA_FLAGS="-fno-emulated-tls"
-DEVICE_COMPILE_FLAGS="--target=${TARGET_TRIPLE} --sysroot=${SYSROOT} -v ${EXTRA_FLAGS} -O0 -fuse-ld=lld -stdlib=libc++"
-DEVICE_LINKER_FLAGS="-Wl,-rpath,${HOS_TMPDIR},--allow-shlib-undefined -Wl,--unresolved-symbols=ignore-all"
-
-mkdir -p $ROOT_DIR/test-build
-cd $ROOT_DIR/test-build
-
-echo "llvm-sanitizer:cmake config compiler-rt..."
-${ROOT_DIR}/prebuilts/cmake/linux-x86/bin/cmake \
- ${LLVM_PROJECT_DIR}/compiler-rt \
- -G Ninja \
- -DCMAKE_SYSTEM_NAME=OHOS \
- -DOHOS=ON \
- -DCMAKE_AR="${TOOLCHAIN_BIN_PATH}/llvm-ar" \
- -DLLVM_CONFIG_PATH="${LLVM_CONFIG_PATH}" \
- -DCMAKE_ASM_COMPILER_TARGET="${TARGET_TRIPLE}" \
- -DCMAKE_ASM_FLAGS="${DEVICE_COMPILE_FLAGS}" \
- -DCMAKE_C_COMPILER="${TOOLCHAIN_BIN_PATH}/clang" \
- -DCMAKE_C_COMPILER_TARGET="${TARGET_TRIPLE}" \
- -DCMAKE_C_FLAGS="${DEVICE_COMPILE_FLAGS}" \
- -DCMAKE_CXX_COMPILER="${TOOLCHAIN_BIN_PATH}/clang++" \
- -DCMAKE_CXX_COMPILER_TARGET="${TARGET_TRIPLE}" \
- -DCMAKE_CXX_FLAGS="${DEVICE_COMPILE_FLAGS}" \
- -DCMAKE_EXE_LINKER_FLAGS="${DEVICE_COMPILE_FLAGS} ${DEVICE_LINKER_FLAGS}" \
- -DCOMPILER_RT_BUILD_BUILTINS=OFF \
- -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
- -DCOMPILER_RT_BUILD_MEMPROF=OFF \
- -DCOMPILER_RT_BUILD_PROFILE=ON \
- -DCOMPILER_RT_BUILD_SANITIZERS=ON \
- -DCOMPILER_RT_BUILD_XRAY=OFF \
- -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \
- -DCOMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF \
- -DCOMPILER_RT_INCLUDE_TESTS="ON" \
- -DCOMPILER_RT_CAN_EXECUTE_TESTS="ON" \
- -DCOMPILER_RT_TEST_COMPILER="${TOOLCHAIN_BIN_PATH}/clang" \
- -DCOMPILER_RT_TEST_COMPILER_CFLAGS="${DEVICE_COMPILE_FLAGS}" \
- -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \
- -DCMAKE_BUILD_TYPE=Release \
- -DCOMPILER_RT_OUTPUT_DIR="${LLVM_RT_DIR}"
-
-echo "llvm-sanitizer:cmake compile compiler-rt..."
-ninja compiler-rt
diff --git a/test/sanitizer-ggw/job_runner.Jenkinsfile b/test/sanitizer-ggw/job_runner.Jenkinsfile
deleted file mode 100644
index bce9f34fe933..000000000000
--- a/test/sanitizer-ggw/job_runner.Jenkinsfile
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Copyright (c) 2024 Huawei Device Co., Ltd.
- * 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.
- */
-
-String libBranchName = params?.ark_ci_revision ?: 'master'
-def lib = library("llvm_ci_helpers@${libBranchName}").com.x.rnd.devops
-def jobFilter = lib.JobFilter.of('dummy') { }
-def stageStatus = lib.StagesStatus.new()
-
-// Init helpers
-helpers.initDepTree()
-helpers.initRepoManifest()
-helpers.initRunParams()
-
-env.REPO_TYPE = 'repo_emui'
-
-def errorException = 'none'
-String ciStatus = 'passed'
-
-env.PIPELINE_NAME = 'LLVM_ASAN'
-withFolderProperties {
- env.MAX_STAGE_TIMEOUT = env.PRE_MERGE_ARKJS_MAX_STAGE_TIMEOT?.toInteger() ?: 240
- env.DEFAULT_PAYLOAD_TIMEOUT = env.PRE_MERGE_ARKJS_PAYLOAD_TIMEOUT?.toInteger() ?: 220
- env.DEFAULT_RETRIES_IN_STRICT_MODE = env.PRE_MERGE_ARKJS_DEFAULT_RETRIES_IN_STRICT_MODE?.toInteger() ?: 1
-}
-
-// Init stage
-pipeStages.runPreMergeInitStage()
-
-//We define default image here but we need to change it for each job
-String image = helpers.getImage()
-Map cloud = ['cloud' : 'helium-cloud', 'template' : ['panda-1cpu-proxy', 'panda-1cpu'], 'image' : image]
-int timeout = env.DEFAULT_STAGE_TIMEOUT.toInteger()
-Map props = ['retries': 1, 'timeout': timeout]
-
-void runStage(String name, List configFiles, Map cloud, stageStatus, List filters = []) {
- stage(name) {
- if (helpers.runParams.isShuttle()) {
- // Clear the shuttle archive name for the second stage because them should use re-packed tar-ball
- // with ark standalone changes after the first stage' job
- helpers.repoManifest.archiveName = ''
- }
- List configs = configFiles.collect { c -> libraryResource(c) }
- buildParallelMap = helpers.prepareParallelStage(cloud, configs, stageStatus, [:], filters)
- buildParallelMap.put('failFast', env.RTM?.toBoolean())
- parallel(buildParallelMap)
- }
-}
-
-try {
- // Need to clone repos before checking if the pipe is required
-// if (!helpers.runParams.isShuttle()) {
- pipeStages.runInitRevisionStage(cloud, props, stageStatus)
-// }
-
- List configs = []
-
- List filters = []
-// List filters = jobFilters.filters(libraryResource('job_filters.yml'))
-/* stage('Get sources standalone') {
- configs = [libraryResource('arkjsvm/get_sources_standalone.yml')]
- Map buildParallelMap = helpers.prepareParallelStage(cloud, configs, stageStatus, [:], filters)
- buildParallelMap.put('failFast', env.RTM?.toBoolean())
- parallel(buildParallelMap)
- }
-*/
- buildConfigs = ['llvm_asan_device.yml']
- runStage('Build', buildConfigs, cloud, stageStatus, filters)
-
-// runStage('Test', arkjsHelpers.testStageConfigFiles(), cloud, stageStatus, filters)
-} catch (ex) {
- ciStatus = 'failed'
- errorException = ex
-}
-
-if (helpers.wasPipelineCanceled(errorException)) {
- ciStatus = 'cancelled'
-}
-
-pipeStages.runSendResultStage(ciStatus)
-
-helpers.processCiStatus(ciStatus, errorException)
diff --git a/test/sanitizer-ggw/job_wrapper.groovy b/test/sanitizer-ggw/job_wrapper.groovy
deleted file mode 100644
index b4a6971eea76..000000000000
--- a/test/sanitizer-ggw/job_wrapper.groovy
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
- * 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.
- */
-
-import java.time.LocalDateTime
-import groovy.json.JsonOutput
-import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
-import net.sf.json.JSONObject
-
-
-void withOhosDevice(Map params=[:], Closure body) {
- final int ERROR_FAIL_CONNECT_DEVICE = 111
- String rootDir = getSrcDir()
- if (!params.target_group) {
- error('[PND] Target_group should be passed!')
- }
- String targetGroup = params['target_group']
- String deviceSerial = params['DEVICE_SERIAL'] ?: env.LOCK_RESOURCE
- echo "Use Jenkins lock for manage devices. Selected device: ${deviceSerial}"
- List envOptions = []
- envOptions.addAll(["ROOT_DIR=${rootDir}"])
- withEnv(envOptions) {
- def result = sh(returnStatus: true,
- label: 'book OHOS device and get connection string',
- script: """
- ${rootDir}/jenkins-ci/scripts/connect_hdc_device.sh -v \
- --serial ${deviceSerial} \
- --target-group ${targetGroup}
- """)
-
- if (result != 0) {
- if (result == ERROR_FAIL_CONNECT_DEVICE) {
- String userToLock = 'OHOS_DEVICE_ERROR'
- String noteText = 'Device was removed from CI'
- // Reserve locked resource
- deviceCleanup.reserveDevice(deviceSerial, userToLock, noteText)
- String msgTitle = "Device ${deviceSerial} was removed from CI"
- String msgRecipients = ''
- withFolderProperties {
- msgRecipients = ggApi.getEventSubscribers('device_reservation', 'huawei_id').join(',')
- }
- String issueId = ''
- try {
- issueId = createFailDeviceIssue(deviceSerial, targetGroup)
- if (issueId) {
- String issueUrl = 'https://rnd-gitlab-msc.x.com/rus-os-team/devops/public/-/issues/'
- issueId = issueUrl + issueId
- echo "Connect device failure issue was created \n${issueId}"
- }
- } catch (ex) {
- echo "Error while creating a fail device issue - ${deviceSerial}\n${ex}"
- }
- String msgBody = """OHOS Device ${deviceSerial} with group ${targetGroup}
- |couldn't be connected and was removed from CI\n${issueId ?: ''}""".stripMargin()
- try {
- sendNotification(msgTitle, msgBody, msgRecipients)
- } catch (ex) {
- echo "Error sending notification ${msgTitle}"
- }
- }
-
- if (env.RETRY_ON_DEVICE_FAILURE) {
- echo '[PND] Error: Connect Device failed'
- throw new IOException('[PND] Error: Connect Device failed')
- } else {
- error('[PND] Error: Connect Device failed')
- }
- }
- }
- String varFile = "${rootDir}/connect_hdc_device.vars"
- envOptions.addAll(fileExists(varFile) ? readFile(varFile).split('\n') as List : [])
- withEnv(envOptions) {
- try {
- body.call()
- ohosDeviceCleanup(deviceSerial, targetGroup)
- } catch (ex) {
- LocalDateTime datetimeTag = LocalDateTime.now()
- echo "Final usage time for ${deviceSerial}: ${datetimeTag}"
- error("[PND] Error:\n ${ex}")
- } finally {
- // release the device on the farm
- sh "hdc-farm -v release --serial ${deviceSerial} || true"
- }
- }
-}
-
-void buildLLVMAndRunSanitizerTest(stageParams) {
- response = ggApi.getRunParams(helpers.runParams.ggRunId)
- def slurper = new groovy.json.JsonSlurper()
- def result = slurper.parseText(response)
- BZ_LLVM_PROJECT_USER_URL = result.origins[0]
-
- string pr_number = result.prs[0].split('/')[1]
- String rootDir = getSrcDir()
- String artifactsDir = "${rootDir}/artifacts"
- Integer flowNodeId = flowNode.getId().toInteger()
- String targetGroup = "${env.DEVICE_SOURCE_GROUP}_${env.DEVICE_TARGET_GROUP}_${currentBuild.number}_${flowNodeId}"
- Map connectParams = ['target_group': targetGroup]
-
- withOhosDevice(connectParams) {
- List envOptions = []
- for (p in stageParams.keySet()) {
- envOptions.add("${p}=${fillPlaceholders(stageParams[p].toString())}")
- }
- envOptions.addAll(["ROOT_DIR=${rootDir}", "PR_NUMBER=${pr_number}", "ARTIFACTS_DIR=${artifactsDir}"])
- withEnv(envOptions) {
- try {
- // download and build
- helpers.timeout_sh(stageParams,
- "${rootDir}/jenkins-ci/scripts/build_project.sh")
- // run tests
- helpers.timeout_sh(stageParams,
- "${rootDir}/jenkins-ci/scripts/test_project.sh")
- } catch (ex) {
- error("${ex}")
- /*} finally {
- zipFolders = stageParams.ZIP_FOLDERS ?: ['core*']
- if (!zipFolders.isEmpty()) {
- helpers.archive("${stageParams.ARTIFACT_NAME}", rootDir, zipFolders, 'publish')
- } */
- }
- }
- }
-}
diff --git a/test/sanitizer-ggw/test_project.sh b/test/sanitizer-ggw/test_project.sh
deleted file mode 100644
index 8af01e23ea23..000000000000
--- a/test/sanitizer-ggw/test_project.sh
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /bin/bash
-
-# Copyright (c) 2025 Huawei Device Co., Ltd.
-# 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.
-
-cd $ROOT_DIR/test-build
-
-# replace unstripped hdc for coredump to debug segv issue
-rm -f /opt/ohos-sdk/toolchains/hdc
-curl https://nexus-cn-yz.devops-spb.rnd.x.com/repository/devops-binaries/hdc.unstripped.x86_64 -o /opt/ohos-sdk/toolchains/hdc
-chmod a+x /opt/ohos-sdk/toolchains/hdc
-ulimit -c 100000000
-
-# prepare hdc env
-HDC_SERVER_IP_PORT="${HDC_OPTS#*-s }"
-export HDC="hdc"
-export HDC_SERVER_IP_PORT="${HDC_SERVER_IP_PORT%% -t*}"
-export HDC_UTID="${HDC_OPTS#*-t }"
-echo $HDC_SERVER_IP_PORT $HDC_UTID $HDC_OPTS
-
-hdc ${HDC_OPTS} file send ${ROOT_DIR}/llvm-symbolizer /system/bin
-hdc ${HDC_OPTS} shell chmod +x /system/bin/llvm-symbolizer
-
-export PYTHONUNBUFFERED=1
-export PHONE_SYMBOLIZER_PATH="/system/bin/llvm-symbolizer"
-export LLVM_SYMBOLIZER_PATH="/system/bin/llvm-symbolizer"
-export HWASAN_SYMBOLIZER_PATH="/system/bin/llvm-symbolizer"
-
-echo "llvm-sanitizer:copy to llvm-install..."
-CLANG_PATH="llvm-install/lib/clang/15.0.4/lib/aarch64-linux-ohos/"
-for file in $(find $ROOT_DIR/test-build/${CLANG_PATH} -type f -name "*.a*"); do
- echo "$file"
- cp "$file" ${ROOT_DIR}/out/${CLANG_PATH}
-done
-
-echo "llvm-sanitizer:copy to phone..."
-hdc ${HDC_OPTS} target mount
-
-for file in $(find $ROOT_DIR/test-build/out/${CLANG_PATH} -type f -name "*.so"); do
- echo "$file"
- hdc ${HDC_OPTS} file send "$file" /system/lib64
-done
-
-# change lit timeout
-echo "llvm-sanitizer:change lit timeout..."
-find ${ROOT_DIR}/toolchain/llvm-project/compiler-rt/test -name hdc.py -exec sed -i 's/timeout=[0-9]\+/timeout=60/g' {} \; -print
-
-set +e
-# run TESTS
-for TEST in "cfi" "gwp_asan" "hwasan" "asan" "ubsan" "tsan"; do
- ninja check-$TEST -v || true
- [[ -f core ]] && mv core core.$TEST
-done
-set -e
-
-# # libomp prepare
-# DEVICE_COMPILE_FLAGS="--target=aarch64-linux-ohos --sysroot=${ROOT_DIR}/out/sysroot -v -fstack-protector-strong -ffunction-sections -fdata-sections -D__MUSL__"
-# TARGET_TRIPLE="aarch64-linux-ohos"
-# TOOLCHAIN_BIN_PATH="${ROOT_DIR}/out/llvm-install/bin"
-# CMAKE_BIN_PATH="${ROOT_DIR}/prebuilts/cmake/linux-x86/bin"
-# CMAKE_SOURCE_PATH="${ROOT_DIR}/toolchain/llvm-project/openmp"
-# CMAKE_TARGET_PATH="${ROOT_DIR}/toolchain/omp_test/test"
-# OMP_LIB_PATH="${ROOT_DIR}/out/llvm-install/lib/aarch64-linux-ohos/libomp.so"
-
-# mkdir -p "$CMAKE_TARGET_PATH"
-
-# ${CMAKE_BIN_PATH}/cmake -G Ninja ${CMAKE_SOURCE_PATH}/ \
-# -B ${CMAKE_TARGET_PATH} \
-# -DCMAKE_SYSTEM_NAME=OHOS \
-# -DOHOS=ON \
-# -DCMAKE_AR="${TOOLCHAIN_BIN_PATH}/llvm-ar" \
-# -DCMAKE_C_COMPILER="${TOOLCHAIN_BIN_PATH}/clang" \
-# -DOPENMP_ENABLE_LIBOMPTARGET="FALSE" \
-# -DCMAKE_CXX_COMPILER="${TOOLCHAIN_BIN_PATH}/clang++" \
-# -DLLVM_TARGETS_TO_BUILD=AArch64 \
-# -DOPENMP_LLVM_TOOLS_DIR="${ROOT_DIR}/out/llvm_make/bin" \
-# -DOPENMP_LLVM_LIT_EXECUTABLE="${ROOT_DIR}/out/llvm_make/bin/llvm-lit" \
-# -DCMAKE_C_COMPILER_TARGET="aarch64-linux-ohos" \
-# -DCMAKE_CXX_COMPILER_TARGET="aarch64-linux-ohos" \
-# -DCMAKE_CXX_FLAGS="${DEVICE_COMPILE_FLAGS}" \
-# -DCMAKE_C_FLAGS="${DEVICE_COMPILE_FLAGS}" \
-# -DCMAKE_EXE_LINKER_FLAGS="${DEVICE_LINKER_FLAGS}" \
-# -DCMAKE_ASM_FLAGS="${DEVICE_COMPILE_FLAGS}" \
-# -DCMAKE_ASM_COMPILER_TARGET="${TARGET_TRIPLE}" \
-# -DCMAKE_BUILD_TYPE=Release
-
-# export LIB_PATH_ON_TARGET="/data/local/temp/lib"
-# export OPENMP_STATIC_TEST="True"
-
-# export LIT_FILTER_OUT="libarcher/*"
-
-# # Push libomp.so to device
-# hdc ${HDC_OPTS} shell mkdir $LIB_PATH_ON_TARGET/
-# hdc ${HDC_OPTS} file send ${OMP_LIB_PATH} $LIB_PATH_ON_TARGET/
-
-# # Run libomp test
-# LOG_DATE=$(date +%Y%m%d_%H%M%S)
-# cd ${CMAKE_TARGET_PATH}
-# ninja check-openmp | tee ${CMAKE_TARGET_PATH}/../ohos-check-openmp${LOG_DATE}.log
\ No newline at end of file
--
Gitee