From: <ai...@us...> - 2009-01-30 00:34:38
|
Revision: 9415 http://plplot.svn.sourceforge.net/plplot/?rev=9415&view=rev Author: airwin Date: 2009-01-30 00:34:33 +0000 (Fri, 30 Jan 2009) Log Message: ----------- Implement ctest for Lua. Modified Paths: -------------- trunk/plplot_test/CMakeLists.txt trunk/plplot_test/plplot-test.sh.cmake trunk/plplot_test/test_diff.sh.in Added Paths: ----------- trunk/plplot_test/test_lua.sh.in Modified: trunk/plplot_test/CMakeLists.txt =================================================================== --- trunk/plplot_test/CMakeLists.txt 2009-01-29 22:48:54 UTC (rev 9414) +++ trunk/plplot_test/CMakeLists.txt 2009-01-30 00:34:33 UTC (rev 9415) @@ -160,6 +160,18 @@ ) endif(ENABLE_ocaml) + if(ENABLE_lua) + configure_file( + test_lua.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/test_lua.sh + @ONLY + ) + list(APPEND SCRIPTS test_lua.sh) + add_test(examples_lua + ${SH_EXECUTABLE} -c "${TEST_ENVIRONMENT} ${TEST_SCRIPT_DEVICE} --front-end=lua" + ) + endif(ENABLE_lua) + # Run C examples with different drivers if(PLD_psc) if (NOT TEST_DEVICE STREQUAL "psc") Modified: trunk/plplot_test/plplot-test.sh.cmake =================================================================== --- trunk/plplot_test/plplot-test.sh.cmake 2009-01-29 22:48:54 UTC (rev 9414) +++ trunk/plplot_test/plplot-test.sh.cmake 2009-01-30 00:34:33 UTC (rev 9415) @@ -47,7 +47,7 @@ Options: [--device=DEVICE] (DEVICE = any cmake-enabled device. psc is the default) - [--front-end=FE] (FE = one of c, cxx, f77, f95 java, octave, python, tcl, perl, ada, or ocaml) + [--front-end=FE] (FE = one of c, cxx, f77, f95 java, octave, python, tcl, perl, ada, ocaml, or lua) If this option is not specified, then all front-ends will be tested. More than one front-end may be given, like this --front-end="c cxx" @@ -114,6 +114,7 @@ -o $i = "perl" \ -o $i = "ada" \ -o $i = "ocaml" \ + -o $i = "lua" \ ] \ || usage 0 1>&2 done @@ -167,6 +168,7 @@ javadir=$EXAMPLES_DIR/java adadir=$EXAMPLES_DIR/ada ocamldir=$EXAMPLES_DIR/ocaml +luadir=$EXAMPLES_DIR/lua octave=@OCTAVE@ octavedir=\ $EXAMPLES_DIR/../bindings/octave:\ @@ -180,7 +182,7 @@ @OCTAVE_M_DIR@/PLplot:\ @OCTAVE_OCT_DIR@: PATH=$EXAMPLES_DIR/../utils:@BIN_DIR@:$PATH -export cdir cxxdir f77dir f95dir pythondir javadir octave octavedir tcldir perldir adadir ocamldir PATH +export cdir cxxdir f77dir f95dir pythondir javadir octave octavedir tcldir perldir adadir ocamldir luadir PATH fe="" @@ -292,6 +294,7 @@ 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" + test "@ENABLE_lua@" = "ON" && FRONT_END="$FRONT_END lua" fi # Find where the front-end scripts are by looking at the directory name of the Modified: trunk/plplot_test/test_diff.sh.in =================================================================== --- trunk/plplot_test/test_diff.sh.in 2009-01-29 22:48:54 UTC (rev 9414) +++ trunk/plplot_test/test_diff.sh.in 2009-01-30 00:34:33 UTC (rev 9415) @@ -25,8 +25,8 @@ xsuffix_c= # Compare C results with c++, f77, f95, java, octave, python, tcl, perl, -# ada and ocaml results -for lang in c++ f77 f95 java octave python tcl perl ada adathick ocaml ; do +# ada, ocaml, and lua results +for lang in c++ f77 f95 java octave python tcl perl ada adathick ocaml lua; do # Check which suffix is used for this binding case $lang in @@ -74,6 +74,10 @@ xsuffix= suffix=ocaml ;; + lua) + xsuffix= + suffix=lua + ;; esac missing="" Added: trunk/plplot_test/test_lua.sh.in =================================================================== --- trunk/plplot_test/test_lua.sh.in (rev 0) +++ trunk/plplot_test/test_lua.sh.in 2009-01-30 00:34:33 UTC (rev 9415) @@ -0,0 +1,61 @@ +#!@SH_EXECUTABLE@ +# Test suite for lua examples. +# +# Copyright (C) 2008 Andrew Ross +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Library Public License as published +# by the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# This is called from plplot-test.sh with $luadir, $device, $dsuffix, +# $options, and possibly $verbose_test defined. + +# Do the standard non-interactive examples. +lang="lua" +# Lua examples must be run from the directory where they exist. +cd $OUTPUT_DIR +results=`pwd` +export results +echo $results +cd $luadir +# 01, 08, 09, 15, 16, 19, 22, 25, 30 are implemented but do not currently work. +# 14, 17, 20, 21, 23, 26, 27, 28, 29, 31 are not implemented. +for index in 02 03 04 05 06 07 10 11 12 13 18 24; do + if [ "$verbose_test" ] ; then + echo "x${index}" + fi + if [ "$index" = "14" ] ; then + echo ${results}/x${index}a${lang}%n.$dsuffix | \ + lua x${index}.${lang} -dev $device -o ${results}/x${index}${lang}%n.$dsuffix \ + $options 2> test.error >| ${results}/x${index}${lang}_${dsuffix}.txt + # Look for any status codes (segfaults, plexit) from the examples themselves. + status_code=$? + else + lua x${index}.${lang} -dev $device -o ${results}/x${index}${lang}%n.$dsuffix \ + $options 2> test.error >| ${results}/x${index}${lang}_${dsuffix}.txt + # Look for any status codes (segfaults, plexit) from the examples themselves. + status_code=$? + fi + cat test.error + if [ "$status_code" -ne 0 ] ; then + exit $status_code + fi + # Look for any PLPLOT ERROR messages from plwarn that do not result in an + # exit code. + is_error=`grep -l 'PLPLOT ERROR' test.error` + if [ -n "$is_error" ] ; then + exit 1 + fi +done Property changes on: trunk/plplot_test/test_lua.sh.in ___________________________________________________________________ Added: svn:executable + * Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |