#! /bin/sh # # Tests for mpicc, mpiCC, mpif77 (.F) and mpif90 (.F90) # -Dname=\"foo bar\" # -Dname='"foo bar"' # STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"} mpicc="@MPICC@" mpiCC="@MPICPLUSPLUS@" mpif77="@MPIF77@" mpif90="@MPIF90@" # Create test files trap 'rm -f a.out rtest* *.o' 0 cat >> rtest.c < int main( int argc, char *argv[] ) { printf( testname ); return 0; } EOF cat >> rtest.f <> rtest.cc < int main( int argc, char *argv[] ) { cout << testname; return 0; } EOF outlog="/dev/null" cmd=mpicc if $mpicc -Dtestname=\"foo\" rtest.c > $outlog 2>&1 ; then : else echo "Error with escaped double quotes in $cmd" fi if $mpicc -Dtestname='"foo bar"' rtest.c > $outlog 2>&1 ; then : else echo "Error with double inside of single quotes in $cmd" fi # Run this test only if mpiCC is valid ( if [ "@HAS_CXX@" = "yes" ] ; then cmd=mpiCC if $mpiCC -Dtestname=\"foo\" rtest.cc > $outlog 2>&1; then : else echo "Error with escaped double quotes in $cmd" fi if $mpiCC -Dtestname='"foo bar"' rtest.cc > $outlog 2>&1 ; then : else echo "Error with double inside of single quotes in $cmd" fi fi # # No tests for Fortran yet since we don't directly support .F or .F90.