re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-07-11 10:45:52 +02:00
parent 29866aef55
commit 26900ae680
7 changed files with 61 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/catch1-1.12.0.tar.gz
/catch1-1.12.1.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

1
tests/.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,14 @@
#define CATCH_CONFIG_MAIN
#include <catch/catch.hpp>
unsigned int Factorial(unsigned int number) {
return number <= 1 ? number : Factorial(number - 1) * number;
}
TEST_CASE("Factorials are computed", "[factorial]") {
REQUIRE(Factorial(1) == 1);
REQUIRE(Factorial(2) == 2);
REQUIRE(Factorial(3) == 6);
REQUIRE(Factorial(10) == 3628800);
}

View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
set -x
TEST_SOURCE=factorial.cpp
TEST_TARGET="${TEST_SOURCE/\.cpp/}"
CXXFLAGS="$(rpm --eval '%{build_cxxflags}')"
LDFLAGS="$(rpm --eval '%{build_ldflags}')"
LIBFLAGS=""
# build target using distribution-specific flags
g++ -std=c++11 $CXXFLAGS $LDFLAGS $LIBFLAGS -o $TEST_TARGET $TEST_SOURCE
# test that target exists
test -f ./$TEST_TARGET
# test that target is executable
test -x ./$TEST_TARGET
# test that target runs successfully
./$TEST_TARGET

4
tests/provision.fmf Normal file
View File

@ -0,0 +1,4 @@
---
standard-inventory-qcow2:
qemu:
m: 4G

13
tests/tests.yml Normal file
View File

@ -0,0 +1,13 @@
---
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- devel-usability
required_packages:
- gcc-c++
- rpm
- redhat-rpm-config
- catch1-devel