From: <and...@us...> - 2008-12-17 15:35:50
|
Revision: 9164 http://plplot.svn.sourceforge.net/plplot/?rev=9164&view=rev Author: andrewross Date: 2008-12-17 15:35:45 +0000 (Wed, 17 Dec 2008) Log Message: ----------- Update test scripts to pipe stdout to a file as well as to the screen. Update compare test to check that output is the same as the C versions of the examples. Particularly useful for testing the output from example 31. This commit also fixes a bug in test_java.sh.in with = used instead of == for a bash string comparison. Modified Paths: -------------- trunk/cmake/modules/plplot.cmake trunk/plplot_test/test_ada.sh.in trunk/plplot_test/test_c.sh.in trunk/plplot_test/test_cxx.sh.in trunk/plplot_test/test_diff.sh.in trunk/plplot_test/test_f77.sh.in trunk/plplot_test/test_f95.sh.in trunk/plplot_test/test_java.sh.in trunk/plplot_test/test_ocaml.sh.in trunk/plplot_test/test_octave.sh.in trunk/plplot_test/test_perl.sh.in trunk/plplot_test/test_python.sh.in trunk/plplot_test/test_tcl.sh.in Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/cmake/modules/plplot.cmake 2008-12-17 15:35:45 UTC (rev 9164) @@ -73,11 +73,18 @@ ) endif(NOT SH_EXECUTABLE) -# Find diff and tail which are used to compare results from different +# Find diff, tail and tee which are used to compare results from different # bindings. find_program(DIFF_EXECUTABLE diff) find_program(TAIL_EXECUTABLE tail) +find_program(TEE_EXECUTABLE tee) +if(TEE_EXECUTABLE) + set(TEE_CMD "| ${TEE_EXECUTABLE} ") +else(TEE_EXECUTABLE) + set(TEE_CMD "> ") +endif(TEE_EXECUTABLE) + option(PREBUILD_DIST "Pre-build all components required for distribution" OFF) if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") set( Modified: trunk/plplot_test/test_ada.sh.in =================================================================== --- trunk/plplot_test/test_ada.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_ada.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -29,6 +29,7 @@ # Do the standard non-interactive examples. # Skip 14 because it requires two output files. # Skip 17 because it is interactive. +lang="a" for index in \ 01 02 03 04 05 06 07 08 09 \ 10 11 12 13 15 16 18 19 20 \ @@ -37,9 +38,9 @@ thick10 thick11 thick12 thick13 thick15 thick16 thick18 thick19 thick20 \ thick21 thick22 thick23 thick24 thick25 thick26 thick27 thick28 thick29 thick30; do if [ "$verbose_test" ]; then - echo "x${index}a" + echo "x${index}" fi - $adadir/x${index}a -dev $device -o ${OUTPUT_DIR}/x${index}a%n.$dsuffix $options 2> test.error + $adadir/x${index}${lang} -dev $device -o ${OUTPUT_DIR}/x${index}${lang}%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt status_code=$? cat test.error if [ "$status_code" -ne 0 ]; then Modified: trunk/plplot_test/test_c.sh.in =================================================================== --- trunk/plplot_test/test_c.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_c.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -37,7 +37,7 @@ echo "x${index}${lang}" fi $DEBUG_CMD $cdir/x${index}${lang} -dev $device -o ${OUTPUT_DIR}/x${index}${lang}%n.$dsuffix \ - $options 2> test.error + $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt # Look for any status codes (segfaults, plexit) from the examples themselves. status_code=$? cat test.error Modified: trunk/plplot_test/test_cxx.sh.in =================================================================== --- trunk/plplot_test/test_cxx.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_cxx.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -42,7 +42,7 @@ if [ "$verbose_test" ]; then echo "x${index}" fi - $DEBUG_CMD $cxxdir/x${index} -dev $device -o ${OUTPUT_DIR}/x${index}cxx%n.$dsuffix $options 2> test.error + $DEBUG_CMD $cxxdir/x${index} -dev $device -o ${OUTPUT_DIR}/x${index}cxx%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt status_code=$? cat test.error if [ "$status_code" -ne 0 ]; then Modified: trunk/plplot_test/test_diff.sh.in =================================================================== --- trunk/plplot_test/test_diff.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_diff.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -62,6 +62,8 @@ missing="" different="" + diffstdout="" + missingstdout="" # Assume that if example 1 is missing then the language is # not implemented. @@ -84,13 +86,23 @@ if [ $? != 0 ] ; then different="${different} ${index}" fi + if [ -f x${index}${suffix}_psc.txt ] ; then + @DIFF_EXECUTABLE@ -q x${index}c_psc.txt x${index}${suffix}_psc.txt 2>&1 > /dev/null + if [ $? != 0 ] ; then + diffstdout="${diffstdout} ${index}" + fi + else + missingstdout="${missingstdout} ${index}" + fi fi fi done echo "${lang}" - echo " Missing examples : ${missing}" - echo " Differing examples : ${different}" - if [ "${different}" != "" ] ; then + echo " Missing examples : ${missing}" + echo " Differing postscript output : ${different}" + echo " Missing stdout : ${missingstdout}" + echo " Differing stdout : ${diffstdout}" + if [ "${different}" != "" ] || [ ${diffstdout} != "" ] ; then ret=1 fi fi Modified: trunk/plplot_test/test_f77.sh.in =================================================================== --- trunk/plplot_test/test_f77.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_f77.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -59,7 +59,7 @@ if [ "$verbose_test" ]; then echo "x${index}f" fi - $DEBUG_CMD $f77dir/x${index}f -dev $device -o ${OUTPUT_DIR}/x${index}f%n.$dsuffix $options 2> test.error + $DEBUG_CMD $f77dir/x${index}f -dev $device -o ${OUTPUT_DIR}/x${index}f%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt status_code=$? cat test.error if [ "$status_code" -ne 0 ]; then @@ -82,7 +82,7 @@ if [ "$verbose_test" ]; then echo "x16af" fi - $DEBUG_CMD $f77dir/x16af <<EOF 2> test.error + $DEBUG_CMD $f77dir/x16af <<EOF 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt $device ${OUTPUT_DIR}/x16af%n.$dsuffix EOF @@ -104,7 +104,7 @@ if [ "$verbose_test" ]; then echo "x${index}f" fi - $DEBUG_CMD $f77dir/x${index}f <<EOF 2> test.error + $DEBUG_CMD $f77dir/x${index}f <<EOF 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt $device ${OUTPUT_DIR}/x${index}f%n.$dsuffix EOF Modified: trunk/plplot_test/test_f95.sh.in =================================================================== --- trunk/plplot_test/test_f95.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_f95.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -40,7 +40,7 @@ if [ "$verbose_test" ]; then echo "x16af" fi - $DEBUG_CMD $f95dir/x16af -dev $device -o ${OUTPUT_DIR}/x16af95%n.$dsuffix $options 2> test.error + $DEBUG_CMD $f95dir/x16af -dev $device -o ${OUTPUT_DIR}/x16af95%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt status_code=$? cat test.error if [ "$status_code" -ne 0 ]; then @@ -60,7 +60,7 @@ if [ "$verbose_test" ]; then echo "x${index}f" fi - $DEBUG_CMD $f95dir/x${index}f -dev $device -o ${OUTPUT_DIR}/x${index}f95%n.$dsuffix $options 2> test.error + $DEBUG_CMD $f95dir/x${index}f -dev $device -o ${OUTPUT_DIR}/x${index}f95%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt status_code=$? cat test.error if [ "$status_code" -ne 0 ]; then @@ -82,7 +82,7 @@ if [ "$verbose_test" ]; then echo "x16af" fi - $DEBUG_CMD $f95dir/x16af <<EOF 2> test.error + $DEBUG_CMD $f95dir/x16af <<EOF 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt $device ${OUTPUT_DIR}/x16af95%n.$dsuffix EOF @@ -105,7 +105,7 @@ if [ "$verbose_test" ]; then echo "x${index}f" fi - $DEBUG_CMD $f95dir/x${index}f <<EOF 2> test.error + $DEBUG_CMD $f95dir/x${index}f <<EOF 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt $device ${OUTPUT_DIR}/x${index}f95%n.$dsuffix EOF Modified: trunk/plplot_test/test_java.sh.in =================================================================== --- trunk/plplot_test/test_java.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_java.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -36,6 +36,7 @@ # skip 17 because it is interactive and not implemented. # # Set up option to point to java bindings jar file and wrapper if needed. +lang="j" if test -n "$PLPLOT_JAVA_WRAP_DIR" ; then JAVA_TEST_OPTS="-Dplplot.libdir=$PLPLOT_JAVA_WRAP_DIR" fi @@ -45,12 +46,12 @@ for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 20 21 22 23 24 25 26 27 28 29 30 31 ; do if [ "$verbose_test" ]; then - echo "x${index}j" + echo "x${index}" fi - if test "@WIN32@" = "1"; then - java -classpath ${PLPLOT_CLASSPATH} ${JAVA_TEST_OPTS} plplot.examples.x${index} -dev $device -o ${OUTPUT_DIR}/x${index}j%n.$dsuffix $options 2> test.error + if test "@WIN32@" == "1"; then + java -classpath ${PLPLOT_CLASSPATH} ${JAVA_TEST_OPTS} plplot.examples.x${index} -dev $device -o ${OUTPUT_DIR}/x${index}${lang}%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt else - java -classpath ${javadir}:${PLPLOT_CLASSPATH} ${JAVA_TEST_OPTS} plplot.examples.x${index} -dev $device -o ${OUTPUT_DIR}/x${index}j%n.$dsuffix $options 2> test.error + java -classpath ${javadir}:${PLPLOT_CLASSPATH} ${JAVA_TEST_OPTS} plplot.examples.x${index} -dev $device -o ${OUTPUT_DIR}/x${index}${lang}%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt fi status_code=$? cat test.error Modified: trunk/plplot_test/test_ocaml.sh.in =================================================================== --- trunk/plplot_test/test_ocaml.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_ocaml.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -23,12 +23,13 @@ # $options, and possibly $verbose_test defined. # Do the standard non-interactive examples. +lang="ocaml" for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do if [ "$verbose_test" ]; then echo "x${index}ocaml" fi - $ocamldir/x${index}ocaml -dev $device -o ${OUTPUT_DIR}/x${index}ocaml%n.$dsuffix \ - $options 2> test.error + $ocamldir/x${index}ocaml -dev $device -o ${OUTPUT_DIR}/x${index}${ocaml}%n.$dsuffix \ + $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt # Look for any status codes (segfaults, plexit) from the examples themselves. status_code=$? cat test.error Modified: trunk/plplot_test/test_octave.sh.in =================================================================== --- trunk/plplot_test/test_octave.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_octave.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -26,6 +26,8 @@ # The following is only need for the build tree! It should has no effect # when this script is launched from the install tree. +lang="o" +export lang TOPDIR=`pwd`/.. echo $TOPDIR export LD_LIBRARY_PATH=$TOPDIR/src:$TOPDIR/lib/csa:$TOPDIR/lib/nn @@ -88,7 +90,7 @@ plSetOpt("dev", device); #o trailer on filename e.g., x01o.ps) to distinguish from other #common examples. - file = sprintf("${OUTPUT_DIR}/x%.2do%%n.$dsuffix",i); + file = sprintf("${OUTPUT_DIR}/x%.2d${lang}%%n.$dsuffix",i); plSetOpt("o", file); eval(cmd, "failed = [failed, i];"); endfor Modified: trunk/plplot_test/test_perl.sh.in =================================================================== --- trunk/plplot_test/test_perl.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_perl.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -31,6 +31,7 @@ # Ensure correct version of the libraries are picked up in both the build # tree and install tree. +lang="pdl" if [ "$LD_LIBRARY_PATH" == "" ] ; then export LD_LIBRARY_PATH=../src:@LIB_DIR@ else @@ -49,7 +50,7 @@ if [ "$verbose_test" ]; then echo "x${index}.pl" fi - $perldir/x${index}.pl -dev $device -o ${OUTPUT_DIR}/x${index}pdl%n.$dsuffix $options 2> test.error + $perldir/x${index}.pl -dev $device -o ${OUTPUT_DIR}/x${index}${lang}%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt status_code=$? cat test.error if [ "$status_code" -ne 0 ]; then Modified: trunk/plplot_test/test_python.sh.in =================================================================== --- trunk/plplot_test/test_python.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_python.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -31,12 +31,13 @@ # Skip 20 because it is not (yet) implemented. # Skip 21 if using Numeric - it doesn't work # For 24 you need special fonts installed to get good result. +lang="p" for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 \ 20 22 23 24 25 26 27 28 29 30 31 @NUMPY_EXAMPLES@ ; do if [ "$verbose_test" ]; then echo "x${index}" fi - @PYTHON_EXECUTABLE@ $pythondir/x$index -dev $device -o ${OUTPUT_DIR}/x${index}p%n.$dsuffix $options 2> test.error + @PYTHON_EXECUTABLE@ $pythondir/x$index -dev $device -o ${OUTPUT_DIR}/x${index}${lang}%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt status_code=$? cat test.error if [ "$status_code" -ne 0 ]; then Modified: trunk/plplot_test/test_tcl.sh.in =================================================================== --- trunk/plplot_test/test_tcl.sh.in 2008-12-17 13:02:59 UTC (rev 9163) +++ trunk/plplot_test/test_tcl.sh.in 2008-12-17 15:35:45 UTC (rev 9164) @@ -23,7 +23,7 @@ # This is called from plplot-test.sh with $tcldir, $device, $dsuffix, # $options, and possibly $verbose_test defined. - +lang="t" cd $OUTPUT_DIR results=`pwd` export results @@ -79,7 +79,7 @@ if [ "$verbose_test" ]; then echo "x${index}" fi - ./x${index} -dev $device -o $results/x${index}t%n.$dsuffix $options 2> test.error + ./x${index} -dev $device -o $results/x${index}${lang}%n.$dsuffix $options 2> test.error @TEE_CMD@ ${OUTPUT_DIR}/x${index}${lang}_${dsuffix}.txt status_code=$? cat test.error if [ "$status_code" -ne 0 ]; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |