Source

mercurial/crew/tonfa/http / tests /

Filename Size Date modified Message
..
938 B
1.5 KB
2.3 KB
189 B
4 B
527 B
161 B
121 B
318 B
799 B
380 B
266 B
464 B
258 B
324 B
271 B
135 B
244 B
661 B
308 B
132 B
191 B
77 B
360 B
1.1 KB
143 B
9.0 KB
197 B
69 B
149 B
118 B
603 B
186 B
800 B
425 B
1.5 KB
88 B
802 B
18 B
146 B
46 B
315 B
0 B
520 B
170 B
686 B
514 B
201 B
259 B
267 B
557 B
305 B
562 B
618 B
1.5 KB
139 B
237 B
539 B
180 B
529 B
409 B
401 B
151 B
446 B
190 B
450 B
515 B
982 B
1.1 KB
3.7 KB
A simple testing framework

To run the tests, do:

cd tests/
./run-tests

This finds all scripts in the test directory named test-* and executes
them. The scripts can be either shell scripts or Python. Each test is
run in a temporary directory that is removed when the test is complete.

A test-<x> succeeds if the script returns success and its output
matches test-<x>.out. If the new output doesn't match, it is stored in
test-<x>.err.

There are some tricky points here that you should be aware of when
writing tests:

- hg commit and hg up -m want user interaction

  for commit use -m "text"
  for hg up -m, set HGMERGE to something noninteractive (like true or merge)

- changeset hashes will change based on user and date which make
  things like hg history output change

  use commit -m "test" -u test -d "0 0"

- diff will show the current time

  use hg diff | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/" to strip
  dates