|
From: <and...@us...> - 2008-10-29 15:32:47
|
Revision: 8982
http://plplot.svn.sourceforge.net/plplot/?rev=8982&view=rev
Author: andrewross
Date: 2008-10-29 15:32:38 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
Initial support for valgrind (or other debugger / memory checker) in
plplot-test.sh. Currently only enabled for the c tests. Adding the
--debug option to plplot-test.sh will run each example through
valgrind and generate a separate log file containing the output.
Alternative debugging commands can be specified using the --debug=*
version of the option.
Modified Paths:
--------------
trunk/plplot_test/plplot-test.sh.cmake
trunk/plplot_test/test_c.sh.in
Modified: trunk/plplot_test/plplot-test.sh.cmake
===================================================================
--- trunk/plplot_test/plplot-test.sh.cmake 2008-10-29 15:13:39 UTC (rev 8981)
+++ trunk/plplot_test/plplot-test.sh.cmake 2008-10-29 15:32:38 UTC (rev 8982)
@@ -37,8 +37,9 @@
EXAMPLES_DIR=${EXAMPLES_DIR:-.}
SRC_EXAMPLES_DIR=${SRC_EXAMPLES_DIR:-.}
OUTPUT_DIR=${OUTPUT_DIR:-.}
+DEBUG_CMD=${DEBUG_CMD:-.}
device=${DEVICE:-psc}
-export EXAMPLES_DIR SRC_EXAMPLES_DIR OUTPUT_DIR device
+export EXAMPLES_DIR SRC_EXAMPLES_DIR OUTPUT_DIR device DEBUG_CMD
usage()
{
@@ -59,6 +60,9 @@
Specify location where the resulting files are stored.
Defaults to "."
[--verbose] Echo each PLplot example that is executed.
+ [--debug="debug command"]
+ Run examples with given debug command.
+ [--debug] Run examples with default debug command (valgrind).
[--version]
[--help]
@@ -123,6 +127,12 @@
--output-dir=*)
OUTPUT_DIR=$optarg
;;
+ --debug=*)
+ DEBUG_CMD=$optarg
+ ;;
+ --debug)
+ DEBUG_CMD="valgrind --leak-check=full --show-reachable=yes --log-file=valgrind.x%q{index}%q{lang}.%q{dsuffix}.log"
+ ;;
--help)
usage 0 1>&2
;;
Modified: trunk/plplot_test/test_c.sh.in
===================================================================
--- trunk/plplot_test/test_c.sh.in 2008-10-29 15:13:39 UTC (rev 8981)
+++ trunk/plplot_test/test_c.sh.in 2008-10-29 15:32:38 UTC (rev 8982)
@@ -29,12 +29,14 @@
# Do the standard non-interactive examples.
# skip 14 because it requires two output files.
# skip 17 because it is interactive.
+lang="c"
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; do
if [ "$verbose_test" ]; then
- echo "x${index}c"
+ echo "x${index}${lang}"
fi
- $cdir/x${index}c -dev $device -o ${OUTPUT_DIR}/x${index}c%n.$dsuffix \
+ export index lang dsuffix
+ $DEBUG_CMD $cdir/x${index}${lang} -dev $device -o ${OUTPUT_DIR}/x${index}${lang}%n.$dsuffix \
$options 2> test.error
# Look for any status codes (segfaults, plexit) from the examples themselves.
status_code=$?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|