tests/test-profile
author Nicolas Dumazet <nicdumz.commits@gmail.com>
Wed, 08 Apr 2009 14:19:41 +0200
changeset 8022 4f3fdfaa3874
parent 8021 1c2cf2e5dc9b
child 8023 fd9debb3ea1b
permissions -rwxr-xr-x
profiling: Adding profiling.output config variable If specified, outputs profiling data to the said file. Prints to stderr by default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5099
105d4cf7ec24 Test --time, --profile and --lsprof
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
105d4cf7ec24 Test --time, --profile and --lsprof
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
105d4cf7ec24 Test --time, --profile and --lsprof
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
echo % test --time
5102
9b0efeb725f4 test-profile: fix grep, check hotshot availability
Patrick Mezard <pmezard@gmail.com>
parents: 5099
diff changeset
     4
hg --time help -q help 2>&1 | grep Time > /dev/null || echo --time failed
5099
105d4cf7ec24 Test --time, --profile and --lsprof
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
8022
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
     6
hg init a
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
     7
cd a
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
     8
5099
105d4cf7ec24 Test --time, --profile and --lsprof
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
echo % test --profile
8021
1c2cf2e5dc9b profiling: dropping hotshot profiling. --profile as a unique profiling option
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5102
diff changeset
    10
if "$TESTDIR/hghave" -q lsprof; then
8022
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
    11
    hg --profile st 2>../out || echo --profile failed
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
    12
    grep CallCount < ../out > /dev/null || echo wrong --profile
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
    13
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
    14
    hg --profile --config profiling.output=../out st 2>&1 \
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
    15
        || echo --profile + output to file failed
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
    16
    grep CallCount < ../out > /dev/null \
4f3fdfaa3874 profiling: Adding profiling.output config variable
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8021
diff changeset
    17
        || echo wrong --profile output when saving to a file
5102
9b0efeb725f4 test-profile: fix grep, check hotshot availability
Patrick Mezard <pmezard@gmail.com>
parents: 5099
diff changeset
    18
fi