PATCH: debug-test script (from wiki)
Greg Ward
greg-hg at gerg.ca
Sun Apr 19 17:21:03 CDT 2009
After hacking on Mercurial all weekend, I'm getting tired of grabbing
the the "debug-test" script from
http://www.selenic.com/mercurial/wiki/index.cgi/DebuggingTests for
every working clone. And then I have to remember that tests/tmp is
full of ignoreable files.
So... how about adding debug-test to the official source tree? Surely
I'm not the only one who likes it. Here's a patch that gives credit
to the original author and adds a usage check.
# HG changeset patch
# User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
# Date 1240179341 14400
Add debug-test script to make working on test scripts easier.
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -14,6 +14,7 @@
tests/.coverage*
tests/annotated
tests/*.err
+tests/tmp
build
contrib/hgsh/hgsh
dist
diff --git a/tests/debug-test b/tests/debug-test
new file mode 100755
--- /dev/null
+++ b/tests/debug-test
@@ -0,0 +1,19 @@
+#!/bin/sh
+if [ $# -ne 1 ]; then
+ echo "usage: $0 test" >&2
+ exit 2
+fi
+
+TESTDIR=`pwd`
+cd .. && HGDIR=`pwd` && cd tests # want an absolute path
+HGRCPATH=$TESTDIR/tmp/hgrc
+PYTHONPATH=$HGDIR:$PYTHONPATH
+PATH=$HGDIR:$PATH
+export HGRCPATH
+export PYTHONPATH
+export PATH
+rm -rf tmp
+mkdir tmp && cd tmp
+echo "[ui]" >$HGRCPATH
+echo "username = Unknown <unknown at example.com>" >>$HGRCPATH
+../$1
More information about the Mercurial-devel
mailing list