diff --git a/tests/p_gcc/0-install_gcc.sh b/tests/p_gcc/0-install_gcc.sh new file mode 100755 index 0000000..96c6f42 --- /dev/null +++ b/tests/p_gcc/0-install_gcc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Author: Christoph Galuschka + +# Install gcc + +t_InstallPackage gcc diff --git a/tests/p_gcc/test_gcc.sh b/tests/p_gcc/test_gcc.sh new file mode 100755 index 0000000..730c19a --- /dev/null +++ b/tests/p_gcc/test_gcc.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Author: Christoph Galuschka +# Athmane Madjodj + +t_Log "Running $0 - simple gcc compilation test" + +# creating source code +FILE='/var/tmp/gcc-test.c' +EXE='/var/tmp/gcc' + +cat > $FILE < +main() +{ + printf("hello, centos\n"); +} +EOF + +# Executing gcc +gcc $FILE -o $EXE + +# run EXE +WORKING=$( $EXE |grep -c 'hello, centos') + +if [ $WORKING -eq 1 ] +then + ret_val=0 +else + ret_val=1 +fi + +# remove files +/bin/rm $FILE +/bin/rm $EXE + +t_CheckExitStatus $ret_val +