gcc/tests/build_hello_world.sh
Aleksandra Fedorova d6a2f172d6 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.
2020-08-03 12:58:11 +00:00

10 lines
239 B
Bash
Executable File

#!/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"