summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-11-06 12:10:18 +0100
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:23 +0900
commit5edb66dfcbba091abc99e8d925141fe507322e83 (patch)
tree4141c9ec95f2ecb76f3ad4acc7cb886502f6e729 /testsuite
parent23040c1b38cbc4488dd1c9877b3195b43c6fd0e0 (diff)
downloadltrace-5edb66dfcbba091abc99e8d925141fe507322e83.tar.gz
ltrace-5edb66dfcbba091abc99e8d925141fe507322e83.tar.bz2
ltrace-5edb66dfcbba091abc99e8d925141fe507322e83.zip
Support pre-8.5 TCL's by providing our own lreverse in ltrace.exp
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/lib/ltrace.exp12
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/lib/ltrace.exp b/testsuite/lib/ltrace.exp
index 494b3c8..abb32f6 100644
--- a/testsuite/lib/ltrace.exp
+++ b/testsuite/lib/ltrace.exp
@@ -38,6 +38,18 @@ set LTRACE_OPTIONS {}
set LTRACE_ARGS {}
set LTRACE_TEMP_FILES {}
+# Pre-8.5 TCL doesn't have lreverse. The following is taken from:
+# http://www2.tcl.tk/17188
+
+if {[info command lreverse] == ""} {
+ proc lreverse l {
+ set r {}
+ set i [llength $l]
+ while {[incr i -1]} {lappend r [lindex $l $i]}
+ lappend r [lindex $l 0]
+ }
+}
+
# ltrace_compile SOURCE DEST TYPE OPTIONS
#
# Compile PUT(program under test) by native compiler. ltrace_compile runs