From 81dc5551c4a6ba4ec9cce1903685110fc9d54b16 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Wed, 21 Dec 2011 13:11:25 +0000 Subject: [PATCH] Added another test for the c compiler. --- tests/c++-compiler/hello.c | 6 ++++++ tests/c++-compiler/test.sh | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/c++-compiler/hello.c diff --git a/tests/c++-compiler/hello.c b/tests/c++-compiler/hello.c new file mode 100644 index 0000000..f4bd2c6 --- /dev/null +++ b/tests/c++-compiler/hello.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello World!\n"); + return 0; +} diff --git a/tests/c++-compiler/test.sh b/tests/c++-compiler/test.sh index ba1b195..ccb1a2e 100755 --- a/tests/c++-compiler/test.sh +++ b/tests/c++-compiler/test.sh @@ -29,6 +29,12 @@ compiler_check_stdexcept() { $cmd } +compiler_check_helloworld() { + cmd="cc hello.c" + echo $cmd + $cmd +} + swap_env() { currentPrgEnv=$(module li 2>&1 | awk '/PrgEnv/{print $2}') if [ "$1" == gcc ] ; then @@ -51,6 +57,7 @@ for compiler in $compilers; do swap_env $compiler 2>$logfile >$logfile || error=1 module swap $compiler $compiler/$version 2>>$logfile >>$logfile || error=1 compiler_version_cmd $compiler 2>>$logfile >>$logfile || error=1 + compiler_check_helloworld $compiler 2>>$logfile >>$logfile || error=1 compiler_check_stdexcept $compiler 2>> $logfile >>$logfile || error=1 if [ $error != 0 ] ; then echo "failed :-("