From 443c3ba900c392adc39d92972d5d41eb95a9f2a0 Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: Apr 17 2020 16:21:55 +0000 Subject: Merge pull request #52 from Conan-Kudo/gcc-annobin-test Add tests for verifying that annobin is working properly with gcc --- diff --git a/tests/p_annobin/0-install_annobin.sh b/tests/p_annobin/0-install_annobin.sh new file mode 100755 index 0000000..ace2e60 --- /dev/null +++ b/tests/p_annobin/0-install_annobin.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Author: Neal Gompa + +# Skip if older than CentOS 8 +if [ "$centos_ver" -lt "8" ]; then + t_Log "annobin does not exist pre-c8 => SKIP" + exit 0 +fi + +# Install annobin and gcc +t_Log "Running $0 - installing annobin and gcc." + +t_InstallPackage annobin redhat-rpm-config gcc gcc-c++ diff --git a/tests/p_annobin/10-test_annobin-gcc.sh b/tests/p_annobin/10-test_annobin-gcc.sh new file mode 100755 index 0000000..2ea50bc --- /dev/null +++ b/tests/p_annobin/10-test_annobin-gcc.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Author: Neal Gompa + +# Skip if older than CentOS 8 +if [ "$centos_ver" -lt "8" ]; then + t_Log "annobin does not exist pre-c8 => SKIP" + exit 0 +fi + +# Run the test +t_Log "Running $0 - build a hello world program with gcc using annobin" + +BUILTPROG=$(mktemp) + +cat < +int main() { + printf("Hello World!\n"); + return 0; +} +EOF + +${BUILTPROG} | grep -q "Hello World" +t_CheckExitStatus $? + +rm -f ${BUILTPROG} diff --git a/tests/p_annobin/20-test_annobin-gcc-c++.sh b/tests/p_annobin/20-test_annobin-gcc-c++.sh new file mode 100755 index 0000000..0f55a75 --- /dev/null +++ b/tests/p_annobin/20-test_annobin-gcc-c++.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Author: Neal Gompa + +# Skip if older than CentOS 8 +if [ "$centos_ver" -lt "8" ]; then + t_Log "annobin does not exist pre-c8 => SKIP" + exit 0 +fi + +# Run the test +t_Log "Running $0 - build a hello world program with gcc-c++ using annobin" + +BUILTPROG=$(mktemp) + +cat < +int main() { + std::cout << "Hello World!\n"; + return 0; +} +EOF + +${BUILTPROG} | grep -q "Hello World" +t_CheckExitStatus $? + +rm -f ${BUILTPROG}