view tests/test-profile @ 8023:fd9debb3ea1b

profiling: Adding a profiling.format config variable Allows defining other output formats for profiling. If an invalid format is given, output a warning and ignore it. For now, only the standard 'text' value is supported.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Thu, 02 Apr 2009 16:01:30 +0900
parents 4f3fdfaa3874
children 9a1b86cfd29e
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
fi