[PATCH V2] tests: match ps output in a way working on OS X
Simon Heimberg
simohe at besonet.ch
Tue Feb 11 11:46:10 UTC 2014
# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1392108602 -3600
# Tue Feb 11 09:50:02 2014 +0100
# Node ID d17bbb4ee780e2bcc28a950572a10cfd04a80f37
# Parent d98ba4a87427ce601dd23de8d4f5288cc44fe945
tests: match ps output in a way working on OS X
On OS X, `ps` does not have the option --no-heading. Ignore the header with
a
glob match instead. Match the command lazier, because some systems could
print
a leading hyphen (-hg) or maybe the path (../hg).
diff -r d98ba4a87427 -r d17bbb4ee780 tests/test-treediscovery.t
--- a/tests/test-treediscovery.t Mon Feb 10 17:31:26 2014 -0600
+++ b/tests/test-treediscovery.t Tue Feb 11 09:50:02 2014 +0100
@@ -30,13 +30,15 @@
$ hg init empty2
$ tstart empty2
check if process of pid looks reasonable ('hg' normally, 'python' for
run-tests.py -l)
+(TODO: matching the right command, 'hg' exclusive or 'python' would make
more sense)
#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)
+ $ ps -p `cat hg.pid`
+ .*
+ (.*\w)?(hg|python)( .*)? (re)
#endif
$ hg incoming -R empty1 $remote
comparing with http://localhost:$HGPORT/
More information about the Mercurial-devel
mailing list