# HG changeset patch # User Patrick Mezard # Date 2007-08-14 14:27:35 # Node ID 105d4cf7ec24b016397b6b97fa2d4b622adc2949 # Parent 0bbd86b847dd8d60674e99cfc71c4387e544ad87 Test --time, --profile and --lsprof diff --git a/tests/hghave b/tests/hghave --- a/tests/hghave +++ b/tests/hghave @@ -35,11 +35,19 @@ def has_eol_in_paths(): except: return False +def has_lsprof(): + try: + import _lsprof + return True + except ImportError: + return False + checks = { - "symlink": (has_symlink, "symbolic links"), + "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"), + "execbit": (has_executablebit, "executable bit"), "fifo": (has_fifo, "named pipes"), - "execbit": (has_executablebit, "executable bit"), - "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"), + "lsprof": (has_lsprof, "python lsprof module"), + "symlink": (has_symlink, "symbolic links"), } def list_features(): diff --git a/tests/test-profile b/tests/test-profile new file mode 100755 --- /dev/null +++ b/tests/test-profile @@ -0,0 +1,12 @@ +#!/bin/sh + +echo % test --time +hg --time help 2>&1 | grep -q Time || echo --time failed + +echo % test --profile +hg --profile help 2>&1 | grep -q ncalls || echo --profile failed + +echo % test --lsprof +if "$TESTDIR/hghave" -q lsprof; then + hg --lsprof help 2>&1 | grep -q CallCount || echo --lsprof failed +fi \ No newline at end of file diff --git a/tests/test-profile.out b/tests/test-profile.out new file mode 100644 --- /dev/null +++ b/tests/test-profile.out @@ -0,0 +1,3 @@ +% test --time +% test --profile +% test --lsprof