changeset 7172:fb1d7a42663c

Use dummy diffstat in tests and remove older diffstat workaround. This makes test-notify pass on systems without diffstat installed or where the diffstat version yields a different output.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 19 Oct 2008 19:03:23 +0200
parents 41b7802b089a
children 37dd322adc81
files tests/run-tests.py tests/test-notify tests/test-notify.out
diffstat 3 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun Oct 19 17:40:35 2008 +0200
+++ b/tests/run-tests.py	Sun Oct 19 19:03:23 2008 +0200
@@ -205,6 +205,18 @@
     global hgpkg
     hgpkg = _hgpath()
 
+    vlog("# Installing dummy diffstat")
+    f = open(os.path.join(BINDIR, 'diffstat'), 'w')
+    f.write('#!' + sys.executable + '\n'
+            'import sys\n'
+            'files = 0\n'
+            'for line in sys.stdin:\n'
+            '    if line.startswith("diff "):\n'
+            '        files += 1\n'
+            'sys.stdout.write("files patched: %d\\n" % files)\n')
+    f.close()
+    os.chmod(os.path.join(BINDIR, 'diffstat'), 0700)
+
     if coverage:
         vlog("# Installing coverage wrapper")
         os.environ['COVERAGE_FILE'] = COVERAGE_FILE
--- a/tests/test-notify	Sun Oct 19 17:40:35 2008 +0200
+++ b/tests/test-notify	Sun Oct 19 19:03:23 2008 +0200
@@ -83,5 +83,4 @@
 hg --cwd b rollback
 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
   -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
-  -e 's/^Date:.*/Date:/' \
-  -e 's/^1 files changed/1 file changed/'
+  -e 's/^Date:.*/Date:/'
--- a/tests/test-notify.out	Sun Oct 19 17:40:35 2008 +0200
+++ b/tests/test-notify.out	Sun Oct 19 19:03:23 2008 +0200
@@ -150,8 +150,7 @@
 	b
 diffstat:
 
-1 file changed, 1 insertion(+)
-a |    1 +
+files patched: 1
 
 diffs (6 lines):