Blob Blame History Raw
--- plplot-5.9.2/plplot_test/plplot-test.sh.cmake.test	2009-01-18 13:24:12.000000000 -0700
+++ plplot-5.9.2/plplot_test/plplot-test.sh.cmake	2009-02-13 16:04:24.000000000 -0700
@@ -34,8 +34,9 @@
 
 version=@VERSION@
 
-EXAMPLES_DIR=${EXAMPLES_DIR:-.}
-SRC_EXAMPLES_DIR=${SRC_EXAMPLES_DIR:-.}
+EXE_DIR=`dirname $0`
+EXAMPLES_DIR=${EXAMPLES_DIR:=$EXE_DIR}
+SRC_EXAMPLES_DIR=${SRC_EXAMPLES_DIR:=$EXE_DIR}
 OUTPUT_DIR=${OUTPUT_DIR:-.}
 device=${DEVICE:-psc}
 export EXAMPLES_DIR SRC_EXAMPLES_DIR OUTPUT_DIR device DEBUG_CMD
@@ -143,18 +144,6 @@
    shift
 done
 
-# This script is only designed to work when EXAMPLES_DIR is a directory
-# with a subdirectory called "c".  Check whether this conditions is true.
-
-if [ ! -d $EXAMPLES_DIR/c ] ; then
-echo '
-This script is only designed to work when the EXAMPLES_DIR environment
-variable (overridden by option --examples-dir) is a directory with a
-subdirectory called "c".  This condition has been violated.
-'
-exit 1
-fi
-
 # These variables set by default assuming you are going to run this
 # script from the installed demos directory $prefix/lib/plplot$version/examples.
 cdir=$EXAMPLES_DIR/c
@@ -279,19 +268,17 @@
 dsuffix=$device
 export dsuffix options
 
-# Find out what front-ends have been configured
+# Find out what front-ends have been configured and installed
 if [ -z "$FRONT_END" ] ; then
-   FRONT_END=c
-   test "@ENABLE_cxx@" = "ON" && FRONT_END="$FRONT_END cxx"
-   test "@ENABLE_f77@" = "ON"    && FRONT_END="$FRONT_END f77"
-   test "@ENABLE_f95@" = "ON"    && FRONT_END="$FRONT_END f95"
-   test "@ENABLE_java@" = "ON"   && FRONT_END="$FRONT_END java"
-   test "@ENABLE_octave@" = "ON" && FRONT_END="$FRONT_END octave"
-   test "@ENABLE_python@" = "ON" && FRONT_END="$FRONT_END python"
-   test "@ENABLE_tcl@" = "ON"    && FRONT_END="$FRONT_END tcl"
-   test "@ENABLE_pdl@" = "ON"    && FRONT_END="$FRONT_END perl"
-   test "@ENABLE_ada@" = "ON"    && FRONT_END="$FRONT_END ada"
-   test "@ENABLE_ocaml@" = "ON"  && FRONT_END="$FRONT_END ocaml"
+   for front_end_status in c:@ENABLE_c@ cxx:@ENABLE_cxx@ f77:@ENABLE_f77@ \
+                           f95:@ENABLE_f95@ java:@ENABLE_java@ \
+                           octave:@ENABLE_octave@ python:@ENABLE_python@ \
+                           tcl:@ENABLE_tcl@ perl:@ENABLE_perl@ \
+                           ada:@ENABLE_ada@ ocaml:@ENABLE_ocaml@
+   do
+      front_end=${front_end_status/:ON/}
+      [ $front_end != $front_end_status ] && [ -d $EXAMPLES_DIR/$front_end ] && FRONT_END="$FRONT_END $front_end"
+   done
 fi
 
 # Find where the front-end scripts are by looking at the directory name of the
@@ -309,9 +296,6 @@
 for i in $FRONT_END ; do
    echo "Testing front-end $i"
    script=$scripts_dir/test_$i.sh
-   if [ "@WIN32@" != "1" ] ; then
-      chmod +x $script
-   fi
    @SH_EXECUTABLE@ $script || status=1
 done