[darcs-users] darcs patch: Print expansions of simple commands in testsuite output.

Trent W. Buck twb at cybersource.com.au
Mon Sep 7 01:26:21 UTC 2009


Jason Dagit <dagit at codersbase.com> writes:

> On Sun, Sep 6, 2009 at 6:35 AM, Petr Rockai<me at mornfall.net> wrote:
>> Hi,
>>
>> another testsuite patch (I'd like to see what goes on in the timestamp test on
>> windows -- I'm inclined to just disable it, since with darcs-hs, the timestamps
>> of pristine files are irrelevant, but i'd still like to see what goes wrong
>> first). Even if it was not for the specific issue, the patch should still be,
>> IMHO, applied, as it improves the output quite a bit.
>>
>> Yours,
>>   Petr.
>>
>> Sun Sep  6 15:31:35 CEST 2009  Petr Rockai <me at mornfall.net>
>>  * Print expansions of simple commands in testsuite output.
>>
>>  This helps with debugging failures, since we see the exact command that was
>>  executed, after all shell expansion has been done. Moreover, we see exactly
>>  which command failed -- the existing -v will eg. print a whole "if" statement
>>  with body and it cannot be discerned which branch was taken or which command
>>  exactly has failed.
>
> Now when I run the tests on OSX I see:
> Running issue1465_ortryrunning.sh ...            failed.
> Probable reason :
> ## I would use the builtin !, but that has the wrong semantics.
> not () { "$@" && exit 1 || :; }
>
> # trick: OS-detection (if needed)
> abort_windows () {
> if echo $OS | grep -i windows; then
>   echo This test does not work on Windows
>   exit 200
> fi
> }
>
> pwd() {
>     ghc --make "$TESTS_WD/hspwd.hs"
>     "$TESTS_WD/hspwd"
> }
> rm -rf R                        # Another script may have left a mess.
> + rm -rf R
> darcs init      --repo R        # Create our test repo.
> + darcs init --repo R
> mkdir R/d                       # Change the working tree.
> + mkdir R/d
>
> # Set the editor to a program that just fails (VISUAL), make Darcs use
> # it (--edit), and then make sure when it brokenly launches a fallback
> # editor, that editor will exit because stdin isn't a tty (/dev/null).
> not env -u TERM VISUAL=false </dev/null &>R/log \
> darcs record    --repo R -lam 'Initial commit.' --edit
> + not env -u TERM VISUAL=false darcs record --repo R -lam 'Initial
> commit.' --edit
>
> # If Darcs did the right thing, the output won't make any mention of
> # the fallback editors.
> not egrep -i 'not found|vi|emacs|nano|edit' R/log
> + not egrep -i 'not found|vi|emacs|nano|edit' R/log
> + egrep -i 'not found|vi|emacs|nano|edit' R/log
> + env -u TERM VISUAL=false darcs record --repo R -lam 'Initial commit.' --edit
> + exit 1
>
> Any idea what the problem is?

I have no idea.  Can you get me a copy of R/log when this happens?



More information about the darcs-users mailing list