summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-28 14:15:20 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-28 14:15:20 (GMT)
commit4f253f35d890f5474c5652070916df0cee97a89b (patch)
tree4497d6af838c5bfafb75c46980bdf439dbae6f09
parentded8a3b16193d5da03f68f3de98b05521db93b8a (diff)
downloadtcl-4f253f35d890f5474c5652070916df0cee97a89b.zip
tcl-4f253f35d890f5474c5652070916df0cee97a89b.tar.gz
tcl-4f253f35d890f5474c5652070916df0cee97a89b.tar.bz2
[FRQ 1083288]: Added targets to allow easier tracing of shell/test invokations
-rw-r--r--ChangeLog3
-rw-r--r--unix/Makefile.in45
2 files changed, 30 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index e07be42..02203eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2009-12-28 Donal K. Fellows <dkf@users.sf.net>
+ * unix/Makefile.in (trace-shell, trace-test): [FRQ 1083288]: Added
+ targets to allow easier tracing of shell and test invokations.
+
* unix/configure.in: [Bug 942170]: Detect the st_blocks field of
* generic/tclCmdAH.c (StoreStatData): 'struct stat' correctly.
* generic/tclFileName.c (Tcl_GetBlocksFromStat):
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 7406937..81fb07b 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -4,7 +4,7 @@
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.287 2009/12/23 07:10:05 nijtmans Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.288 2009/12/28 14:15:20 dkf Exp $
VERSION = @TCL_VERSION@
MAJOR_VERSION = @TCL_MAJOR_VERSION@
@@ -166,6 +166,7 @@ INSTALL_DATA = ${INSTALL} -m 644
# normal build although it can be required to run make dist.
EXE_SUFFIX = @EXE_SUFFIX@
TCL_EXE = tclsh${EXE_SUFFIX}
+TCLTEST_EXE = tcltest${EXE_SUFFIX}
# The symbols below provide support for dynamic loading and shared libraries.
# See configure.in for a description of what the symbols mean. The values of
@@ -260,6 +261,10 @@ INSTALL_TZDATA = @INSTALL_TZDATA@
GDB = gdb
DDD = ddd
+TRACE = strace
+TRACE_OPTS =
+VALGRIND = valgrind
+VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v
#--------------------------------------------------------------------------
# The information below should be usable as is. The configure script won't
@@ -625,7 +630,7 @@ Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in
clean: clean-packages
rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
- errors ${TCL_EXE} tcltest${EXE_SUFFIX} lib.exp Tcl @DTRACE_HDR@
+ errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@
cd dltest ; $(MAKE) clean
distclean: distclean-packages clean
@@ -660,12 +665,12 @@ SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \
TCLLIBPATH="@abs_builddir@/pkgs" \
TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"
-tcltest${EXE_SUFFIX}: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST}
+${TCLTEST_EXE}: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${BUILD_DLTEST}
$(MAKE) tcltest-real LIB_RUNTIME_DIR="`pwd`"
tcltest-real:
${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \
- ${CC_SEARCH_FLAGS} -o tcltest${EXE_SUFFIX}
+ ${CC_SEARCH_FLAGS} -o ${TCLTEST_EXE}
# Note, in the targets below TCL_LIBRARY needs to be set or else "make test"
# won't work in the case where the compilation directory isn't the same as the
@@ -677,24 +682,24 @@ tcltest-real:
test: test-tcl test-packages
-test-tcl: tcltest${EXE_SUFFIX}
- $(SHELL_ENV) ./tcltest${EXE_SUFFIX} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+test-tcl: ${TCLTEST_EXE}
+ $(SHELL_ENV) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
-gdb-test: tcltest${EXE_SUFFIX}
+gdb-test: ${TCLTEST_EXE}
@echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run
@echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
@echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run
- $(GDB) ./tcltest${EXE_SUFFIX} --command=gdb.run
+ $(GDB) ./${TCLTEST_EXE} --command=gdb.run
rm gdb.run
# Useful target to launch a built tcltest with the proper path,...
-runtest: tcltest${EXE_SUFFIX}
- $(SHELL_ENV) ./tcltest${EXE_SUFFIX}
+runtest: ${TCLTEST_EXE}
+ $(SHELL_ENV) ./${TCLTEST_EXE}
# Useful target for running the test suite with an unwritable current
# directory...
-ro-test: tcltest${EXE_SUFFIX}
- echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./tcltest${EXE_SUFFIX}
+ro-test: ${TCLTEST_EXE}
+ echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE}
# The following target generates the shared libraries in dltest/ that are used
# for testing; they are included as part of the "tcltest" target (via the
@@ -722,13 +727,17 @@ gdb: ${TCL_EXE}
ddd: ${TCL_EXE}
$(SHELL_ENV) $(DDD) ./${TCL_EXE}
-VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v
-
-valgrind: ${TCL_EXE} tcltest${EXE_SUFFIX}
- $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tcltest${EXE_SUFFIX} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
+valgrind: ${TCL_EXE} ${TCLTEST_EXE}
+ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
valgrindshell: ${TCL_EXE}
- $(SHELL_ENV) valgrind $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT)
+ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT)
+
+trace-shell: ${TCL_EXE}
+ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCL_EXE} $(SCRIPT)
+
+trace-test: ${TCLTEST_EXE}
+ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
#--------------------------------------------------------------------------
# Installation rules
@@ -1674,7 +1683,7 @@ test-packages: tcltest packages
"@LD_LIBRARY_PATH_VAR@=../..:$${@LD_LIBRARY_PATH_VAR@}" \
"TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" \
"TCLLIBPATH=../../pkgs" test \
- "TCLSH_PROG=../../tcltest${EXE_SUFFIX}"; ) \
+ "TCLSH_PROG=../../${TCLTEST_EXE}"; ) \
fi; \
fi; \
done