Source

mercurial-stable / tests /

Filename Size Date modified Message
..
938 B
1.5 KB
2.3 KB
950 B
388 B
189 B
4 B
527 B
161 B
121 B
318 B
799 B
380 B
266 B
464 B
258 B
324 B
295 B
369 B
271 B
135 B
657 B
1.4 KB
696 B
1014 B
308 B
132 B
191 B
77 B
434 B
180 B
1.4 KB
2.8 KB
360 B
1.1 KB
481 B
229 B
143 B
9.4 KB
197 B
69 B
149 B
118 B
603 B
186 B
800 B
425 B
1.6 KB
220 B
802 B
18 B
146 B
46 B
315 B
0 B
520 B
170 B
686 B
536 B
201 B
259 B
267 B
169 B
266 B
557 B
305 B
573 B
618 B
1.5 KB
139 B
256 B
123 B
237 B
539 B
1.0 KB
1.3 KB
760 B
607 B
180 B
528 B
409 B
397 B
151 B
446 B
190 B
461 B
515 B
982 B
451 B
1.2 KB
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