diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/build-gating.fmf b/build-gating.fmf new file mode 100644 index 0000000..2610533 --- /dev/null +++ b/build-gating.fmf @@ -0,0 +1,38 @@ +# +# Build/PR gating tests for libomp +# +# Compatible with various LLVM distributions: +# +# * Fedora (ursine packages) +# * Centos 9 stream (ursine packages) +# * RHEL-9 (ursine packages) +# * RHEL-8 (Red Hat module) +# * RHEL-7 (software collection) +# + +summary: libomp 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 + + - because: "When testing SCL-ized LLVM, the collection must be enabled first" + environment+: + WITH_SCL: "scl enable llvm-toolset-13.0 rust-toolset-1.58" + when: "collection == llvm-toolset-13.0" + - because: "When testing SCL-ized LLVM, the collection must be enabled first" + environment+: + WITH_SCL: "scl enable llvm-toolset-14.0 rust-toolset-1.62" + when: "collection == llvm-toolset-14.0" + +discover: + - name: libomp-tests + how: fmf +execute: + how: tmt +provision: + hardware: + memory: ">= 4 GiB" diff --git a/sanity/main.fmf b/sanity/main.fmf new file mode 100644 index 0000000..bc8431f --- /dev/null +++ b/sanity/main.fmf @@ -0,0 +1,30 @@ +summary: libomp sanity test +test: "$WITH_SCL ./test.sh" +framework: shell + +adjust: + - because: "libomp is not supported in s390x" + when: arch == s390x + enabled: false + + # Common requirements when LLVM is not SCL-ized + - require: + - clang + - clang-libs + - libomp + - libomp-devel + when: "collection is not defined" + + # Requirements for SCL-ized LLVM + - require: + - llvm-toolset-13.0-clang + - llvm-toolset-13.0-clang-libs + - llvm-toolset-13.0-libomp + - llvm-toolset-13.0-libomp-devel + when: "collection == llvm-toolset-13.0" + - require: + - llvm-toolset-14.0-clang + - llvm-toolset-14.0-clang-libs + - llvm-toolset-14.0-libomp + - llvm-toolset-14.0-libomp-devel + when: "collection == llvm-toolset-14.0" \ No newline at end of file diff --git a/sanity/openmp-compile-link-test.c b/sanity/openmp-compile-link-test.c new file mode 100644 index 0000000..a2b6004 --- /dev/null +++ b/sanity/openmp-compile-link-test.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) { + int nthreads = omp_get_num_threads(); + printf("Num Threads: %d\n", nthreads); + return 0; +} diff --git a/sanity/test.sh b/sanity/test.sh new file mode 100755 index 0000000..f07dbbc --- /dev/null +++ b/sanity/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -exo pipefail + +clang -fopenmp openmp-compile-link-test.c + +./a.out | grep "Num Threads: 1"