File: __driver__.lua

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 (49 lines) | stat: -rw-r--r-- 1,239 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
skip_if(not existsonpath("expect"))
check({"bash", "--version"}, 0, true)
-- hashes/dictionaries/associative arrays are new in version 4
skip_if(qgrep("bash[, ]*version 3", "stdout"))

function expect(test)
   if monotone_path == nil then
      monotone_path = os.getenv("mtn")
      if monotone_path == nil then
	 err("'mtn' environment variable not set")
      end
   end
   check(get(test..".exp"), 0, false, false)
   if existsonpath("expect") then
      check({"expect",
	     "-c", "set mtn \""..cmd_as_str(mtn()).."\"",
	     "-c", "set initial_dir \""..initial_dir.."\"",
	     "-c", "set srcdir \""..srcdir.."\"",
	     "-c", "source library.exp",
	     "-f", test..".exp"}, 0, true, false)
      check(grep("<<success>>", "stdout"), 0, false, false)
   else
      check(false)
   end
end

get("library.exp")

mtn_setup()

-- complete_mtn_-
expect("complete_mtn_-")

-- complete_propagate
addfile("prop-test", "foo")
commit("prop-br1")
addfile("prop-test2", "bar")
commit("prop-bra2")
check(mtn("update","-r","h:prop-br1"), 0, false, false)
writefile("prop-test", "zoot")
commit("prop-br1")

expect("complete_propagate")

-- complete_commit
addfile("commit-test1", "foo")
addfile("commit-test2", "bar")

expect("complete_commit")