changeset 5099:105d4cf7ec24

Test --time, --profile and --lsprof
author Patrick Mezard <pmezard@gmail.com>
date Tue, 14 Aug 2007 16:27:35 +0200
parents 0bbd86b847dd
children 24d306834de5 b1e147f60d62
files tests/hghave tests/test-profile tests/test-profile.out
diffstat 3 files changed, 26 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave	Tue Aug 14 16:03:15 2007 +0200
+++ b/tests/hghave	Tue Aug 14 16:27:35 2007 +0200
@@ -35,11 +35,19 @@
     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():
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-profile	Tue Aug 14 16:27:35 2007 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-profile.out	Tue Aug 14 16:27:35 2007 +0200
@@ -0,0 +1,3 @@
+% test --time
+% test --profile
+% test --lsprof