comparison tests/test-logtoprocess.t @ 40873:44378796c5e5

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
author Boris Feld <boris.feld@octobus.net>
date Sun, 09 Dec 2018 16:49:55 +0100
parents d2c997b8001f
children 42d2b31cee0b
comparison
equal deleted inserted replaced
40872:07e181ed82ef 40873:44378796c5e5
87 Add a script that wait on a file to appears for 5 seconds, if it sees it touch 87 Add a script that wait on a file to appears for 5 seconds, if it sees it touch
88 another file or die after 5 seconds. If the scripts is awaited by hg, the 88 another file or die after 5 seconds. If the scripts is awaited by hg, the
89 script will die after the timeout before we could touch the file and the 89 script will die after the timeout before we could touch the file and the
90 resulting file will not exists. If not, we will touch the file and see it. 90 resulting file will not exists. If not, we will touch the file and see it.
91 91
92 $ cat >> fakepager.py <<EOF
93 > import sys
94 > printed = False
95 > for line in sys.stdin:
96 > sys.stdout.write(line)
97 > printed = True
98 > if not printed:
99 > sys.stdout.write('paged empty output!\n')
100 > EOF
101
92 $ cat > $TESTTMP/wait-output.sh << EOF 102 $ cat > $TESTTMP/wait-output.sh << EOF
93 > #!/bin/sh 103 > #!/bin/sh
94 > for i in \`$TESTDIR/seq.py 50\`; do 104 > for i in \`$TESTDIR/seq.py 50\`; do
95 > if [ -f "$TESTTMP/wait-for-touched" ]; 105 > if [ -f "$TESTTMP/wait-for-touched" ];
96 > then 106 > then
105 115
106 $ cat >> $HGRCPATH << EOF 116 $ cat >> $HGRCPATH << EOF
107 > [extensions] 117 > [extensions]
108 > logtoprocess= 118 > logtoprocess=
109 > pager= 119 > pager=
120 > [pager]
121 > pager = "$PYTHON" $TESTTMP/fakepager.py
110 > [logtoprocess] 122 > [logtoprocess]
111 > commandfinish=$TESTTMP/wait-output.sh 123 > commandfinish=$TESTTMP/wait-output.sh
112 > EOF 124 > EOF
113 $ hg version -q --pager=always 125 $ hg version -q --pager=always
114 Mercurial Distributed SCM (version *) (glob) 126 Mercurial Distributed SCM (version *) (glob)