[ltrace-commits] 01/01: Fix running XDG_CONFIG_DIRS.exp with Valgrind
Petr Machata
pmachata-guest at moszumanska.debian.org
Thu Apr 16 14:16:00 UTC 2015
This is an automated email from the git hooks/post-receive script.
pmachata-guest pushed a commit to branch master
in repository ltrace.
commit 3044b19c3252df1da63bbd4b525c3c57e07dd777
Author: Роман Донченко <dpb at corrigendum.ru>
Date: Sun Apr 12 21:32:11 2015 +0300
Fix running XDG_CONFIG_DIRS.exp with Valgrind
And, as an important side effect, make sure that any special characters in
the ltrace command lines are not interpreted by Tcl or the shell.
LTRACE and VALGRIND are now considered to be lists throughout the test
scripts.
---
testsuite/lib/ltrace.exp | 12 ++++++------
testsuite/ltrace.main/XDG_CONFIG_DIRS.exp | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/testsuite/lib/ltrace.exp b/testsuite/lib/ltrace.exp
index 24a2b43..95263b9 100644
--- a/testsuite/lib/ltrace.exp
+++ b/testsuite/lib/ltrace.exp
@@ -24,14 +24,14 @@
source $objdir/env.exp
if [info exists TOOL_EXECUTABLE] {
- set LTRACE $TOOL_EXECUTABLE
+ set LTRACE [list $TOOL_EXECUTABLE]
} else {
- set LTRACE $objdir/../ltrace
+ set LTRACE [list $objdir/../ltrace]
}
if {[info exists VALGRIND] && ![string equal $VALGRIND {}]} {
verbose "Running under valgrind command: `$VALGRIND'"
- set LTRACE "$VALGRIND $LTRACE"
+ set LTRACE [concat $VALGRIND $LTRACE]
}
set LTRACE_OPTIONS {}
@@ -574,7 +574,7 @@ proc ltraceRun {args} {
# zero exit status (i.e. ltrace fails, valgrind finds errors,
# etc.).
- set command "exec env LD_LIBRARY_PATH=$LdPath $LTRACE -o $logfile $args"
+ set command [list exec env LD_LIBRARY_PATH=$LdPath {*}$LTRACE -o $logfile {*}$args]
verbose $command
if {[catch {eval $command}] } {
fail "test case execution failed"
@@ -804,8 +804,8 @@ proc ltrace_runtest { args } {
lappend LTRACE_OPTIONS "-o"
lappend LTRACE_OPTIONS "$file"
verbose "LTRACE_OPTIONS = $LTRACE_OPTIONS"
- set command "exec sh -c {export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_; \
- $LTRACE $LTRACE_OPTIONS $BIN $LTRACE_ARGS;exit}"
+ set command {exec env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_ \
+ {*}$LTRACE {*}$LTRACE_OPTIONS $BIN {*}$LTRACE_ARGS}
#ltrace the PUT.
if {[catch $command output]} {
fail "test case execution failed"
diff --git a/testsuite/ltrace.main/XDG_CONFIG_DIRS.exp b/testsuite/ltrace.main/XDG_CONFIG_DIRS.exp
index 7b2786b..a7eb8a4 100644
--- a/testsuite/ltrace.main/XDG_CONFIG_DIRS.exp
+++ b/testsuite/ltrace.main/XDG_CONFIG_DIRS.exp
@@ -24,7 +24,7 @@ setenv XDG_CONFIG_DIRS "blah"
ltraceRun -L -- $bin
unsetenv XDG_CONFIG_DIRS
-if {[catch {exec env LD_LIBRARY_PATH=[ld_library_path] $LTRACE -L -F blah -- $bin} output]} {
+if {[catch {exec env LD_LIBRARY_PATH=[ld_library_path] {*}$LTRACE -L -F blah -- $bin} output]} {
ltraceMatch [ltraceSource ltrace "$output"] {
{blah == 1}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/ltrace.git
More information about the ltrace-commits
mailing list