File: library.exp

package info (click to toggle)
monotone 1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 20,708 kB
  • sloc: cpp: 84,765; sh: 6,787; perl: 837; makefile: 833; python: 517; lisp: 379; sql: 118; exp: 88; ansic: 52
file content (32 lines) | stat: -rw-r--r-- 895 bytes parent folder | download
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
32
# Functions and starter for the bash completion tests

proc success {} {
    send_user "\n<<success>>\n"
}

proc failure {str} {
    if {$str == ""} {
	send_user "\n<<failure>>\n"
    } else {
	send_user "\n<<failure when expecting $str>>\n"
    }
}

set timeout 2
set env(initial_dir) $initial_dir
set env(srcdir) $srcdir
# some user's ~/.bash_profile start xserver etc; don't do that
spawn "bash" "--init-file" "/dev/nul" "--rcfile" "$srcdir/extra/bash_completion/bashrc"
# If there is no completion package, it's no point trying this.
# Make sure we do get a prompt.
expect {
    -timeout 20
    timeout { failure "no prompt"; exit }
    "No bash completion package present." {
	failure "No bash completion package present."; exit
    }
    -re "@ $"
}
send ". $initial_dir/extra/shell/monotone.bash_completion\n"
# Wait for the last line to be echoed
expect "shell/monotone.bash_completion"