From 2a1c1558d38a5a642dc78d731f1992caa26eb85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Fri, 26 Jul 2024 10:06:15 +0200 Subject: [PATCH] Add shellcheck and a custom linter for `test` field --- .pre-commit-config.yaml | 22 +++++++++++ custom-lint-checks.sh | 37 +++++++++++++++++++ .../bugs/AVX-512-support-in-binutils/test.sh | 2 +- .../test.sh | 8 ++-- .../test.sh | 2 +- .../main.fmf | 5 +++ .../Disable-separate-code-for-aarch64/test.sh | 4 +- .../main.fmf | 2 +- .../test.sh | 10 ++--- .../test.sh | 2 +- .../binutils-contains-empty-man-pages/test.sh | 2 +- .../test.sh | 2 +- .../eu-unstrip-do-not-seem-to-match/test.sh | 8 ++-- .../test.sh | 2 +- .../repro.sh | 2 +- tests/bugs/ppc64-segv-in-libbfd/test.sh | 4 +- tests/lib.sh | 14 +++---- tests/main.fmf | 6 +-- tests/rebuilds/kernel/test.sh | 6 +-- tests/supported-targets/test.sh | 4 +- tests/testsuite/interesting-cases.sh | 8 ++-- tests/testsuite/test.sh | 22 +++++++---- 22 files changed, 122 insertions(+), 52 deletions(-) create mode 100755 custom-lint-checks.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 520f622..45a70af 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,3 +34,25 @@ repos: rev: "1.26.0" hooks: - id: tmt-lint + +# - repo: https://github.com/koalaman/shellcheck-precommit +# rev: v0.7.2 +# hooks: +# - id: shellcheck +# args: ["--severity=warning"] # Optionally only show errors and warnings + + - repo: local + hooks: + - id: shellcheck + name: shellcheck + description: Test shell scripts with shellcheck + entry: shellcheck + language: python + types: [shell] + require_serial: true # shellcheck can detect sourcing this way + + - id: custom-lint-checks + name: custom-lint-checks + entry: custom-lint-checks.sh + language: script + pass_filenames: false diff --git a/custom-lint-checks.sh b/custom-lint-checks.sh new file mode 100755 index 0000000..760ad15 --- /dev/null +++ b/custom-lint-checks.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +RETVAL=0 + +DELIMITER='==============================================================================' + +echo -e "\n${DELIMITER}\nChecking WITH_SCL in tests' main.fmf\n" + +# shellcheck disable=SC2044 +for i in $(find . -name main.fmf); do + [ "$i" = "./tests/dts-probe-binaries/main.fmf" ] && continue + + if grep -q '^test:.*test\.sh' "$i"; then + # shellcheck disable=SC2016 + if ! grep -qF 'test: "$WITH_SCL ./test.sh"' "$i"; then + echo "$i does not use WITH_SCL in 'test:'" + RETVAL=1 + fi + fi +done +echo "$DELIMITER" + +echo -e "\n${DELIMITER}\nChecking for '!=' and ',' used together\n" + +# shellcheck disable=SC2044 +for i in $(find . -name '*.fmf' -type f); do + if grep -qE 'when:.*!=\s*[a-z0-9_]+,' "$i"; then + echo "$i uses '!=' and ',' together in 'when:'" + grep -E 'when:.*!=\s*[a-z0-9_]+,' "$i" + RETVAL=1 + fi +done +echo "$DELIMITER" + +echo -en "\nOVERALL RESULT: " +[[ "$RETVAL" -eq 0 ]] && echo PASS || echo FAIL +exit $RETVAL diff --git a/tests/bugs/AVX-512-support-in-binutils/test.sh b/tests/bugs/AVX-512-support-in-binutils/test.sh index b9dfa43..19807b7 100755 --- a/tests/bugs/AVX-512-support-in-binutils/test.sh +++ b/tests/bugs/AVX-512-support-in-binutils/test.sh @@ -43,7 +43,7 @@ rlJournalStart rlAssertExists "tst-auditmod10a.o" rlRun "objdump -d tst-auditmod10a.o > tst-auditmod10a.disas" rlLog "Interesting instructions:" - rlLog "$(cat tst-auditmod10a.disas | grep zmm)" + rlLog "$(grep zmm tst-auditmod10a.disas)" rlAssertGrep "vmovdqa64" tst-auditmod10a.disas rlAssertGrep "vpbroadcastq" tst-auditmod10a.disas rlAssertGrep "vpxord" tst-auditmod10a.disas diff --git a/tests/bugs/Add-.debug_pubtypes-and-.debug_ranges-to-builtin-ld-linker-script/test.sh b/tests/bugs/Add-.debug_pubtypes-and-.debug_ranges-to-builtin-ld-linker-script/test.sh index 3071505..99c8fdc 100755 --- a/tests/bugs/Add-.debug_pubtypes-and-.debug_ranges-to-builtin-ld-linker-script/test.sh +++ b/tests/bugs/Add-.debug_pubtypes-and-.debug_ranges-to-builtin-ld-linker-script/test.sh @@ -47,12 +47,12 @@ rlJournalStart rlLogInfo 'x.o + y.o:' rlRun "readelf -WS [xy].o" rlRun "readelf -WS x" - rlLogInfo "$( readelf -WS [xy].o | grep $SECTION_NAME | grep PROGBITS )" + rlLogInfo "$( readelf -WS [xy].o | grep "$SECTION_NAME" | grep PROGBITS )" rlLogInfo 'x:' - rlLogInfo "$( readelf -WS x | grep $SECTION_NAME )" + rlLogInfo "$( readelf -WS x | grep "$SECTION_NAME" )" - if [ $( readelf -WS [xy].o | grep $SECTION_NAME | grep PROGBITS | wc -l ) -eq 2 ] \ - && [ $( readelf -WS x | grep $SECTION_NAME | wc -l ) -eq 1 ]; then + if [ "$( readelf -WS [xy].o | grep "$SECTION_NAME" | grep -c PROGBITS )" -eq 2 ] \ + && [ "$( readelf -WS x | grep -c "$SECTION_NAME" )" -eq 1 ]; then rlPass "Debug ranges sections were merged" else rlFail "Debug ranges sections were not merged" diff --git a/tests/bugs/Bogus-warning-about-cross-object-references-to/test.sh b/tests/bugs/Bogus-warning-about-cross-object-references-to/test.sh index 526167f..f76296a 100755 --- a/tests/bugs/Bogus-warning-about-cross-object-references-to/test.sh +++ b/tests/bugs/Bogus-warning-about-cross-object-references-to/test.sh @@ -46,7 +46,7 @@ rlJournalStart rlPhaseStartTest rlRun "gcc v.c -fPIC -shared -olibv.so" rlRun "gcc u.c -fPIC -shared -olibu.so" - rlRun "gcc t.c -D_GNU_SOURCE -L. -lu -lv -ldl -Wl,-rpath,`pwd` &> out" + rlRun "gcc t.c -D_GNU_SOURCE -L. -lu -lv -ldl -Wl,-rpath,$(pwd) &> out" rlLogInfo "$(cat out)" rlAssertNotGrep "warning: hidden symbol .* is referenced" out rlRun "./a.out" diff --git a/tests/bugs/Disable-separate-code-for-aarch64/main.fmf b/tests/bugs/Disable-separate-code-for-aarch64/main.fmf index d4a4d7e..4569acf 100644 --- a/tests/bugs/Disable-separate-code-for-aarch64/main.fmf +++ b/tests/bugs/Disable-separate-code-for-aarch64/main.fmf @@ -4,3 +4,8 @@ duration: 10m link+: - verifies: https://issues.redhat.com/browse/RHEL-42954 + +adjust+: + - when: arch != aarch64 + because: Test is relevant for aarch64 only + enabled: false diff --git a/tests/bugs/Disable-separate-code-for-aarch64/test.sh b/tests/bugs/Disable-separate-code-for-aarch64/test.sh index dfa1578..1e24ed9 100755 --- a/tests/bugs/Disable-separate-code-for-aarch64/test.sh +++ b/tests/bugs/Disable-separate-code-for-aarch64/test.sh @@ -17,11 +17,11 @@ rlJournalStart rlRun "gcc -O0 -o reproducer reproducer.c" rlRun "readelf -lW ./reproducer |& tee output" - rlAssertEquals "only two LOAD sections are expected" "$(grep "LOAD" output | wc -l)" "2" + rlAssertEquals "only two LOAD sections are expected" "$(grep -c "LOAD" output)" "2" rlRun "gcc -O0 -o reproducer -Wl,-z,separate-code reproducer.c" rlRun "readelf -lW ./reproducer |& tee output" - rlAssertEquals "four LOAD sections are expected" "$(grep "LOAD" output | wc -l)" "4" + rlAssertEquals "four LOAD sections are expected" "$(grep -c "LOAD" output)" "4" rlPhaseEnd rlPhaseStartCleanup diff --git a/tests/bugs/ELFv2-localentry-not-supported-by-RHEL7-1-LE/main.fmf b/tests/bugs/ELFv2-localentry-not-supported-by-RHEL7-1-LE/main.fmf index 77dd522..dd34400 100644 --- a/tests/bugs/ELFv2-localentry-not-supported-by-RHEL7-1-LE/main.fmf +++ b/tests/bugs/ELFv2-localentry-not-supported-by-RHEL7-1-LE/main.fmf @@ -6,5 +6,5 @@ link+: duration: 15m adjust+: - - when: arch != ppc64le,ppc64 + - when: arch != ppc64le and arch != ppc64 enabled: false diff --git a/tests/bugs/SystemTap-affected-by-stapsdt-base-1/test.sh b/tests/bugs/SystemTap-affected-by-stapsdt-base-1/test.sh index dae48f7..da389b8 100755 --- a/tests/bugs/SystemTap-affected-by-stapsdt-base-1/test.sh +++ b/tests/bugs/SystemTap-affected-by-stapsdt-base-1/test.sh @@ -40,13 +40,13 @@ rlJournalStart rlPhaseEnd for ld in $( ls {/emul/ia32-linux,}/lib*/ld-2* 2> /dev/null); do - rlPhaseStartTest "${ld} from $( rpmquery -f ${ld} )" - filename="$( basename ${ld} ).readline" - rlRun "readelf -S ${ld} > $filename" 0 "[$( basename ${ld} )] Write section headers of ${ld}" + rlPhaseStartTest "$ld from $( rpmquery -f "$ld" )" + filename="$( basename "$ld" ).readline" + rlRun "readelf -S $ld > $filename" 0 "[$( basename "$ld" )] Write section headers of $ld" if ! [[ "$( rlGetArch )" == "ia64" && ! "${ld}" =~ "emul" ]]; then - rlAssertGrep ".stapsdt.base " $filename || rlLogError "This may be problem for SystemTap" + rlAssertGrep ".stapsdt.base " "$filename" || rlLogError "This may be problem for SystemTap" fi - rlAssertNotGrep ".stapsdt.base.1" $filename || rlLogError "This may be problem for SystemTap" + rlAssertNotGrep ".stapsdt.base.1" "$filename" || rlLogError "This may be problem for SystemTap" rlPhaseEnd done diff --git a/tests/bugs/The-binutils-package-contains-the-windmc-1-manual/test.sh b/tests/bugs/The-binutils-package-contains-the-windmc-1-manual/test.sh index 0db8a85..5cc453d 100755 --- a/tests/bugs/The-binutils-package-contains-the-windmc-1-manual/test.sh +++ b/tests/bugs/The-binutils-package-contains-the-windmc-1-manual/test.sh @@ -40,7 +40,7 @@ rlJournalStart rlPhaseStartTest rlRun "rpm -ql $PACKAGES | grep windmc > windmc.txt" 0,1 rlLogInfo "$(cat windmc.txt)" - rlRun "FILE_CNT=`cat windmc.txt | wc -l`" + rlRun "FILE_CNT=$(wc -l windmc.txt)" if [ "$FILE_CNT" == "1" ]; then rlFail "Either windmg manpage or binary is present - both options are wrong." elif [ "$FILE_CNT" == "2" ]; then diff --git a/tests/bugs/binutils-contains-empty-man-pages/test.sh b/tests/bugs/binutils-contains-empty-man-pages/test.sh index 9c319cb..167f731 100755 --- a/tests/bugs/binutils-contains-empty-man-pages/test.sh +++ b/tests/bugs/binutils-contains-empty-man-pages/test.sh @@ -36,7 +36,7 @@ rlJournalStart rlPhaseEnd rlPhaseStartTest - rpm -qd $PACKAGES | grep 'man' | while read -r m; do + rpm -qd "$PACKAGES" | grep 'man' | while read -r m; do rlLog "$m" man "$m" | col -b > man.txt rlRun "[[ $(wc -c out + local_binary="$(basename "$EABI_file")" + rlAssertExists "$local_binary" + rlRun "strip -R .comment $local_binary" + file "$local_binary" > out rlAssertNotGrep "(SYSV)" out else rlDie "There's nothing to test." diff --git a/tests/bugs/ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/test.sh b/tests/bugs/ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/test.sh index 7b23a81..07d8825 100755 --- a/tests/bugs/ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/test.sh +++ b/tests/bugs/ld-from-devtoolset-copies-SONAME-to-DT-NEEDED/test.sh @@ -47,7 +47,7 @@ rlJournalStart rlLogInfo "$(cat out)" rlAssertGrep "SONAME must not be empty string; ignored" out rlRun "objdump -p libfoo.so | grep SONAME | awk '{print \$2}' > soname" - if [ "`stat -c '%s' soname`" != "0" ]; then + if [ "$(stat -c '%s' soname)" != "0" ]; then rlLogInfo "SONAME='$(cat soname)'" rlFail "Detected SONAME is empty" fi diff --git a/tests/bugs/objcopy-doesnt-align-sections-with-section-alignment-set-section-alignment/repro.sh b/tests/bugs/objcopy-doesnt-align-sections-with-section-alignment-set-section-alignment/repro.sh index 0c8efd2..20ade25 100755 --- a/tests/bugs/objcopy-doesnt-align-sections-with-section-alignment-set-section-alignment/repro.sh +++ b/tests/bugs/objcopy-doesnt-align-sections-with-section-alignment-set-section-alignment/repro.sh @@ -10,6 +10,6 @@ while read -r line; do echo "Section $section alignment is not multiple of 512" exit 1 fi -done < <(pe-inspect $1 | grep --text "section") +done < <(pe-inspect "$1" | grep --text "section") echo "All OK" diff --git a/tests/bugs/ppc64-segv-in-libbfd/test.sh b/tests/bugs/ppc64-segv-in-libbfd/test.sh index 93047e6..16731fd 100755 --- a/tests/bugs/ppc64-segv-in-libbfd/test.sh +++ b/tests/bugs/ppc64-segv-in-libbfd/test.sh @@ -35,11 +35,11 @@ __have_kernel_debuginfo () { local RELEASE ARCH rlRun "RELEASE=$(uname -r)" rlRun "ARCH=$(uname -m)" - if ! rpm -q kernel-debuginfo-$RELEASE &>/dev/null; then + if ! rpm -q "kernel-debuginfo-$RELEASE" &>/dev/null; then rlLogInfo 'kernel-debuginfo not present, trying to install it' rlRun "dnf install -y --enablerepo=\*debuginfo kernel-debuginfo-$RELEASE" fi - rlAssertRpm kernel-debuginfo-$RELEASE + rlAssertRpm "kernel-debuginfo-$RELEASE" } rlJournalStart diff --git a/tests/lib.sh b/tests/lib.sh index 30e15bd..f71eb97 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -71,9 +71,9 @@ function buTestHeader () { function buEnterTmpDir () { - rlRun "export TmpDir=$(mktemp -d -p $BU_TMPDIR_PARENT)" 0 "Creating tmp directory" + rlRun "export TmpDir=$(mktemp -d -p "$BU_TMPDIR_PARENT")" 0 "Creating tmp directory" - if [ ! -z "$BU_AS_TEST_USER" ]; then + if [ -n "$BU_AS_TEST_USER" ]; then username="${1:-$BU_TEST_USER}" buEnterTestUser "$username" @@ -92,7 +92,7 @@ function buExitTmpDir () { rlRun "rm -r $TmpDir" 0 "Removing tmp directory" fi - if [ ! -z "$BU_AS_TEST_USER" ]; then + if [ -n "$BU_AS_TEST_USER" ]; then username="${1:-$BU_TEST_USER}" buExitTestUser "$username" @@ -106,18 +106,18 @@ function buPrepareSRPM () { rlFetchSrcForInstalled "$installed_rpm" - rlRun "export SRPM=`find . -name '*.src.rpm'`" + rlRun "export SRPM=$(find . -name '*.src.rpm')" rlRun "rpm -ivh --define=\"_topdir $TmpDir\" $SRPM" - rlRun "export SPECDIR=`rpm --define=\"_topdir $TmpDir\" --eval=%_specdir`" - rlRun "export SPECFILE=`find $SPECDIR/ -name '*.spec'`" + rlRun "export SPECDIR=$(rpm --define=\"_topdir $TmpDir\" --eval=%_specdir)" + rlRun "export SPECFILE=$(find "$SPECDIR/" -name '*.spec')" rlRun "yum-builddep -y --define=\"_topdir $TmpDir\" $builddep_options $SPECFILE" } function buBuildSRPM () { - if [ ! -z "$BU_AS_TEST_USER" ]; then + if [ -n "$BU_AS_TEST_USER" ]; then username="${1:-$BU_TEST_USER}" rlRun "su - $username -c 'rpmbuild -bc --define=\"_topdir $TmpDir\" $SPECFILE'" diff --git a/tests/main.fmf b/tests/main.fmf index 01baa7f..45dc007 100644 --- a/tests/main.fmf +++ b/tests/main.fmf @@ -130,7 +130,7 @@ adjust+: # yamllint disable-line rule:line-length COLLECTION_PACKAGES: gcc-toolset-13-binutils gcc-toolset-13-binutils-devel gcc-toolset-13-binutils-gold gcc-toolset-13-binutils-gprofng - - when: distro == rhel-9 and collection == gcc-toolset-13 and arch != x86_64,aarch64 + - when: distro == rhel-9 and collection == gcc-toolset-13 and arch != x86_64 and arch != aarch64 require+: - gcc-toolset-13-binutils - gcc-toolset-13-binutils-devel @@ -203,7 +203,7 @@ adjust+: # yamllint disable-line rule:line-length COLLECTION_PACKAGES: gcc-toolset-13-binutils gcc-toolset-13-binutils-devel gcc-toolset-13-binutils-gold gcc-toolset-13-binutils-gprofng - - when: distro == rhel-8 and collection == gcc-toolset-13 and arch != x86_64,aarch64 + - when: distro == rhel-8 and collection == gcc-toolset-13 and arch != x86_64 and arch != aarch64 require+: - gcc-toolset-13-binutils - gcc-toolset-13-binutils-devel @@ -369,7 +369,7 @@ adjust+: GCC_PACKAGE: gcc-toolset-13-gcc COLLECTION_PACKAGES: gcc-toolset-13-binutils gcc-toolset-13-binutils-devel gcc-toolset-13-binutils-gold - - when: distro == centos-stream-8 and collection == gcc-toolset-13 and arch != x86_64,aarch64 + - when: distro == centos-stream-8 and collection == gcc-toolset-13 and arch != x86_64 and arch != aarch64 require+: - gcc-toolset-13-binutils - gcc-toolset-13-binutils-devel diff --git a/tests/rebuilds/kernel/test.sh b/tests/rebuilds/kernel/test.sh index 63d8a47..d9693c0 100755 --- a/tests/rebuilds/kernel/test.sh +++ b/tests/rebuilds/kernel/test.sh @@ -89,7 +89,7 @@ rlJournalStart rlLogInfo "REBOOTCOUNT=$REBOOTCOUNT" rlLogInfo "RPM_BUILD_ID=$RPM_BUILD_ID" - rlRun "GCC=$(rpm -ql $GCC_PACKAGE | grep -E 'usr/bin/gcc$')" + rlRun "GCC=$(rpm -ql "$GCC_PACKAGE" | grep -E 'usr/bin/gcc$')" rlLogInfo "GCC=$GCC" rlRun "AFTER_REBOOT=no" @@ -125,7 +125,7 @@ rlJournalStart rlRun "sed -i \"s/# define buildid .local/%define buildid $RPM_BUILD_ID/\" $SPECFILE" fi - if [ "`rlGetPrimaryArch`" == "ppc64" ]; then + if [ "$(rlGetPrimaryArch)" == "ppc64" ]; then TARGET="--target=ppc64" else TARGET="--target=$(uname -m)" @@ -158,7 +158,7 @@ rlJournalStart if [ "$(arch)" = "s390x" ]; then rlRun "grubby --info=ALL" rlLogInfo "Default kernel is $(grubby --default-kernel), index $(grubby --default-index)" - rlRun "KERNEL_FILE=$(ls -1 /boot/vmlinuz-*${RPM_BUILD_ID}."$(arch)")" + rlRun "KERNEL_FILE=$(ls -1 "/boot/vmlinuz-*${RPM_BUILD_ID}.$(arch)")" rlRun "ls -al $KERNEL_FILE" rlRun "grubby --set-default $KERNEL_FILE" rlLogInfo "Default kernel is $(grubby --default-kernel), index $(grubby --default-index)" diff --git a/tests/supported-targets/test.sh b/tests/supported-targets/test.sh index f5ca0a3..a5bc224 100755 --- a/tests/supported-targets/test.sh +++ b/tests/supported-targets/test.sh @@ -77,9 +77,9 @@ rlJournalStart rlRun "objdump --help | grep 'supported architectures' | sed 's/objdump: supported architectures: //' | tr ' ' '\n' > actual_arch" rlLog "expected targets:" - rlLog "$(cat $expected_tgt_file)" + rlLog "$(cat "$expected_tgt_file")" rlLog "expected architectures:" - rlLog "$(cat $expected_arch_file)" + rlLog "$(cat "$expected_arch_file")" rlLog "actual targets:" rlLog "$(cat actual_tgt)" rlLog "actual architectures:" diff --git a/tests/testsuite/interesting-cases.sh b/tests/testsuite/interesting-cases.sh index 68d759c..9f7f085 100644 --- a/tests/testsuite/interesting-cases.sh +++ b/tests/testsuite/interesting-cases.sh @@ -79,22 +79,22 @@ function verify_interesting_cases () { "Aarch64: Fix DT_RELR with discarded sections" \ "https://issues.redhat.com/browse/RHEL-42765" - verify_test "ld/section-order-1a" \ + verify_test "Text Section Ordering \(section-order-1a\)" \ "$tool_log" \ "Implement --section-ordering-file in the BFD linker" \ "https://issues.redhat.com/browse/RHEL-36305" - verify_test "ld/section-order-1b" \ + verify_test "Text Section Ordering \(section-order-1b\)" \ "$tool_log" \ "Implement --section-ordering-file in the BFD linker" \ "https://issues.redhat.com/browse/RHEL-36305" - verify_test "ld/section-order-1c" \ + verify_test "Data Section Ordering \(section-order-1c\)" \ "$tool_log" \ "Implement --section-ordering-file in the BFD linker" \ "https://issues.redhat.com/browse/RHEL-36305" - verify_test "ld/section-order-1d" \ + verify_test "Data Section Ordering \(section-order-1d\)" \ "$tool_log" \ "Implement --section-ordering-file in the BFD linker" \ "https://issues.redhat.com/browse/RHEL-36305" diff --git a/tests/testsuite/test.sh b/tests/testsuite/test.sh index e4cd9ee..bdc9272 100755 --- a/tests/testsuite/test.sh +++ b/tests/testsuite/test.sh @@ -37,6 +37,12 @@ rlJournalStart rlPhaseStartSetup buTestHeader + ARCH="$(rlGetPrimaryArch)" + BUILD_ARCHS="$ARCH" + + rlLogInfo "ARCH=$ARCH" + rlLogInfo "BUILD_ARCHS=$BUILD_ARCHS" + buEnterTmpDir rlRun "LOGDIR=$TmpDir/LOGS" @@ -51,19 +57,19 @@ rlJournalStart rlPhaseStartSetup "Rebuild binutils" buBuildSRPM - rlRun "cp $CURRENT_BUILD/binutils/binutils.log $LOGDIR/binutils-$build_arch.log" - rlRun "cp $CURRENT_BUILD/binutils/binutils.sum $LOGDIR/binutils-$build_arch.sum" + rlRun "cp $CURRENT_BUILD/binutils/binutils.log $LOGDIR/binutils-$ARCH.log" + rlRun "cp $CURRENT_BUILD/binutils/binutils.sum $LOGDIR/binutils-$ARCH.sum" - rlRun "cp $CURRENT_BUILD/ld/ld.log $LOGDIR/ld-$build_arch.log" - rlRun "cp $CURRENT_BUILD/ld/ld.sum $LOGDIR/ld-$build_arch.sum" + rlRun "cp $CURRENT_BUILD/ld/ld.log $LOGDIR/ld-$ARCH.log" + rlRun "cp $CURRENT_BUILD/ld/ld.sum $LOGDIR/ld-$ARCH.sum" - rlRun "cp $CURRENT_BUILD/gas/testsuite/gas.log $LOGDIR/gas-$build_arch.log" - rlRun "cp $CURRENT_BUILD/gas/testsuite/gas.sum $LOGDIR/gas-$build_arch.sum" + rlRun "cp $CURRENT_BUILD/gas/testsuite/gas.log $LOGDIR/gas-$ARCH.log" + rlRun "cp $CURRENT_BUILD/gas/testsuite/gas.sum $LOGDIR/gas-$ARCH.sum" rlPhaseEnd for TOOL in binutils ld gas; do - tool_label="$TOOL / $build_arch" - tool_log="$LOGDIR/$TOOL-$build_arch" + tool_label="$TOOL / $ARCH" + tool_log="$LOGDIR/$TOOL-$ARCH" rlPhaseStartTest "$tool_label" rlLogInfo "$tool_label Summary"