From 94e6896b56db0244e52e2f5f332d10932a63a9f8 Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Nov 22 2011 12:18:59 +0000 Subject: Added simple gcc test --- 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 +