Blame tests/p_annobin/20-test_annobin-gcc-c++.sh
|
Neal Gompa |
9e98c2 |
#!/bin/bash
|
|
Neal Gompa |
9e98c2 |
# Author: Neal Gompa <ngompa@datto.com>
|
|
Neal Gompa |
9e98c2 |
|
|
Neal Gompa |
9e98c2 |
# Skip if older than CentOS 8
|
|
Neal Gompa |
9e98c2 |
if [ "$centos_ver" -lt "8" ]; then
|
|
Neal Gompa |
9e98c2 |
t_Log "annobin does not exist pre-c8 => SKIP"
|
|
Neal Gompa |
9e98c2 |
exit 0
|
|
Neal Gompa |
9e98c2 |
fi
|
|
Neal Gompa |
9e98c2 |
|
|
Neal Gompa |
9e98c2 |
# Run the test
|
|
Neal Gompa |
9e98c2 |
t_Log "Running $0 - build a hello world program with gcc-c++ using annobin"
|
|
Neal Gompa |
9e98c2 |
|
|
Neal Gompa |
9e98c2 |
BUILTPROG=$(mktemp)
|
|
Neal Gompa |
9e98c2 |
|
|
|
76fc25 |
cat <
|
|
Neal Gompa |
9e98c2 |
#include <iostream>
|
|
Neal Gompa |
9e98c2 |
int main() {
|
|
Neal Gompa |
9e98c2 |
std::cout << "Hello World!\n";
|
|
Neal Gompa |
9e98c2 |
return 0;
|
|
Neal Gompa |
9e98c2 |
}
|
|
Neal Gompa |
9e98c2 |
EOF
|
|
Neal Gompa |
9e98c2 |
|
|
Neal Gompa |
9e98c2 |
${BUILTPROG} | grep -q "Hello World"
|
|
Neal Gompa |
9e98c2 |
t_CheckExitStatus $?
|
|
Neal Gompa |
9e98c2 |
|
|
Neal Gompa |
9e98c2 |
rm -f ${BUILTPROG}
|