Fix RUNTOOL in the test-suite for php and add an example for using RUNTOOL to invoke a debugger

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12050 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-05-25 18:13:32 +00:00
commit 9f55943801
3 changed files with 15 additions and 4 deletions

View file

@ -3469,6 +3469,14 @@ SWIG can be analyzed for bad memory accesses using:
make ret_by_value.ctest SWIGTOOL="valgrind --tool=memcheck --trace-children=yes" make ret_by_value.ctest SWIGTOOL="valgrind --tool=memcheck --trace-children=yes"
</pre></div> </pre></div>
<p>
A debugger can also be invoked easily on an individual test, for example gdb:
</p>
<div class="shell"><pre>
make ret_by_value.ctest RUNTOOL="gdb --args"
</pre></div>
<H3><a name="Extending_nn43"></a>35.10.13 Documentation</H3> <H3><a name="Extending_nn43"></a>35.10.13 Documentation</H3>

View file

@ -29,14 +29,17 @@
# #
# Note that the RUNTOOL, COMPILETOOL and SWIGTOOL variables can be used # Note that the RUNTOOL, COMPILETOOL and SWIGTOOL variables can be used
# for invoking tools for the runtime tests and target language # for invoking tools for the runtime tests and target language
# compiler (eg javac) respectively. For example, valgrind can be used # compiler (eg javac), and on SWIG respectively. For example, valgrind
# for memory checking of the runtime tests using: # can be used for memory checking of the runtime tests using:
# make RUNTOOL="valgrind --leak-check=full" # make RUNTOOL="valgrind --leak-check=full"
# and valgrind can be used when invoking SWIG using: # and valgrind can be used when invoking SWIG using:
# make SWIGTOOL="valgrind --tool=memcheck --trace-children=yes" # make SWIGTOOL="valgrind --tool=memcheck --trace-children=yes"
# Note: trace-children needed because of preinst-swig shell wrapper # Note: trace-children needed because of preinst-swig shell wrapper
# to the swig executable. # to the swig executable.
# #
# An individual test run can be debugged easily:
# make director_string.cpptest RUNTOOL="gdb --args"
#
# The variables below can be overridden after including this makefile # The variables below can be overridden after including this makefile
####################################################################### #######################################################################

View file

@ -48,9 +48,9 @@ missingtests: missingcpptests missingctests
# found, runs testcase.php, except for multicpptests. # found, runs testcase.php, except for multicpptests.
run_testcase = \ run_testcase = \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHPSCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) RUNTOOL=$(RUNTOOL) php_run; \ $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHPSCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) RUNTOOL="$(RUNTOOL)" php_run; \
elif [ -f $(srcdir)/$(SCRIPTPREFIX)$*.php -a ! -f $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list ]; then \ elif [ -f $(srcdir)/$(SCRIPTPREFIX)$*.php -a ! -f $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list ]; then \
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHPSCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*.php RUNTOOL=$(RUNTOOL) php_run; \ $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHPSCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*.php RUNTOOL="$(RUNTOOL)" php_run; \
fi fi
# Clean: remove the generated .php file # Clean: remove the generated .php file