Build both C an C++ hello world programs as integration test
Add simple test which builds Hello World programs for both C and C++. Build options provided by default rpm macro. Based on https://github.com/CentOS/sig-core-t_functional/tree/master/tests/p_annobin Gating is not enabled yet, so the test will not be blocking.
This commit is contained in:
parent
9186451072
commit
d6a2f172d6
9
tests/build_hello_world.sh
Executable file
9
tests/build_hello_world.sh
Executable file
@ -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"
|
5
tests/data/hello.c
Normal file
5
tests/data/hello.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
printf("Hello World!\n");
|
||||
return 0;
|
||||
}
|
5
tests/data/hello.cpp
Normal file
5
tests/data/hello.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include <iostream>
|
||||
int main() {
|
||||
std::cout << "Hello World!\n";
|
||||
return 0;
|
||||
}
|
14
tests/tests.yml
Normal file
14
tests/tests.yml
Normal file
@ -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"
|
Loading…
Reference in New Issue
Block a user