Source

mercurial-crew-stable / tests /

Filename Size Date modified Message
..
944 B
1.5 KB
781 B
3.2 KB
197 B
84 B
1000 B
380 B
201 B
4 B
591 B
157 B
127 B
318 B
799 B
380 B
242 B
62 B
302 B
464 B
246 B
619 B
412 B
838 B
4.2 KB
304 B
2.0 KB
5.0 KB
407 B
416 B
289 B
135 B
690 B
348 B
701 B
1.4 KB
696 B
1014 B
434 B
258 B
60 B
281 B
38 B
143 B
440 B
180 B
521 B
1.9 KB
1.4 KB
3.0 KB
378 B
1.2 KB
483 B
229 B
143 B
11.2 KB
770 B
344 B
106 B
114 B
2.5 KB
3.9 KB
149 B
118 B
282 B
185 B
157 B
91 B
615 B
280 B
848 B
469 B
1.9 KB
429 B
856 B
18 B
158 B
27 B
339 B
0 B
439 B
183 B
716 B
558 B
899 B
2.1 KB
201 B
259 B
320 B
416 B
264 B
169 B
266 B
747 B
665 B
413 B
601 B
549 B
293 B
149 B
886 B
4.4 KB
677 B
1.0 KB
664 B
1.7 KB
205 B
1.1 KB
4.1 KB
5.0 KB
1.1 KB
268 B
134 B
848 B
424 B
53 B
237 B
539 B
1.2 KB
1.6 KB
843 B
544 B
855 B
1.3 KB
917 B
150 B
419 B
976 B
650 B
875 B
157 B
446 B
217 B
529 B
971 B
3.3 KB
474 B
1.2 KB
1.3 KB
3.5 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 "1000000 0"

- diff will show the current time

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