tests: re-use Fedora tests

Related: rhbz#2001107
This commit is contained in:
Jesus Checa Hidalgo 2022-01-20 14:25:07 +01:00
parent d32085f5bd
commit ca684864ca
5 changed files with 52 additions and 67 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

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

@ -0,0 +1,51 @@
#
# Build/PR gating tests for *LLVM 13*
#
# Imports and runs tests provided by Fedora LLVM git for the matching LLVM version.
#
# NOTE: *always* keep this file in sync with upstream, i.e. Fedora. Since we cannot "discover" a plan,
# we must duplicate at least some part of upstream plan setup, like `adjust` or `provision`. Not necessarily
# all steps, but if we do need some of them here, let's focus on making changes in upstream first, to preserve
# one source of truth. Once TMT learns to include whole plans, we could drop the copied content from here.
#
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
- 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"
# Unfortunatelly, TMT does not support more declarative approach, we need to run commands on our own.
- because: "On RHEL, CRB must be enabled to provide rarer packages"
when: >-
distro == centos
or distro == rhel-9
or distro == rhel-8
prepare+:
- name: Enable CRB
how: shell
script: dnf config-manager --set-enabled rhel-CRB
discover:
- name: upstream-lldb-tests
how: fmf
url: https://src.fedoraproject.org/rpms/lldb.git
ref: rawhide
- name: upstream-llvm-integration-testsuite
how: fmf
url: https://src.fedoraproject.org/rpms/llvm.git
ref: rawhide
test: integration-test-suite
execute:
how: tmt
provision:
hardware:
memory: ">= 4 GiB"

View File

@ -1,15 +0,0 @@
#!/bin/bash
set -ex
g++ -g test.cpp
lldb -b -o 'breakpoint set --file test.cpp --line 7' -o run -o 'p v' -- a.out | tee lldb.log
test `grep \
-e '(std::vector<int, std::allocator<> >) $0 = size=1 {' \
-e '\[0\] = 2' \
lldb.log \
| wc -l` -eq 2
rm lldb.log

View File

@ -1,9 +0,0 @@
#include <stdio.h>
#include <vector>
int
main ()
{
std::vector<int> v (1, 2);
std::vector<int>::iterator it(v.begin());
return 0;
}

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