From 598eead7e173bcb05a0905fc06d1444aa25f8e92 Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Tue, 27 Feb 2024 13:47:37 +0100 Subject: [PATCH] Gather common metadata under a parent main.fmf Metadata common to all tests include component, contact, framework, test script and frequent required packages. Normalized script names to 'runtest.sh'. --- tests/clang-format-diff/main.fmf | 15 +++---- .../clang-format-diff/{test.sh => runtest.sh} | 0 tests/fedora-flags/main.fmf | 26 +---------- tests/gcc-clang-compatibility/main.fmf | 23 +--------- .../{test.sh => runtest.sh} | 0 tests/libomp/main.fmf | 10 +---- tests/llvm-test-suite/main.fmf | 6 +-- tests/llvm-test-suite/{test.sh => runtest.sh} | 0 tests/long-double/main.fmf | 26 +---------- tests/main.fmf | 45 +++++++++++++++++++ tests/openmp-rpm/main.fmf | 9 +--- tests/ppc64le-long-double/main.fmf | 28 ++---------- tests/rhbz_1647130/main.fmf | 12 +---- tests/rhbz_1657544/main.fmf | 23 ---------- tests/rhbz_2239619/main.fmf | 23 ---------- tests/rhbz_482491/main.fmf | 25 +---------- tests/rhbz_482491/{test.sh => runtest.sh} | 0 tests/rpmmacros/main.fmf | 6 +-- tests/toolchains/main.fmf | 12 ++--- tests/ucrt64-toolchain/main.fmf | 8 +--- tests/use-correct-dwarf-default/main.fmf | 9 +--- .../{test.sh => runtest.sh} | 0 22 files changed, 76 insertions(+), 230 deletions(-) rename tests/clang-format-diff/{test.sh => runtest.sh} (100%) rename tests/gcc-clang-compatibility/{test.sh => runtest.sh} (100%) rename tests/llvm-test-suite/{test.sh => runtest.sh} (100%) create mode 100644 tests/main.fmf rename tests/rhbz_482491/{test.sh => runtest.sh} (100%) rename tests/use-correct-dwarf-default/{test.sh => runtest.sh} (100%) diff --git a/tests/clang-format-diff/main.fmf b/tests/clang-format-diff/main.fmf index 15f4b9f..0fdeb7d 100644 --- a/tests/clang-format-diff/main.fmf +++ b/tests/clang-format-diff/main.fmf @@ -1,27 +1,22 @@ summary: clang-format-diff -test: "$WITH_SCL ./test.sh" -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/clang-format-diff extra-task: /tools/clang/clang-format-diff extra-nitrate: TC#0614126 -adjust: +adjust+: # Common requirements when LLVM is not SCL-ized - - require: + - require+: - clang-tools-extra when: "collection is not defined" # Requirements for SCL-ized LLVM - - require: + - require+: - llvm-toolset-13.0-clang-tools-extra when: "collection == llvm-toolset-13.0" - - require: + - require+: - llvm-toolset-14.0-clang-tools-extra when: "collection == llvm-toolset-14.0" - - require: + - require+: - llvm-toolset-15.0-clang-tools-extra when: "collection == llvm-toolset-15.0" diff --git a/tests/clang-format-diff/test.sh b/tests/clang-format-diff/runtest.sh similarity index 100% rename from tests/clang-format-diff/test.sh rename to tests/clang-format-diff/runtest.sh diff --git a/tests/fedora-flags/main.fmf b/tests/fedora-flags/main.fmf index f2ce847..5ee3879 100644 --- a/tests/fedora-flags/main.fmf +++ b/tests/fedora-flags/main.fmf @@ -1,34 +1,12 @@ summary: fedora-flags -test: "$WITH_SCL ./runtest.sh" -require: +require+: - redhat-rpm-config -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/fedora-flags extra-task: /tools/clang/fedora-flags extra-nitrate: TC#0614127 -adjust: - - # Common requirements when LLVM is not SCL-ized - - require+: - - clang - when: "collection is not defined" - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-clang - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-clang - when: "collection == llvm-toolset-14.0" - - require+: - - llvm-toolset-15.0-clang - when: "collection == llvm-toolset-15.0" - +adjust+: - because: s390x does not have epel repo which is required to provide rpm macros enabled: false when: >- diff --git a/tests/gcc-clang-compatibility/main.fmf b/tests/gcc-clang-compatibility/main.fmf index b880df5..6a29a8a 100644 --- a/tests/gcc-clang-compatibility/main.fmf +++ b/tests/gcc-clang-compatibility/main.fmf @@ -2,30 +2,9 @@ summary: Test that both gcc/clang compile/link compatibility. description: Build an object file with g++, link it with clang++ and viceversa, to ensure that objects compiled with one can be linked with the other. -test: "$WITH_SCL ./test.sh" -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/gcc-clang-compatibility extra-task: /tools/clang/gcc-clang-compatibility -require: +require+: - gcc-c++ - -adjust: - - require+: - - clang - when: collection is not defined - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-clang - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-clang - when: "collection == llvm-toolset-14.0" - - require+: - - llvm-toolset-15.0-clang - when: "collection == llvm-toolset-15.0" diff --git a/tests/gcc-clang-compatibility/test.sh b/tests/gcc-clang-compatibility/runtest.sh similarity index 100% rename from tests/gcc-clang-compatibility/test.sh rename to tests/gcc-clang-compatibility/runtest.sh diff --git a/tests/libomp/main.fmf b/tests/libomp/main.fmf index 62c7973..04d49f9 100644 --- a/tests/libomp/main.fmf +++ b/tests/libomp/main.fmf @@ -1,23 +1,17 @@ # The point of this test is to ensure that clang/clang-libs demand the correct # libomp packages, and is able to use openmp headers and libraries summary: test clang can find libomp header and libraries -test: "$WITH_SCL ./runtest.sh" -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/libomp extra-task: /tools/clang/libomp extra-nitrate: TC#0614137 -require: - - clang +require+: - clang-libs - libomp - libomp-devel -adjust: +adjust+: - because: "libomp is not supported in s390x" when: arch == s390x enabled: false diff --git a/tests/llvm-test-suite/main.fmf b/tests/llvm-test-suite/main.fmf index 7d61dfb..e084bd1 100644 --- a/tests/llvm-test-suite/main.fmf +++ b/tests/llvm-test-suite/main.fmf @@ -1,16 +1,14 @@ # TODO: once llvm-test-suite is converted to TMT, we can just link the test from plan. summary: Run tests from llvm-test-suite package -adjust: +adjust+: - because: "llvm-test-suite is available for Fedora, not RHEL/CentOS" when: >- distro == rhel or distro == centos enabled: false -test: "$WITH_SCL ./test.sh" - -require: +require+: - git - clang - ninja-build diff --git a/tests/llvm-test-suite/test.sh b/tests/llvm-test-suite/runtest.sh similarity index 100% rename from tests/llvm-test-suite/test.sh rename to tests/llvm-test-suite/runtest.sh diff --git a/tests/long-double/main.fmf b/tests/long-double/main.fmf index 71b2b42..21c9acb 100644 --- a/tests/long-double/main.fmf +++ b/tests/long-double/main.fmf @@ -1,33 +1,11 @@ summary: Test that gcc and clang use the same long double format -test: $WITH_SCL ./runtest.sh duration: 5m -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/long-double extra-task: /tools/clang/long-double extra-nitrate: TC#0614593 -adjust: - # Common requirements when LLVM is not SCL-ized - - require+: - - clang - when: "collection is not defined" +require+: + - gcc - - require+: - - gcc - when: distro != fedora - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-clang - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-clang - when: "collection == llvm-toolset-14.0" - - require+: - - llvm-toolset-15.0-clang - when: "collection == llvm-toolset-15.0" id: 4096a1bb-d2a5-4aeb-b14d-fc465c293e32 diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..9b52720 --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,45 @@ +# Common configuration for all the tests in this repo +# All the tmt tests under this directory inherit the settings from this file +component: + - llvm-toolset + - clang + +# Default QA contact. If more are relevant use 'contact+:' in each test metadata. +contact: + - Jesus Checa Hidalgo + +# All tests are shell by default. If a specific test uses another framework +# such as beakerlib, define "framework: beakerlib" in the test's main.fmf +framework: shell + +# Always define "test" key and override in adjust or in each specific test +# metadata if needed. +test: ./runtest.sh + +# Commonly used keys are initialized to empty. +require: [] +link: [] +tag: [] + +adjust+: + # Common requirements when LLVM is not SCL-ized + - require+: + - clang + when: collection is not defined + + # Requirements for SCL-ized LLVM + # We need to override the test key to do the proper scl call + - test: scl enable llvm-toolset-13.0 -- ./runtest.sh + require+: + - llvm-toolset-13.0-clang + when: collection == llvm-toolset-13.0 + + - test: scl enable llvm-toolset-14.0 -- ./runtest.sh + require+: + - llvm-toolset-14.0-clang + when: collection == llvm-toolset-14.0 + + - test: scl enable llvm-toolset-15.0 -- ./runtest.sh + require+: + - llvm-toolset-15.0-clang + when: collection == llvm-toolset-15.0 diff --git a/tests/openmp-rpm/main.fmf b/tests/openmp-rpm/main.fmf index e899916..3a41ad5 100644 --- a/tests/openmp-rpm/main.fmf +++ b/tests/openmp-rpm/main.fmf @@ -1,17 +1,12 @@ summary: Test build a simple RPM package to ensure that -fopenmp works -test: "$WITH_SCL ./runtest.sh" -require: +require+: - rpm-build -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/openmp-rpm extra-task: /tools/clang/openmp-rpm extra-nitrate: TC#0614128 -adjust: +adjust+: - because: "libomp not supported in s390x" when: arch == s390x enabled: false diff --git a/tests/ppc64le-long-double/main.fmf b/tests/ppc64le-long-double/main.fmf index cd4e68f..9cadea0 100644 --- a/tests/ppc64le-long-double/main.fmf +++ b/tests/ppc64le-long-double/main.fmf @@ -1,21 +1,11 @@ summary: Test binary compatibility of the long double format on ppc64le -test: $WITH_SCL ./runtest.sh duration: 1h -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/ppc64le-long-double extra-task: /tools/clang/ppc64le-long-double extra-nitrate: TC#0614129 -adjust: - # Common requirements when LLVM is not SCL-ized - - require+: - - clang - when: "collection is not defined" - +adjust+: - because: "Fedora CI runs in x86_64 only, emulate with qemu and mock" require+: - qemu-user-static @@ -29,19 +19,9 @@ adjust: - because: "glibc in RHEL older than 9 don't support IEEE 128bit doubles" enabled: false - when: distro < rhel-9 + when: distro < rhel-9 or distro < centos-stream-9 - - require+: + - because: "The test runs natively on RHEL so get gcc to build" + require+: - gcc when: distro != fedora - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-clang - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-clang - when: "collection == llvm-toolset-14.0" - - require+: - - llvm-toolset-15.0-clang - when: "collection == llvm-toolset-15.0" diff --git a/tests/rhbz_1647130/main.fmf b/tests/rhbz_1647130/main.fmf index ea2d70d..c7252a0 100644 --- a/tests/rhbz_1647130/main.fmf +++ b/tests/rhbz_1647130/main.fmf @@ -1,32 +1,22 @@ summary: RHBZ1647130 -test: "$WITH_SCL ./runtest.sh" -require: [] -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/rhbz_167130 extra-task: /tools/clang/rhbz_167130 extra-nitrate: TC#0614130 -adjust: +adjust+: # Common requirements when LLVM is not SCL-ized - require+: - - clang - clang-analyzer when: "collection is not defined" # Requirements for SCL-ized LLVM - require+: - - llvm-toolset-13.0-clang - llvm-toolset-13.0-clang-analyzer when: "collection == llvm-toolset-13.0" - require+: - - llvm-toolset-14.0-clang - llvm-toolset-14.0-clang-analyzer when: "collection == llvm-toolset-14.0" - require+: - - llvm-toolset-15.0-clang - llvm-toolset-15.0-clang-analyzer when: "collection == llvm-toolset-15.0" diff --git a/tests/rhbz_1657544/main.fmf b/tests/rhbz_1657544/main.fmf index 0b6ab59..b947c0e 100644 --- a/tests/rhbz_1657544/main.fmf +++ b/tests/rhbz_1657544/main.fmf @@ -1,28 +1,5 @@ summary: RHBZ1657544 -test: "$WITH_SCL ./runtest.sh" -require: [] -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/rhbz_165744 extra-task: /tools/clang/rhbz_165744 extra-nitrate: TC#0614131 - -adjust: - # Common requirements when LLVM is not SCL-ized - - require+: - - clang - when: "collection is not defined" - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-clang - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-clang - when: "collection == llvm-toolset-14.0" - - require+: - - llvm-toolset-15.0-clang - when: "collection == llvm-toolset-15.0" diff --git a/tests/rhbz_2239619/main.fmf b/tests/rhbz_2239619/main.fmf index e0c5e69..dd5c972 100644 --- a/tests/rhbz_2239619/main.fmf +++ b/tests/rhbz_2239619/main.fmf @@ -1,25 +1,2 @@ summary: Test if debug information is disabled by default -test: "$WITH_SCL ./runtest.sh" -require: [] -framework: shell tier: 1 -component: - - llvm-toolset - - clang - -adjust: - # Common requirements when LLVM is not SCL-ized - - require+: - - clang - when: "collection is not defined" - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-clang - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-clang - when: "collection == llvm-toolset-14.0" - - require+: - - llvm-toolset-15.0-clang - when: "collection == llvm-toolset-15.0" diff --git a/tests/rhbz_482491/main.fmf b/tests/rhbz_482491/main.fmf index 6a3fa23..7f567a3 100644 --- a/tests/rhbz_482491/main.fmf +++ b/tests/rhbz_482491/main.fmf @@ -1,14 +1,9 @@ summary: rhbz-482491 description: | "Test that clang is able to find the right libgcc_s" -test: "$WITH_SCL ./test.sh" -require: +require+: - libgcc -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/rhbz_482194 extra-task: /tools/clang/rhbz_482194 extra-nitrate: TC#0614132 @@ -16,24 +11,8 @@ extra-nitrate: TC#0614132 link: - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1482491 -adjust: +adjust+: # gcc-x86_64-linux-gnu is not available in RHEL - require+: - gcc-x86_64-linux-gnu when: "distro == fedora" - - # Common requirements when LLVM is not SCL-ized - - require+: - - clang - when: "collection is not defined" - - # Requirements for SCL-ized LLVM - - require+: - - llvm-toolset-13.0-clang - when: "collection == llvm-toolset-13.0" - - require+: - - llvm-toolset-14.0-clang - when: "collection == llvm-toolset-14.0" - - require+: - - llvm-toolset-15.0-clang - when: "collection == llvm-toolset-15.0" diff --git a/tests/rhbz_482491/test.sh b/tests/rhbz_482491/runtest.sh similarity index 100% rename from tests/rhbz_482491/test.sh rename to tests/rhbz_482491/runtest.sh diff --git a/tests/rpmmacros/main.fmf b/tests/rpmmacros/main.fmf index 265b158..7dc9d57 100644 --- a/tests/rpmmacros/main.fmf +++ b/tests/rpmmacros/main.fmf @@ -1,10 +1,6 @@ summary: Test if RPM macros are properly set -test: "./runtest.sh" -framework: shell tier: 1 -component: - - clang -require: +require+: - clang - clang-devel extra-summary: /tools/clang/rpmmacros diff --git a/tests/toolchains/main.fmf b/tests/toolchains/main.fmf index 5ce7fb6..ec80616 100644 --- a/tests/toolchains/main.fmf +++ b/tests/toolchains/main.fmf @@ -1,21 +1,15 @@ -# TODO REVIEW: better summary -summary: "" -test: "$WITH_SCL ./runtest.sh" -require: +summary: "Test integration between clang, compiler-rt and lld" +require+: - glibc-static - yum-utils # This require EPEL/CRB to be enabled on RHEL - libstdc++-static -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/toolchains extra-task: /tools/clang/toolchains extra-nitrate: TC#0614133 -adjust: +adjust+: # Common requirements when LLVM is not SCL-ized - require+: - clang diff --git a/tests/ucrt64-toolchain/main.fmf b/tests/ucrt64-toolchain/main.fmf index bd31699..18c9f22 100644 --- a/tests/ucrt64-toolchain/main.fmf +++ b/tests/ucrt64-toolchain/main.fmf @@ -1,12 +1,8 @@ summary: Test that ucrt64 toolchain is detected -test: ./runtest.sh -component: - - clang -require: - - clang +require+: - ucrt64-gcc-c++ -adjust: +adjust+: - enabled: false when: distro != fedora or distro < fedora-37 because: "The ucrt64 toolchain is only available since Fedora 37" diff --git a/tests/use-correct-dwarf-default/main.fmf b/tests/use-correct-dwarf-default/main.fmf index b20851d..da1ab93 100644 --- a/tests/use-correct-dwarf-default/main.fmf +++ b/tests/use-correct-dwarf-default/main.fmf @@ -1,17 +1,12 @@ summary: Test that clang uses DWARFv4 by default -test: "$WITH_SCL ./test.sh" -require: +require+: - libgcc -framework: shell tier: 1 -component: - - llvm-toolset - - clang extra-summary: /tools/clang/use-correct-dwarf-default extra-task: /tools/clang/use-correct-dwarf-default extra-nitrate: TC#0614134 -adjust: +adjust+: # Common requirements when LLVM is not SCL-ized - require+: - clang diff --git a/tests/use-correct-dwarf-default/test.sh b/tests/use-correct-dwarf-default/runtest.sh similarity index 100% rename from tests/use-correct-dwarf-default/test.sh rename to tests/use-correct-dwarf-default/runtest.sh