Initial revision
[official-gcc.git] / texinfo / testsuite / lib / utils.exp
blob713e9f2332a0488187c36d9c78c3098eebcaf257
1 # utils.exp, a collection of Tcl/Expect utilities for texinfo tests.
3 # ----------default--------------------------------------------
4 # default VAR VALUE
5 # Check whether VAR exists and has a nonempty value;
6 # if not, use VALUE as the default
7 # -------------------------------------------------------------
8 proc default {varname varval} {
9 upvar $varname outervar
10 if { ![info exists outervar] || [string match {} $outervar] } then {
11 verbose "Defaulting $varname to $varval\n" 1
12 set outervar $varval
13 } else {
14 verbose "$varname retains existing value $outervar\n" 1
16 return
20 # ----------is_executable--------------------------------------
21 # is_executable NAME
22 # Boolean predicate: is NAME an executable file
23 # somewhere on our PATH?
24 # -------------------------------------------------------------
25 proc is_executable {name} {
26 if [ file executable [which $name] ] then {
27 return 1
28 } else {
29 return 0