331
|
1 |
A simple testing framework
|
|
2 |
|
|
3 |
This finds all scripts in the test directory named test-* and executes
|
|
4 |
them. The scripts can be either shell scripts or Python. Each test is
|
|
5 |
run in a temporary directory that is removed when the test is complete.
|
|
6 |
|
|
7 |
A test-<x> succeeds if the script returns success and its output
|
|
8 |
matches test-<x>.out. If the new output doesn't match, it is stored in
|
|
9 |
test-<x>.err.
|
|
10 |
|
|
11 |
There are some tricky points here that you should be aware of when
|
|
12 |
writing tests:
|
|
13 |
|
|
14 |
- hg commit and hg up -m want user interaction
|
|
15 |
|
|
16 |
for commit use -t "text"
|
|
17 |
for hg up -m, set HGMERGE to something noninteractive (like true or merge)
|
|
18 |
|
|
19 |
- changeset hashes will change based on user and date which make
|
|
20 |
things like hg history output change
|
|
21 |
|
|
22 |
use commit -t "test" -u test -d "0 0"
|
|
23 |
|
|
24 |
- diff will show the current time
|
|
25 |
|
|
26 |
use hg diff | sed "s/\(\(---\|+++\).*\)\t.*/\1/" to strip dates
|
|
27 |
|