#!/bin/csh -f
##### 
##   Sung-Hoon Ko
##   4/11/98
#####


# Run synthetic test cases
 
set sources = (cart.java dimscreate.java graph.java map.java sub.java)
          
 
set nprocs  = (6 4 4 2 6)

set mpiJavaHome = @top_srcdir@
set mpiJavaClasses = @top_srcdir@/lib/classes

set JAVA_PATH = @JAVA@

set CLASS_PATH = "-classpath .:${mpiJavaClasses}:${JAVA_PATH}/lib/classes.zip:${JAVA_PATH}/classes:/project/pss_shko/mpiJava/V0.9/tests/simple"
set JAVA_C = "${JAVA_PATH}/bin/javac ${CLASS_PATH}"
set JAVA_RUN = "${JAVA_PATH}/bin/java ${CLASS_PATH}"

cat > diffs <<.
.

set CWD = `pwd`
foreach source ($sources)
  echo ...Compiling : {$CWD:t}/${source}
  ${JAVA_C} $source

  set executable=${source:r}
  if ( -f ./$executable.jig ) then
    rm -f ./$executable.jig
  endif
  echo .....Running : prunjava ${nprocs[1]} $executable
  $mpiJavaHome/src/scripts/prunjava ${nprocs[1]} $executable | tee ${executable}.out
  if ( -f ${executable}.out.sample ) then
    echo .....diff ${executable}.out ${executable}.out.sample
    cat >> diffs <<.
diff ${executable}.out ${executable}.out.sample
.
    diff ${executable}.out ${executable}.out.sample | tee -a diffs
  else
    echo .....${executable}.out.sample absent.  Recreated.
    cp ${executable}.out ${executable}.out.sample
  endif
  rm -f ${executable}.class
  shift nprocs
end


