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 (34 lines) | stat: -rw-r--r-- 1,157 bytes parent folder | download | duplicates (4)
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
includecommon("automate_stdio.lua")

mtn_setup()
revs = {}

get("expected")

writefile("empty", "")

addfile("foo", "blah")
check(mtn("commit", "--date=2005-05-21T12:30:51", "--branch=testbranch",
          "--message=blah-blah"), 0, false, false)
base = base_revision()

check(mtn("automate", "cert", base, "testcert", "testvalue"), 0, true, false)
check(samefile("empty", "stdout"))

-- check that a correct usage produces correctly formatted output
check(mtn("automate", "certs", base), 0, true, false)
canonicalize("stdout")
check(samefile("expected", "stdout"))

-- check that 'cert' gets keydir from workspace options when run via stdio
check(mtn_ws_opts("automate", "stdio"), 0, true, true, "l4:cert40:" .. base .. "9:testcert23:fooe")
check(parse_stdio(readfile("stdout"), 0) == "")

-- check edge cases:
-- wrong number of arguments:
check(mtn("automate", "cert", base, "asdf"), 1, false, false)
check(mtn("automate", "cert", base, "testcert", "testvalue", "asdf"), 1, false, false)
-- nonexistent revision:
check(mtn("automate", "cert", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "branch", "net.venge.monotone"),
      1, false, false)