test: update test-logtoprocess.t to not requires less
authorBoris Feld <boris.feld@octobus.net>
Sun, 09 Dec 2018 16:49:55 +0100
changeset 53638 44378796c5e5eec7bc3bc3881a0399c8050ec712
parent 53637 07e181ed82efe7e4c61ea9dc0a58168cc81ba1c1
child 53639 348352658e4b0b0206e04c9bccd27a036edd5584
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
test: update test-logtoprocess.t to not requires less The test previously assumed that a working pager was present in the test environment. Update it to use the fakepager instead. Differential Revision: https://phab.mercurial-scm.org/D5399
tests/test-logtoprocess.t
--- a/tests/test-logtoprocess.t
+++ b/tests/test-logtoprocess.t
@@ -84,16 +84,26 @@ Confirm that logging blocked time catche
 
 Try to confirm that pager wait on logtoprocess:
 
 Add a script that wait on a file to appears for 5 seconds, if it sees it touch
 another file or die after 5 seconds. If the scripts is awaited by hg, the
 script will die after the timeout before we could touch the file and the
 resulting file will not exists. If not, we will touch the file and see it.
 
+  $ cat >> fakepager.py <<EOF
+  > import sys
+  > printed = False
+  > for line in sys.stdin:
+  >     sys.stdout.write(line)
+  >     printed = True
+  > if not printed:
+  >     sys.stdout.write('paged empty output!\n')
+  > EOF
+
   $ cat > $TESTTMP/wait-output.sh << EOF
   > #!/bin/sh
   > for i in \`$TESTDIR/seq.py 50\`; do
   >   if [ -f "$TESTTMP/wait-for-touched" ];
   >   then
   >     touch "$TESTTMP/touched";
   >     break;
   >   else
@@ -102,16 +112,18 @@ resulting file will not exists. If not, 
   > done
   > EOF
   $ chmod +x $TESTTMP/wait-output.sh
 
   $ cat >> $HGRCPATH << EOF
   > [extensions]
   > logtoprocess=
   > pager=
+  > [pager]
+  > pager = "$PYTHON" $TESTTMP/fakepager.py
   > [logtoprocess]
   > commandfinish=$TESTTMP/wait-output.sh
   > EOF
   $ hg version -q --pager=always
   Mercurial Distributed SCM (version *) (glob)
   $ touch $TESTTMP/wait-for-touched
   $ sleep 0.2
   $ test -f $TESTTMP/touched && echo "SUCCESS Pager is not waiting on ltp" || echo "FAIL Pager is waiting on ltp"