summaryrefslogtreecommitdiff
path: root/eclass/tests
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-12-21 06:30:52 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-12-21 06:30:52 +0000
commitd2bcdab82e5f5f38a8ab54026e8aa94edb1b77a6 (patch)
tree0d75edaef0b7c0db490d25119f6b17b386d41c58 /eclass/tests
parent9097a9c06c0b1e11c7f6579f03e3f32948be3f24 (diff)
gentoo auto-resync : 21:12:2024 - 06:30:51
Diffstat (limited to 'eclass/tests')
-rwxr-xr-xeclass/tests/llvm-r1.sh68
1 files changed, 5 insertions, 63 deletions
diff --git a/eclass/tests/llvm-r1.sh b/eclass/tests/llvm-r1.sh
index 892b773a08c9..730b0a6db653 100755
--- a/eclass/tests/llvm-r1.sh
+++ b/eclass/tests/llvm-r1.sh
@@ -63,67 +63,9 @@ test_gen_dep() {
tend ${?}
}
-test_fix_clang_version() {
- local var=${1}
- local tool=${2}
- local version=${3}
- local expected=${4}
-
- eval "${tool}() {
- cat <<-EOF
- clang version ${version}
- Target: x86_64-pc-linux-gnu
- Thread model: posix
- InstalledDir: /usr/lib/llvm/17/bin
- Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
- EOF
- }"
-
- declare -g ${var}=${tool}
- tbegin "llvm_fix_clang_version ${var}=${tool} for ${version}"
- llvm_fix_clang_version "${var}"
- if [[ ${!var} != ${expected} ]]; then
- eerror "llvm_fix_clang_version ${var}"
- eerror " gave: ${!var}"
- eerror "expected: ${expected}"
- fi
- tend ${?}
-}
-
-test_fix_tool_path() {
- local var=${1}
- local tool=${2}
- local expected_subst=${3}
- local expected=${tool}
-
- tbegin "llvm_fix_tool_path ${1}=${2} (from llvm? ${expected_subst})"
-
- local matches=( "${BROOT}"/usr/lib/llvm/*/bin/"${tool}" )
- if [[ ${expected_subst} == 1 ]]; then
- if [[ ! -x ${matches[0]} ]]; then
- ewarn "- skipping, test requires ${tool}"
- return
- fi
-
- expected=${matches[0]}
- local -x PATH=${matches[0]%/*}
- else
- local -x PATH=
- fi
-
- declare -g ${var}=${tool}
- llvm_fix_tool_path "${var}"
- if [[ ${!var} != ${expected} ]]; then
- eerror "llvm_fix_tool_path ${var}"
- eerror " gave: ${!var}"
- eerror "expected: ${expected}"
- fi
- tend ${?}
-}
-
# full range
test_globals '14 15 16 17 18 19' \
- "+llvm_slot_18 llvm_slot_15 llvm_slot_16 llvm_slot_17 llvm_slot_19" \
+ "+llvm_slot_19 llvm_slot_15 llvm_slot_16 llvm_slot_17 llvm_slot_18" \
"^^ ( llvm_slot_15 llvm_slot_16 llvm_slot_17 llvm_slot_18 llvm_slot_19 )" \
"llvm_slot_15(-)?,llvm_slot_16(-)?,llvm_slot_17(-)?,llvm_slot_18(-)?,llvm_slot_19(-)?"
test_globals '14 15 16 17 18' \
@@ -136,10 +78,10 @@ test_globals '14 15 16' \
"^^ ( llvm_slot_15 llvm_slot_16 )" \
"llvm_slot_15(-)?,llvm_slot_16(-)?"
# old + newer than current stable
-test_globals '15 19' \
- "+llvm_slot_15 llvm_slot_19" \
- "^^ ( llvm_slot_15 llvm_slot_19 )" \
- "llvm_slot_15(-)?,llvm_slot_19(-)?"
+test_globals '15 20' \
+ "+llvm_slot_15 llvm_slot_20" \
+ "^^ ( llvm_slot_15 llvm_slot_20 )" \
+ "llvm_slot_15(-)?,llvm_slot_20(-)?"
# newer than current stable
test_globals '19' \
"+llvm_slot_19" \