File: __driver__.lua

package info (click to toggle)
monotone 1.1-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,984 kB
  • ctags: 8,622
  • sloc: cpp: 86,450; sh: 6,906; perl: 924; makefile: 813; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (56 lines) | stat: -rw-r--r-- 1,475 bytes parent folder | download | duplicates (3)
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
50
51
52
53
54
55
56
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)
   expect_if(false, test)
end

function expect_if(cond, 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
      mtn_cmd = table.remove(mtn(), 1)
      xfail_if(cond, {"expect",
	     "-c", "set mtn_cmd \""..mtn_cmd.."\"",
	     "-c", "set initial_dir \""..initial_dir.."\"",
	     "-c", "set srcdir \""..srcdir.."\"",
	     "-c", "source library.exp",
	     "-f", test..".exp"}, 0, true, false)
      xfail_if(cond, grep("<<success>>", "stdout"), 0, false, false)
   else
      check(false)
   end
end

get("library.exp")
get("bashrc")

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")

-- This one doesn't properly expand when spaces in paths are involved.
expect_if(string.find(mtn()[1], " ") ~= nil, "complete_propagate")

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

expect("complete_commit")