annotate tests/run-tests @ 406:d8abb687d501

[PATCH] Using monotone-viz/git-viz with mercurial -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] Using monotone-viz/git-viz with mercurial From: Vincent Danjean <vdanjean.ml@free.fr> monotone-viz is a small GTK+ application that visualizes monotone ancestry graphs. Its home page is: http://oandrieu.nerim.net/monotone-viz/ As monotone and git are similar, the author adapted the 0.9 version to display git ancestry graphs and call it git-viz. I cannot see any link from the homepage, but looking in the archive of git ML, it can be found here: http://oandrieu.nerim.net/monotone-viz/git-viz-0.1.tar.gz I few days ago, I adapted it so that it works with the last versions of git/cogito. Patches and package are available here: http://dept-info.labri.fr/~danjean/deb.html#git-viz Today, I patched hgit so that it respects the output of git-diff-tree, I added git-{diff-tree,cat-file,rev-list,rev-tree} that call hgit (2 lines scripts), and added the script 'hg-viz'. hg-viz create a .git directory and store the SHA1 of the tip in .git/HEAD and then call my git-viz. All these modifications are in the attached patch. I try it in the mercurial repository. After applying the patch, you just have to add the contrib directory in your PATH and call hg-viz. An example of what we can see is on my web page (probably not for a long time) : http://dept-info.labri.fr/~danjean/temp/hg-viz.png Vincent -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCuM50ywK+sNU5EO8RAtlvAJ425JJI9chCdSi8D+R2Af/vJEOUpACffC9e fxjJ3umBkffj5g86jWaRGZ0= =LwA2 -----END PGP SIGNATURE-----
author mpm@selenic.com
date Tue, 21 Jun 2005 18:35:32 -0800
parents f060d728fe54
children 688d03d6997a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
1 #!/bin/bash
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
2
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
3 set -e
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
4
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
5 tests=0
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
6 failed=0
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
7 H=$PWD
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
8
397
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
9 TESTPATH=$PWD/install/bin
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
10 export PATH=$TESTPATH:$PATH
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
11 export PYTHONPATH=$PWD/install/lib/python
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
12
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
13 rm -rf install
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
14 cd ..
398
7ed217cfae9e Quiet successful test install in run-tests
mpm@selenic.com
parents: 397
diff changeset
15 ${PYTHON:-python} setup.py install --home=tests/install > tests/install.err
7ed217cfae9e Quiet successful test install in run-tests
mpm@selenic.com
parents: 397
diff changeset
16 if [ $? != 0 ] ; then
7ed217cfae9e Quiet successful test install in run-tests
mpm@selenic.com
parents: 397
diff changeset
17 cat tests/install.err
7ed217cfae9e Quiet successful test install in run-tests
mpm@selenic.com
parents: 397
diff changeset
18 fi
397
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
19 cd $H
398
7ed217cfae9e Quiet successful test install in run-tests
mpm@selenic.com
parents: 397
diff changeset
20 rm install.err
397
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
21
362
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
22 function run_one
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
23 {
399
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
24 rm -f $1.err
382
37249c522770 test suite: fix timezone problems and port collision problem
mpm@selenic.com
parents: 362
diff changeset
25 export TZ=GMT
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
26 D=`mktemp -d`
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
27 if [ "$D" == "" ] ; then
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
28 echo mktemp failed!
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
29 fi
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
30
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
31 cd $D
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
32 fail=0
362
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
33
399
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
34 if ! $H/$1 > .out 2>&1 ; then
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
35 echo $1 failed with error code $?
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
36 fail=1
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
37 fi
362
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
38
399
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
39 if [ -s .out -a ! -r $H/$1.out ] ; then
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
40 echo $1 generated unexpected output:
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
41 cat .out
399
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
42 cp .out $H/$1.err
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
43 fail=1
399
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
44 elif [ -r $H/$1.out ] && ! diff -u $H/$1.out .out > /dev/null ; then
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
45 echo $1 output changed:
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
46 diff -u $H/$1.out .out && true
f060d728fe54 Delete error logs one test at a time
mpm@selenic.com
parents: 398
diff changeset
47 cp .out $H/$1.err
341
c0deea64ce64 run-tests: actually mark changed output as failure
mpm@selenic.com
parents: 331
diff changeset
48 fail=1
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
49 fi
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
50
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
51 cd $H
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
52 rm -r $D
362
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
53 return $fail
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
54 }
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
55
362
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
56 TESTS=$@
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
57 if [ "$TESTS" == "" ] ; then
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
58 TESTS=`ls test-* | grep -Ev "\.|~"`
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
59 fi
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
60
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
61 for f in $TESTS ; do
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
62 echo -n "."
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
63 if ! run_one $f ; then
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
64 failed=$[$failed + 1]
410373162036 run-tests: run tests given on the command line
mpm@selenic.com
parents: 350
diff changeset
65 fi
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
66 tests=$[$tests + 1]
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
67 done
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
68
397
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
69 rm -rf install
e5683db23ec4 From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents: 382
diff changeset
70
331
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
71 echo
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
72 echo Ran $tests tests, $failed failed
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
73
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
74 if [ $failed -gt 0 ] ; then
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
75 exit 1
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
76 fi
55f63f3b6a54 Add a simple testing framework
mpm@selenic.com
parents:
diff changeset
77