tests/run-tests
author mpm@selenic.com
Wed, 15 Jun 2005 10:05:45 -0800
changeset 357 1cb3d9d5119e
parent 350 b4e0e20646bb
child 362 410373162036
permissions -rwxr-xr-x
[PATCH] Update hgit to the new commands.dodiff parameters -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] Update hgit to the new commands.dodiff parameters From: Chris Mason <mason@suse.com> Update hgit to the new commands.dodiff parameters manifest hash: aa8d98036fae49ab1c1c0e65d86ab0e1bee0fa71 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCsG35ywK+sNU5EO8RAhnoAJwMgK1QA8DkdbU2R19LoLRK1fmCaQCeN1dh 4fHRT4hf+Qi5fND4CpOyqBU= =63xo -----END PGP SIGNATURE-----

#!/bin/bash

set -e

tests=0
failed=0
H=$PWD

for f in `ls test-* | grep -Ev "\.|~"` ; do
    echo -n "."
    D=`mktemp -d`
    if [ "$D" == "" ] ; then
	echo mktemp failed!
    fi

    cd $D
    fail=0
    if ! $H/$f > .out 2>&1 ; then
	echo $f failed with error code $?
	fail=1
    fi
    if [ -s .out -a ! -r $H/$f.out ] ; then
	echo $f generated unexpected output:
	cat .out
	cp .out $H/$f.err
	fail=1
    elif ! diff -u $H/$f.out .out > /dev/null ; then
	echo $f output changed:
	diff -u $H/$f.out .out && true
	cp .out $H/$f.err
	fail=1
    fi

    cd $H
    rm -r $D

    failed=$[$failed + $fail]
    tests=$[$tests + 1]
done

echo
echo Ran $tests tests, $failed failed

if [ $failed -gt 0 ] ; then
    exit 1
fi