view tests/test-profile @ 9857:24bc6e414610

diff: change --inverse to --reverse This fixes an incompatibility with patch(1), which also uses --reverse for reversed diffs. The --inverse flag was added in 3f522d2fa633. That name was chosen over --reverse since it was thought that --reverse would make --rev ambiguous. It turns out that both flags can co-exist, with the cost that --rev can no longer be shortened to --r and --re. Since one can always use the short -r option, this is not a real problem.
author Martin Geisler <mg@lazybytes.net>
date Sat, 14 Nov 2009 14:21:53 +0100
parents 9a1b86cfd29e
children
line wrap: on
line source

#!/bin/sh

echo % test --time
hg --time help -q help 2>&1 | grep Time > /dev/null || echo --time failed

hg init a
cd a

echo % test --profile
if "$TESTDIR/hghave" -q lsprof; then
    hg --profile st 2>../out || echo --profile failed
    grep CallCount < ../out > /dev/null || echo wrong --profile

    hg --profile --config profiling.output=../out st 2>&1 \
        || echo --profile + output to file failed
    grep CallCount < ../out > /dev/null \
        || echo wrong --profile output when saving to a file

    hg --profile --config profiling.format=text st 2>&1 \
        | grep CallCount > /dev/null || echo --profile format=text failed

    echo "[profiling]" >> $HGRCPATH
    echo "format=kcachegrind" >> $HGRCPATH

    hg --profile st 2>../out || echo --profile format=kcachegrind failed
    grep 'events: Ticks' < ../out > /dev/null || echo --profile output is wrong

    hg --profile --config profiling.output=../out st 2>&1 \
        || echo --profile format=kcachegrind + output to file failed
    grep 'events: Ticks' < ../out > /dev/null \
        || echo --profile output is wrong
fi