[darcs-users] darcs patch: issue 538: set scripts executable before... (and 2 more)

David Roundy droundy at darcs.net
Fri May 2 18:49:34 UTC 2008


On Fri, May 02, 2008 at 07:17:08PM +0200, Reinier Lamers wrote:
> Thu May  1 22:36:44 CEST 2008  tux_rocker at reinier.de
>   * issue 538: set scripts executable before test if user desires
> 
> Fri May  2 00:15:28 CEST 2008  tux_rocker at reinier.de
>   * Added test for issue 538
> 
> Fri May  2 17:43:49 CEST 2008  tux_rocker at reinier.de
>   * Fix test for issue 538

Applied, thanks!

For future reference: I actually prefer shell-script tests that don't use
the TAP approach.  When something goes wrong, I find it *far* easier to
diagnose the problem when it's demonstrated by a simple shell script using
"set -ev".

Also, I am much more comfortable with the test exiting after it encounters
an error, rather than continuing to run.  The behavior of continuing to run
tests after failure strikes me as downright dangerous.  True, if your test
scripts are bug-free it can be made safe, but it's far safer to simply exit
when the script encounters an error.  The problem, of course, being that
there are no tests for bugs in the test scripts.

In case I've been vague, here's an example bug that would delete your
repository when you run make check:

# (correct code to create repository foo)
$DARCS get food bar
cd bar
$DARCS obliterate -a

Of course, few people would write such stupid code using obliterate, but
buggy test scripts have often added files and/or directories to my darcs
repository, and it's only luck that has kept them from recording or
unrecording changes.  For which reason, I'd prefer to avoid introducing new
perl tests when possible, and definitely would prefer for all the shell
tests to be run with set -ev.  It's so easy to write (and read!) good tests
in shell that there's no need to add this extra complexity.
-- 
David Roundy
Department of Physics
Oregon State University


More information about the darcs-users mailing list