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 (28 lines) | stat: -rw-r--r-- 1,061 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
mtn_setup()

-- Make sure we test the monotone source for mtnopt, not whatever the
-- user happens to have in PATH
copy (initial_dir .. "/mtnopt", "mtnopt")

normalized_testroot = normalize_path (test.root)

-- Escape regexp special characters to form a proper regexp that correctly
-- checks for the given path.
escaped_testroot = string.gsub(normalized_testroot, "([*+.()[\\^$|?])",
  function (x) return "\\" .. x end)

-- check default operation

-- MinGW does not process the shebang in mtnopt; must invoke sh directly
-- Vista will probably need to skip this test
-- Don't pass the full /bin/sh path, it looks like that doesn't always
-- work under mingw.
check({"sh", "./mtnopt"}, 0, true)
check(qgrep('^MTN_database="' .. escaped_testroot .. '/test.db";$', "stdout"))
check(qgrep('^MTN_branch="testbranch";$', "stdout"))

-- check operation with a specific key and just returning the value
check({'sh', './mtnopt', '-v', '-kbranch'}, 0, true)
check(not qgrep('^' .. normalized_testroot .. '/test.db$', "stdout"))
check(qgrep('^testbranch$', "stdout"))