sapling/tests
mpm@selenic.com a58fa92f5c Fix troubles with clone and exception handling
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fix troubles with clone and exception handling

Clone deletes its directory on failure

This was deleting the lockfile out from under the lock object before
it got destroyed

This patch shuts lock up and makes the cleanup code for clone a little
cleaner.

manifest hash: f666fddcf6f3a905020a091f5e9fd2cb5d806cdd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCwSGOywK+sNU5EO8RAkx2AKCIxPczl9YWnuUM+bMQnpVr8kv6uQCeNWld
SUxSB99PGJHhq1LWFaSJJNw=
=Frk/
-----END PGP SIGNATURE-----
2005-06-28 02:08:14 -08:00
..
fish-merge Add some tests to the repo 2005-05-04 22:57:51 -08:00
README testing fixups 2005-06-14 13:44:37 -08:00
run-tests [PATCH] umask for run-tests 2005-06-27 22:23:56 -08:00
test-backwards-remove hg merge: fix time asymmetry bug with deleting files on update to past 2005-06-16 22:32:55 -08:00
test-backwards-remove.out hg merge: fix time asymmetry bug with deleting files on update to past 2005-06-16 22:32:55 -08:00
test-bad-pull Fix troubles with clone and exception handling 2005-06-28 02:08:14 -08:00
test-bad-pull.out Fix troubles with clone and exception handling 2005-06-28 02:08:14 -08:00
test-basic Add a simple testing framework 2005-06-14 13:28:42 -08:00
test-basic.out Fixed tests for displaying tags in hg history and hg parents. 2005-06-17 11:03:03 +01:00
test-bdiff Add a fast binary diff extension (not yet used) 2005-06-21 17:27:58 -08:00
test-bdiff.out Add a fast binary diff extension (not yet used) 2005-06-21 17:27:58 -08:00
test-conflict Tidy up conflict and pull tests 2005-06-17 08:50:55 -08:00
test-conflict.out Tidy up conflict and pull tests 2005-06-17 08:50:55 -08:00
test-copy Fix pipe timing for copy test 2005-06-24 23:00:19 -08:00
test-copy.out Fix pipe timing for copy test 2005-06-24 23:00:19 -08:00
test-flags Fixed test-flags and .out for arbitrary umask settings. Use -ex shell flags. 2005-06-27 06:41:28 +01:00
test-flags.out Fixed test-flags and .out for arbitrary umask settings. Use -ex shell flags. 2005-06-27 06:41:28 +01:00
test-help Support for 'hg --version'. setup.py stores version from hg repository. 2005-06-18 16:32:41 +01:00
test-help.out [PATCH] simplify init 2005-06-27 23:52:31 -08:00
test-hook Add initial hook support 2005-06-27 22:18:12 -08:00
test-hook.out Add initial hook support 2005-06-27 22:18:12 -08:00
test-merge1 Fix up test-merge1 2005-06-21 21:07:08 -08:00
test-merge1.out Fix up test-merge1 2005-06-21 21:07:08 -08:00
test-merge2 Pick up tests from previous patch 2005-06-21 18:51:06 -08:00
test-merge2.out Pick up tests from previous patch 2005-06-21 18:51:06 -08:00
test-merge3 [PATCH] (3/4) Removing an added file 2005-06-21 17:50:37 -08:00
test-merge3.out [PATCH] (3/4) Removing an added file 2005-06-21 17:50:37 -08:00
test-merge4 [PATCH] Removal of a file added by merging branches 2005-06-21 19:19:39 -08:00
test-merge4.out [PATCH] Removal of a file added by merging branches 2005-06-21 19:19:39 -08:00
test-merge5 [PATCH] Don't prompt user for keep-vs-delete when the merge is about to be aborted 2005-06-21 19:14:11 -08:00
test-merge5.out [PATCH] Don't prompt user for keep-vs-delete when the merge is about to be aborted 2005-06-21 19:14:11 -08:00
test-pull Use "kill $!" to kill running background processes. 2005-06-27 06:52:13 +01:00
test-pull.out Add some more tests 2005-06-14 17:30:56 -08:00
test-rawcommit1 Add rawcommit tests 2005-06-23 13:34:13 -08:00
test-rawcommit1.out Make show_changeset show added and deleted files in verbose mode. 2005-06-27 06:17:28 +01:00
test-simple-update [PATCH] add clone command 2005-06-26 15:20:46 -08:00
test-simple-update.out [PATCH] add clone command 2005-06-26 15:20:46 -08:00
test-tag From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl> 2005-06-21 17:47:28 -08:00
test-tag.out From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl> 2005-06-21 17:47:28 -08:00
test-tags Add a tags/identify test group 2005-06-15 00:10:18 -08:00
test-tags.out [PATCH] Set locale before run-tests does anything 2005-06-27 22:22:13 -08:00
test-undo Add some more tests 2005-06-14 17:30:56 -08:00
test-undo.out Update undo test 2005-06-28 02:04:49 -08:00
test-up-local-change [PATCH] add clone command 2005-06-26 15:20:46 -08:00
test-up-local-change.out Fixed test for previous change of 'hg -v history'. 2005-06-28 07:05:55 +01:00

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 -t "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 -t "test" -u test -d "0 0"

- diff will show the current time

  use hg diff | sed "s/\(\(---\|+++\).*\)\t.*/\1/" to strip dates

- set -x and pipelines don't generate stable output

  turn off set -x or break pipelines into pieces