diff --git a/tests/build_hello_world.sh b/tests/build_hello_world.sh new file mode 100755 index 0000000..f6aae70 --- /dev/null +++ b/tests/build_hello_world.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +gcc -x c $(rpm --eval %build_cflags) data/hello.c -o hello_c.out +./hello_c.out | grep -q "Hello World" + +g++ -x c++ $(rpm --eval %build_cxxflags) data/hello.cpp -o hello_cpp.out +./hello_cpp.out | grep -q "Hello World" diff --git a/tests/data/hello.c b/tests/data/hello.c new file mode 100644 index 0000000..fe064a2 --- /dev/null +++ b/tests/data/hello.c @@ -0,0 +1,5 @@ +#include +int main() { + printf("Hello World!\n"); + return 0; +} diff --git a/tests/data/hello.cpp b/tests/data/hello.cpp new file mode 100644 index 0000000..2131d8a --- /dev/null +++ b/tests/data/hello.cpp @@ -0,0 +1,5 @@ +#include +int main() { + std::cout << "Hello World!\n"; + return 0; +} diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..dfe09e0 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,14 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + + required_packages: + - redhat-rpm-config + - annobin + + tests: + - build_hello_world: + dir: . + run: "./build_hello_world.sh"