From efe895c2dad523a1dddedd902549ebd914ad44d2 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Sep 12 2022 11:16:17 +0000 Subject: Migrate tests to tests/lld repo --- diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..b1bedaa --- /dev/null +++ b/tests/README.md @@ -0,0 +1,6 @@ +# Gating testplans for lld + +The tests for lld are in a separate repo: https://src.fedoraproject.org/tests/lld +This directory should contain only fmf plans (such as build-gating.fmf) which import +the tests from the tests repo. This can be done using the "url" parameter of the +plan's "discover" step. Reference: https://tmt.readthedocs.io/en/stable/spec/plans.html#fmf diff --git a/tests/basic/main.fmf b/tests/basic/main.fmf deleted file mode 100644 index 803433c..0000000 --- a/tests/basic/main.fmf +++ /dev/null @@ -1,23 +0,0 @@ -summary: Test lld with clang -test: "$WITH_SCL ./test.sh" -require: [] -adjust: - - because: lld is not shipped for s390x and ppc64 - enabled: false - when: arch == s390x or arch == ppc64 - - # Common requirements when LLVM is not SCL-ized - - require+: - - clang - - lld - when: "collection is not defined" - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-clang - - llvm-toolset-13.0-lld - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-clang - - llvm-toolset-14.0-lld - when: "collection == llvm-toolset-14.0" diff --git a/tests/basic/test.sh b/tests/basic/test.sh deleted file mode 100755 index 2c6d046..0000000 --- a/tests/basic/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -eux - -echo "int main(){ return 0; }" | clang -x c -fuse-ld=lld - diff --git a/tests/build-gating-alternatives.fmf b/tests/build-gating-alternatives.fmf index 22be24d..0527421 100644 --- a/tests/build-gating-alternatives.fmf +++ b/tests/build-gating-alternatives.fmf @@ -35,6 +35,8 @@ adjust: discover: - name: lld-tests how: fmf + url: https://src.fedoraproject.org/tests/lld.git + ref: main test: ld-alternative execute: how: tmt diff --git a/tests/build-gating.fmf b/tests/build-gating.fmf index 6f0cd91..93c34b0 100644 --- a/tests/build-gating.fmf +++ b/tests/build-gating.fmf @@ -35,11 +35,13 @@ adjust: discover: - name: lld-tests how: fmf + url: https://src.fedoraproject.org/tests/lld.git + ref: main filter: "tag:-spoils-installation" - name: upstream-llvm-integration-testsuite how: fmf - url: https://src.fedoraproject.org/rpms/llvm.git - ref: rawhide + url: https://src.fedoraproject.org/tests/llvm.git + ref: main test: integration-test-suite execute: how: tmt diff --git a/tests/gcc-compat-basic/main.fmf b/tests/gcc-compat-basic/main.fmf deleted file mode 100644 index 45ec4c8..0000000 --- a/tests/gcc-compat-basic/main.fmf +++ /dev/null @@ -1,25 +0,0 @@ -summary: Test lld with gcc -test: "$WITH_SCL ./test.sh" -require: - - gcc -adjust: - - because: lld is not shipped for s390x and ppc64 - enabled: false - when: arch == s390x or arch == ppc64 - - - because: system gcc is too old in rhel-7 - enabled: false - when: distro <= rhel-7 - - # Common requirements when LLVM is not SCL-ized - - require+: - - lld - when: "collection is not defined" - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-lld - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-lld - when: "collection == llvm-toolset-14.0" diff --git a/tests/gcc-compat-basic/test.sh b/tests/gcc-compat-basic/test.sh deleted file mode 100755 index 0cf9c51..0000000 --- a/tests/gcc-compat-basic/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -eux - -echo "int main(){ return 0; }" | gcc -x c -fuse-ld=lld - diff --git a/tests/ld-alternative/main.fmf b/tests/ld-alternative/main.fmf deleted file mode 100644 index ae55769..0000000 --- a/tests/ld-alternative/main.fmf +++ /dev/null @@ -1,28 +0,0 @@ -summary: Test linker switching with alternatives -test: "$WITH_SCL ./test.sh" -# This test spoils the installation by removing lld, therefore it should be marked as such. -tag: - - spoils-installation -require: - - binutils -adjust: - - because: lld is not shipped for s390x and ppc64 - enabled: false - when: arch == s390x or arch == ppc64 - - - because: lld is not installed as ld alternative in rhel < 9 - enabled: false - when: distro < rhel-9 - - # Common requirements when LLVM is not SCL-ized - - require+: - - lld - when: "collection is not defined" - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-lld - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-lld - when: "collection == llvm-toolset-14.0" diff --git a/tests/ld-alternative/test.sh b/tests/ld-alternative/test.sh deleted file mode 100755 index 3f646bd..0000000 --- a/tests/ld-alternative/test.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -eux - -# This test assumes lld is already installed. - -function verify_ld_bfd { - - # Verify that /usr/bin/ld points to ld.bfd. - ls -l /etc/alternatives/ld | grep ld.bfd - - # Run ld and verify it invokes ld.bfd - /usr/bin/ld --version | grep 'GNU ld' -} - - -# Verify ld.bfd is still the system linker when lld is installed -verify_ld_bfd - -# Set lld as the system linker -update-alternatives --set ld /usr/bin/ld.lld - -# Verify that /usr/bin/ld points to lld -ls -l /etc/alternatives/ld | grep ld.lld - -# Run ld and verify it invokes lld -/usr/bin/ld --version | grep 'LLD' - -# Uninstall lld and make sure the /usr/bin/ld is reset to ld.bfd -dnf -y remove --noautoremove lld - -verify_ld_bfd