Init repo.

* Init tmt
* Add sanity test
* Add gating fmf plan
This commit is contained in:
Jesus Checa Hidalgo 2022-08-24 16:23:47 +02:00
commit 7909f0b729
5 changed files with 84 additions and 0 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

38
build-gating.fmf Normal file
View file

@ -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"

30
sanity/main.fmf Normal file
View file

@ -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"

View file

@ -0,0 +1,8 @@
#include <omp.h>
#include <stdio.h>
int main(int argc, char **argv) {
int nthreads = omp_get_num_threads();
printf("Num Threads: %d\n", nthreads);
return 0;
}

7
sanity/test.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
set -exo pipefail
clang -fopenmp openmp-compile-link-test.c
./a.out | grep "Num Threads: 1"