Added another test for the c compiler.
This commit is contained in:
parent
8af47939d3
commit
81dc5551c4
2 changed files with 13 additions and 0 deletions
6
tests/c++-compiler/hello.c
Normal file
6
tests/c++-compiler/hello.c
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("Hello World!\n");
|
||||
return 0;
|
||||
}
|
|
@ -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 :-("
|
||||
|
|
Loading…
Reference in a new issue