Patchwork tests: strip ps header in a way working on OS X

login
register
mail settings
Submitter Simon Heimberg
Date Feb. 11, 2014, 10:23 a.m.
Message ID <5FE5485BABAC85CF05DA009C@Simons-TOSH>
Download mbox | patch
Permalink /patch/3562/
State Superseded
Headers show

Comments

Simon Heimberg - Feb. 11, 2014, 10:23 a.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1392108602 -3600
#      Tue Feb 11 09:50:02 2014 +0100
# Node ID eebb76ee9ff455db697590d6c26421611271c9bb
# Parent  d98ba4a87427ce601dd23de8d4f5288cc44fe945
tests: strip ps header in a way working on OS X

On OS X, ps does not have the option --no-heading. Stip the header with grep
instead. And do matching lazier, because some systems could print the 
command
with a leading hyphen (-hg) or maybe with the path (../hg).

 #endif
   $ hg incoming -R empty1 $remote
   comparing with http://localhost:$HGPORT/
Simon Heimberg - Feb. 11, 2014, 12:16 p.m.
Simon Heimberg <simohe <at> besonet.ch> writes:

<snip>
> tests: strip ps header in a way working on OS X
> 
> On OS X, ps does not have the option --no-heading. Stip the header with 
grep
> instead. And do matching lazier, because some systems could print the 
> command
> with a leading hyphen (-hg) or maybe with the path (../hg).
> 

Old commit message, sorry. There is no grep command. V3 has been sent...

<snip>

Patch

diff -r d98ba4a87427 -r eebb76ee9ff4 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 depending on the test run 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)