# HG changeset patch # User Mads Kiilerich # Date 1335139008 -7200 # Node ID abbabbbe4ec2e0d95f6b02cf6c303e970b927b11 # Parent 5f9835ed3d6d9e995b6fef71932973fef9df467c tests: use 'do sleep 0' instead of 'do true', also on first line of command f64b25f147d7 established that '... do true ...' shouldn't be used, but that was only enforced on continued lines. diff -r 5f9835ed3d6d -r abbabbbe4ec2 contrib/check-code.py --- a/contrib/check-code.py Mon Apr 23 01:56:48 2012 +0200 +++ b/contrib/check-code.py Mon Apr 23 01:56:48 2012 +0200 @@ -75,6 +75,7 @@ (r'^alias\b.*=', "don't use alias, use a function"), (r'if\s*!', "don't use '!' to negate exit status"), (r'/dev/u?random', "don't use entropy, use /dev/zero"), + (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"), ], # warnings [] @@ -98,8 +99,6 @@ (uprefix + r'set -e', "don't use set -e"), (uprefix + r'\s', "don't indent commands, use > for continued lines"), (uprefixc + r'( *)\t', "don't use tabs to indent"), - (uprefixc + r'.*do\s*true;\s*done', - "don't use true as loop body, use sleep 0"), ], # warnings [] diff -r 5f9835ed3d6d -r abbabbbe4ec2 tests/test-bad-pull.t --- a/tests/test-bad-pull.t Mon Apr 23 01:56:48 2012 +0200 +++ b/tests/test-bad-pull.t Mon Apr 23 01:56:48 2012 +0200 @@ -20,7 +20,7 @@ $ python dumb.py 2> log & $ P=$! - $ while [ ! -f listening ]; do true; done + $ while [ ! -f listening ]; do sleep 0; done $ hg clone http://localhost:$HGPORT/foo copy2 abort: HTTP Error 404: * (glob) [255] diff -r 5f9835ed3d6d -r abbabbbe4ec2 tests/test-hgweb-raw.t --- a/tests/test-hgweb-raw.t Mon Apr 23 01:56:48 2012 +0200 +++ b/tests/test-hgweb-raw.t Mon Apr 23 01:56:48 2012 +0200 @@ -20,7 +20,7 @@ $ cat hg.pid >> $DAEMON_PIDS $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt - $ while kill `cat hg.pid` 2>/dev/null; do true; done + $ while kill `cat hg.pid` 2>/dev/null; do sleep 0; done $ cat getoutput.txt 200 Script output follows @@ -41,7 +41,7 @@ $ cat hg.pid >> $DAEMON_PIDS $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt - $ while kill `cat hg.pid` 2>/dev/null; do true; done + $ while kill `cat hg.pid` 2>/dev/null; do sleep 0; done $ cat getoutput.txt 200 Script output follows diff -r 5f9835ed3d6d -r abbabbbe4ec2 tests/test-http-proxy.t --- a/tests/test-http-proxy.t Mon Apr 23 01:56:48 2012 +0200 +++ b/tests/test-http-proxy.t Mon Apr 23 01:56:48 2012 +0200 @@ -9,7 +9,7 @@ $ cat hg.pid >> $DAEMON_PIDS $ cd .. $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 > $DAEMON_PIDS url for proxy, stream diff -r 5f9835ed3d6d -r abbabbbe4ec2 tests/test-https.t --- a/tests/test-https.t Mon Apr 23 01:56:48 2012 +0200 +++ b/tests/test-https.t Mon Apr 23 01:56:48 2012 +0200 @@ -233,12 +233,12 @@ $ hg -R copy-pull id https://127.0.0.1:$HGPORT/ 5fed3813f7f5 - $ while kill `cat hg1.pid` 2>/dev/null; do true; done + $ while kill `cat hg1.pid` 2>/dev/null; do sleep 0; done Prepare for connecting through proxy $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log &1 & - $ while [ ! -f proxy.pid ]; do true; done + $ while [ ! -f proxy.pid ]; do sleep 0; done $ cat proxy.pid >> $DAEMON_PIDS $ echo "[http_proxy]" >> copy-pull/.hg/hgrc