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,129 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

mtn_setup()

check(get("hooks.lua"))

check(mtn("automate", "select", "*", "--rcfile", "hooks.lua"), 0, true, true)

check(qgrep("lua: this is catched", "stderr"))
check(qgrep("lua: this is also catched", "stderr"))

check(qgrep("lua: line breaks", "stderr"))
check(qgrep("lua: are handled", "stderr"))
check(qgrep("lua: properly as well", "stderr"))

check(qgrep("this is not catched", "stdout"))
check(not qgrep("lua: this is not catched", "stderr"))

check(qgrep("this is also not catched", "stderr"))
check(not qgrep("lua: this is also not catched", "stderr"))

-- load a slightly different version with no regular stdout output
-- which would confuse the stdio parser
check(get("hooks_automate.lua"))

check(mtn("automate", "stdio", "--rcfile", "hooks_automate.lua"), 0, true, true, "l6:select1:*e")
check(qgrep("this is also not catched", "stderr"))

includecommon("automate_stdio.lua")
progress = parse_stdio(readfile("stdout"), 0, nil, 'p')

check(progress[1] == "lua: this is catched")
check(progress[2] == "lua: this is also catched")
check(progress[3] == "lua: line breaks\nlua: are handled\nlua: properly as well")