File: README

package info (click to toggle)
monotone 0.31-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 20,680 kB
  • ctags: 14,801
  • sloc: cpp: 87,711; ansic: 64,862; sh: 5,691; lisp: 954; perl: 783; makefile: 509; python: 265; sql: 98; sed: 16
file content (43 lines) | stat: -rw-r--r-- 1,580 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
HOWTO make tests
================

Quick and dirty howto, to get you up to create and run tests.
Very early draft. Feel free to improve.

Running tests:
--------------
-  Starting in the monotone main dir. After having './configure'd monotone you 
   can do 'make tester' to create 'tester', the program that runs the tests.
   Running './testsuite.lua' (or './tester testsuite.lua') will run all tests.
-  'testsuite.lua -l' lists the names and numbers of all available tests
-  'testsuite.lua <n>' runs only test number n, negative n counts from the end
-  'testsuite.lua foobar' runs tests with "foobar" in the name
   (it's actually a regex)
-  option -d will keep the tester_dir files for post-test debugging
-  option -h is your friend :)
-  summary of test logs in tester_dir/tester.log
-  details of test logs in tester_dir/<testname>/tester.log

Creating tests:
---------------
-  Copy and paste is your friend :)
-  Make a new directory tests/<testname>
-  Add a line for <testname> at the end of testsuite.lua
-  TODO: need more here...
-  Sometimes you need to canonicalize things

Template for a test (name tests/<testname>/__driver__.lua:
------------------------------------------------

-- Initialize our workspace
mtn_setup()

-- run monotone
-- we want return value 0
-- we want to save the standard output in file "stdout"
-- we want to ignore the standard error
check(mtn("ls", "unknown"), 0, true, false)

-- we want "mtn foobar" to work, but since we know it doesn't
-- we tell the test program that this is expected to fail
xfail_if(true, mtn("foobar"), 0)