aboutsummaryrefslogtreecommitdiff
path: root/texinfo/testsuite/lib/utils.exp
blob: 713e9f2332a0488187c36d9c78c3098eebcaf257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# utils.exp, a collection of Tcl/Expect utilities for texinfo tests.

# ----------default--------------------------------------------
#  default VAR VALUE
#          Check whether VAR exists and has a nonempty value; 
#          if not, use VALUE as the default
# -------------------------------------------------------------
proc default {varname varval} {
  upvar $varname outervar
  if { ![info exists outervar] || [string match {} $outervar] } then {
    verbose "Defaulting $varname to $varval\n" 1
    set outervar $varval
  } else {
    verbose "$varname retains existing value $outervar\n" 1
  }
  return 
}


# ----------is_executable--------------------------------------
#  is_executable NAME
#          Boolean predicate: is NAME an executable file 
#            somewhere on our PATH?
# -------------------------------------------------------------
proc is_executable {name} {
  if [ file executable [which $name] ] then {
    return 1
  } else {
    return 0
  }
}