diff --git a/tests/binutils-plugin-ar/main.fmf b/tests/binutils-plugin-ar/main.fmf deleted file mode 100644 index a8b6ebf..0000000 --- a/tests/binutils-plugin-ar/main.fmf +++ /dev/null @@ -1,2 +0,0 @@ -summary: Make sure the the LLVM plugin for binutils' ar works -test: ./test.sh diff --git a/tests/binutils-plugin-ar/test.sh b/tests/binutils-plugin-ar/test.sh deleted file mode 100755 index 5dbacec..0000000 --- a/tests/binutils-plugin-ar/test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -eux - -set pipefail - -echo "void lto_function(){}" | clang -flto -O2 -c -x c -o foo.o - -ar crs foo.a foo.o -readelf -c foo.a | grep lto_function diff --git a/tests/build-compat/main.fmf b/tests/build-compat/main.fmf deleted file mode 100644 index fe61457..0000000 --- a/tests/build-compat/main.fmf +++ /dev/null @@ -1,3 +0,0 @@ -summary: Make sure rebuilding LLVM still works with the new LLVM -test: ./test.sh -enabled: false diff --git a/tests/build-compat/test.sh b/tests/build-compat/test.sh deleted file mode 100755 index 04a97b2..0000000 --- a/tests/build-compat/test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -eux - -dnf download --disablerepo=* --enablerepo=test-llvm --source llvm - -# The src.rpm is available in the directory the test run from. -set +e -mock --resultdir=. --old-chroot --with compat_build --rebuild *.src.rpm -if [ $? -ne 0 ]; then - cat root.log - cat build.log - exit 1 -fi - -exit 0 diff --git a/tests/build-gating.fmf b/tests/build-gating.fmf new file mode 100644 index 0000000..687ebd5 --- /dev/null +++ b/tests/build-gating.fmf @@ -0,0 +1,44 @@ +# +# Build/PR gating tests for *LLVM 13* +# +# Imports and runs tests provided by Fedora LLVM git for the matching LLVM version. +# +# NOTE: *always* keep this file in sync with upstream, i.e. Fedora. Since we cannot "discover" a plan, +# we must duplicate at least some part of upstream plan setup, like `adjust` or `provision`. Not necessarily +# all steps, btu if we do need some of them here, let's focus on making changes in upstream first, to preserve +# one source of truth. Once TMT learns to include whole plans, we could drop the copied content from here. +# + +summary: LLVM tests for build/PR gating + +adjust: + - because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR." + when: >- + trigger is defined + and trigger != commit + and trigger != build + enabled: false + + # Unfortunatelly, TMT does not support more declarative approach, we need to run commands on our own. + - because: "On RHEL, CRB must be enabled to provide rarer packages" + when: >- + distro == centos + or distro == rhel-9 + or distro == rhel-8 + prepare+: + - name: Enable CRB + how: shell + script: dnf config-manager --set-enabled rhel-CRB + +discover: + - name: "Upstream LLVM tests for build/PR gating" + how: fmf + url: https://src.fedoraproject.org/rpms/llvm.git + ref: rawhide + +execute: + how: tmt + +provision: + hardware: + memory: ">= 4 GiB" diff --git a/tests/default.fmf b/tests/default.fmf deleted file mode 100644 index dcffcb1..0000000 --- a/tests/default.fmf +++ /dev/null @@ -1,12 +0,0 @@ -summary: All available LLVM tests -discover: - how: fmf -execute: - how: tmt -prepare: - - name: packages - how: install - package: llvm -provision: - hardware: - memory: ">= 4 GiB" diff --git a/tests/integration-test-suite/main.fmf b/tests/integration-test-suite/main.fmf deleted file mode 100644 index 6e8844b..0000000 --- a/tests/integration-test-suite/main.fmf +++ /dev/null @@ -1,28 +0,0 @@ -summary: Run the upstream LLVM integration test suite -description: | - Run the upstream LLVM integration test suite - - NOTE: don't forget to disable libcxx tests when libcxx is not available, by adding -DENABLE_LIBCXX=OFF. -test: ./test.sh -require: - - cmake - - llvm-devel - - clang - - clang-analyzer - - clang-tools-extra - - compiler-rt - - ninja-build - - libomp-devel - - lld - - lldb - - git - - make - - libstdc++-static - - clang-devel - - # In Fedora, python-lit is valid. In RHEL, however, the actual package is python3-lit. - - python-lit - # - python3-lit - - # Required in Fedora, but not shipped with RHEL. For future reference, comment the libcxx out as needed. - - libcxx-devel diff --git a/tests/integration-test-suite/test.sh b/tests/integration-test-suite/test.sh deleted file mode 100755 index 682e4f0..0000000 --- a/tests/integration-test-suite/test.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -eux - -usage() { - echo "usage `basename $0` [OPTIONS]" - echo " --threads NUM The number of threads to use for running tests." -} - -threads=0 -thread_args="" -repo_url=https://github.com/opencollab/llvm-toolchain-integration-test-suite - -while [ $# -gt 0 ]; do - case $1 in - --threads) - shift - threads="$1" - ;; - * ) - echo "unknown option: $1" - echo "" - usage - exit 1 - ;; - esac - shift -done - -if [ "$threads" -ge 1 ]; then - thread_args="-j$threads" -fi - -cd $(mktemp -d -p /var/tmp) -git clone $repo_url -cd llvm-toolchain-integration-test-suite -mkdir _build && cd _build -cmake .. -GNinja -ninja $thread_args check diff --git a/tests/libllvm-size/main.fmf b/tests/libllvm-size/main.fmf deleted file mode 100644 index f03b183..0000000 --- a/tests/libllvm-size/main.fmf +++ /dev/null @@ -1,2 +0,0 @@ -summary: Check that libLLVM.so has been properly stripped -test: ./test.sh diff --git a/tests/libllvm-size/test.sh b/tests/libllvm-size/test.sh deleted file mode 100755 index 7ceb8cb..0000000 --- a/tests/libllvm-size/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -eux - -# There is a bug in the build process when it runs out of disk space -# while stripping binaries, which causes the strip to fail, but does -# not fail the build. This results in a libLLVM.so that is over 2GB -# which breaks the nightly compose. So this test checks that libLLVM.so -# is less than 100MB to ensure it was successfully stripped. -# https://bugzilla.redhat.com/show_bug.cgi?id=1793250 - -test $(stat -L -c %s /usr/lib64/libLLVM.so) -lt 104857600 diff --git a/tests/llvm-config/main.fmf b/tests/llvm-config/main.fmf deleted file mode 100644 index 6c36dd6..0000000 --- a/tests/llvm-config/main.fmf +++ /dev/null @@ -1,2 +0,0 @@ -summary: Make sure llvm-config symlink is properly set up -test: ./test.sh diff --git a/tests/llvm-config/test.sh b/tests/llvm-config/test.sh deleted file mode 100755 index 09a0286..0000000 --- a/tests/llvm-config/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -eux - -llvm-config --version diff --git a/tests/rust-sanity/main.fmf b/tests/rust-sanity/main.fmf deleted file mode 100644 index 4f86eba..0000000 --- a/tests/rust-sanity/main.fmf +++ /dev/null @@ -1,16 +0,0 @@ -summary: Test basic cargo usage -test: ./test.sh -require: -# Required for rust and possibly other dependant packages -# -# NOTE #1: drop the requirement once the transitional period between releases is gone -# and llvm-compat is no longer a) needed, and b) part of the build. -# -# NOTE #2: keep it the first requirement. Depending on the order of requirements, placing it somewhere -# else in the list may lead to harness uninstalling and re-installing LLVM packages. That a) would be -# a waste of time, b) could potentially hide issues, leading to testing unexpected NVRs. -# -# - llvm-compat - - - cargo - - rust diff --git a/tests/rust-sanity/test.sh b/tests/rust-sanity/test.sh deleted file mode 100755 index fa15399..0000000 --- a/tests/rust-sanity/test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -eux - -cargo new hello -cd hello -cargo run diff --git a/tests/versioned-llvm-config/main.fmf b/tests/versioned-llvm-config/main.fmf deleted file mode 100644 index eddb736..0000000 --- a/tests/versioned-llvm-config/main.fmf +++ /dev/null @@ -1,2 +0,0 @@ -summary: Make sure the versioned llvm-config symlink is properly set up -test: ./test.sh diff --git a/tests/versioned-llvm-config/test.sh b/tests/versioned-llvm-config/test.sh deleted file mode 100755 index cfe72cf..0000000 --- a/tests/versioned-llvm-config/test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -eux - -major=$(llvm-config --version | cut -d '.' -f1) - -llvm-config-$major --version