From d342d3c08b6e461b9f0b3e9c8fd3444b8fd49ecb Mon Sep 17 00:00:00 2001 From: Tulio Magno Quites Machado Filho Date: Wed, 6 Aug 2025 14:37:49 -0300 Subject: [PATCH] abi-test-suite: Add improvements 1. Ensure the required packages are listed. 2. Ignore running this test on RHEL/CentOS because the llvm-test-suite package is not available there. 3. Ignore running this test for compat packages. 4. Remove treatment of parameters from the script because this will always be called from tmt without parameters. 5. Remove temporary directory. --- tests/abi-test-suite/main.fmf | 15 ++++++++++++ tests/abi-test-suite/test.sh | 43 ++++------------------------------- 2 files changed, 20 insertions(+), 38 deletions(-) diff --git a/tests/abi-test-suite/main.fmf b/tests/abi-test-suite/main.fmf index 410207f..aa2eaa5 100644 --- a/tests/abi-test-suite/main.fmf +++ b/tests/abi-test-suite/main.fmf @@ -2,6 +2,21 @@ summary: Run ABI tests from llvm-test-suite package duration: 1h adjust+: + - because: "llvm-test-suite is available for Fedora, not RHEL/CentOS" + when: >- + distro == rhel + or distro == centos + enabled: false + - because: ABI testsuite only supported in x86* enabled: false when: arch != x86_64 + + - because: "llvm test suite not built for compat packages" + enabled: false + when: compat is defined + +require+: + - clang + - llvm-test-suite + - python3 diff --git a/tests/abi-test-suite/test.sh b/tests/abi-test-suite/test.sh index 91785c5..ea2528b 100755 --- a/tests/abi-test-suite/test.sh +++ b/tests/abi-test-suite/test.sh @@ -1,47 +1,14 @@ #!/bin/bash -usage() { - echo "usage `basename $0` [OPTIONS]" - echo " --threads NUM The number of threads to use for running tests." - echo " --testsuite-dir DIR Directory containing the test-suite source." - echo " --compiler [gcc|clang] The compiler to test." -} - testsuite_dir="/usr/share/llvm-test-suite/" compiler="clang" -thread_args="" - -while [ $# -gt 0 ]; do - case $1 in - --threads) - shift - threads="$1" - ;; - --testsuite-dir) - shift - testsuire_dir="$1" - ;; - --compiler) - shift - compiler="$1" - ;; - * ) - echo "unknown option: $1" - echo "" - usage - exit 1 - ;; - esac - shift -done - -if [ -n "$threads" ]; then - thread_args="-j$threads" -fi set -xe -cd $(mktemp -d -p /var/tmp) +tmpdir=$(mktemp -d -p /var/tmp) +pushd "$tmpdir" cp -r $testsuite_dir/ABI-Testsuite . cd ABI-Testsuite -python3 linux-x86.py $compiler test -v $thread_args +python3 linux-x86.py $compiler test -v +popd +rm -rf "$tmpdir"