changeset 20426:00f2d29308db

tests: test that the pid returned by `hg serve` looks reasonable This failed on windows before win32.spawndetached has been fixed. The process name was "cmd.exe" and not "hg.exe" or "python.exe".
author Simon Heimberg <simohe@besonet.ch>
date Sun, 09 Feb 2014 00:26:01 +0100
parents ca6aa8362f33
children 4a9191ca848e
files tests/test-treediscovery.t
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-treediscovery.t	Sat Feb 08 14:35:07 2014 +0100
+++ b/tests/test-treediscovery.t	Sun Feb 09 00:26:01 2014 +0100
@@ -29,6 +29,15 @@
   $ hg init empty1
   $ hg init empty2
   $ tstart empty2
+check if process of pid looks reasonable ('hg' normally, 'python' for run-tests.py -l)
+#if windows
+ps of mingw does not support -p, tasklist is on any windows machine since XP
+  $ tasklist //NH //fi "pid eq `cat hg.pid`" | grep '  '
+  (.* )?(hg|python)\.exe( .*)? (re)
+#else
+  $ ps --no-heading -p `cat hg.pid`
+  (.* )?(hg|python)( .*)? (re)
+#endif
   $ hg incoming -R empty1 $remote
   comparing with http://localhost:$HGPORT/
   no changes found