tests: convert to TMT

This commit is contained in:
Milos Prchlik 2021-11-16 15:28:27 +01:00
parent 673d4b6aae
commit 4bcc0d1daa
6 changed files with 35 additions and 83 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

25
tests/build-gating.fmf Normal file
View File

@ -0,0 +1,25 @@
summary: lldb 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
discover:
- name: lldb-tests
how: fmf
- name: upstream-llvm-integration-testsuite
how: fmf
url: https://src.fedoraproject.org/rpms/llvm.git
ref: rawhide
test: integration-test-suite
execute:
how: tmt
prepare:
- name: packages
how: install
package: lldb
provision:
hardware:
memory: ">= 4 GiB"

View File

@ -1,38 +0,0 @@
#!/bin/bash
usage() {
echo "usage `basename $0` [OPTIONS]"
echo " --threads NUM The number of threads to use for running tests."
}
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 [ -n "$threads" ]; then
thread_args="-j$threads"
fi
set -xe
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

View File

@ -0,0 +1,5 @@
summary: "Test lldb embedded interpreter (rhbz#1567262)"
test: ./test.sh
require:
- lldb
- gcc-c++

View File

@ -1,7 +1,9 @@
#!/bin/bash
#!/bin/sh -eux
set -ex
# Verify the formal side of things, lldb should really depend on its Python bits.
rpm -q --requires lldb | grep python3-lldb
# Then verify things actually works.
g++ -g test.cpp
lldb -b -o 'breakpoint set --file test.cpp --line 7' -o run -o 'p v' -- a.out | tee lldb.log

View File

@ -1,43 +0,0 @@
- hosts: localhost
pre_tasks:
# We want to be able to check that the sub-package dependencies are correct.
# The CI system installs all sub-packages, so we remove them so we can
# test them individually.
- name: Remove RPMS installed by CI
package:
name:
- python2-lldb
- lldb
- lldb-devel
state: absent
tags: classic
roles:
- role: standard-test-basic
tags:
- classic
required_packages:
- gcc-c++
- lldb
# the requirements below are for the integration suite
- cmake
- llvm-devel
- clang
- clang-analyzer
- clang-tools-extra
- compiler-rt
- ninja-build
- libcxx-devel
- libomp-devel
- python-lit
- lld
- lldb
- git
- make
- libstdc++-static
- clang-devel
tests:
# rhbz#1567262
- python-embedded-interpreter:
dir: python-embedded-interpreter
run: ./runtest.sh
- integration-test-suite