Commit graph

11 commits

Author SHA1 Message Date
Avery Pennarun
c6020cf1cd t/shelltest.od: quiet some error messages that get printed during testing.
If the error message only triggered a shelltest warning instead of a
failure, then they're harmless, so we might as well silence them when
running 'redo test' (which runs t/shelltest.do, which enables
SHELLTEST_QUIET).  We still want to print them when actually testing out
shelltest.od, though, to help with debugging the script.
2011-05-08 01:25:20 -04:00
Avery Pennarun
b993e449f8 shelltest: use a more magical magic number for success.
There may be some odd situation where a shell returns 0 despite not executing
the script correctly; now 0 is an error condition.
2011-04-17 23:39:53 -04:00
Avery Pennarun
e9e24bb450 t/shelltest.od: another test for ${x#y} behaviour.
If y contains a * character, it's a case-esac style wildcard unless it's in
"" or '', which tells it to match a literal *.  But in dash/busybox, the ''
quoting doesn't actually work, only "" does.

Since there's a workaround - just always use "" quoting - it's not that
fatal.  If the "" quoting doesn't work, then we'll make it fail.
2011-04-02 16:30:14 -07:00
Avery Pennarun
03763177ff shelltest.od: a few more/better tests and clarification comments. 2011-04-02 15:41:52 -07:00
Avery Pennarun
ee32a965d8 shelltest.od: test that $1/$2/$3 are set correctly in "." scripts.
dash seems to fail this one, and it's not pretty.
2011-02-28 22:07:21 -08:00
Avery Pennarun
32f584cb1c shelltest: detect the ". of empty script" shell problem. 2011-02-28 22:06:57 -08:00
Avery Pennarun
71316cc99a shelltest.od: abort correctly if 'cd ~' fails.
It seems 'set -e' doesn't quite work, in some shells, in that case.

Eric Kow wrote:
> I saw this warning, by the way:
> redo      t/shelltest
>   warning: 94
> cd: 271: can't cd to /opt/redo-0.05/t/space
> rmdir: failed to remove pace home dir': No such file or directory
>   warning: 111
2011-01-19 13:54:51 -08:00
Avery Pennarun
474f2e71fe shelltest: confirm that 'local' is definitely available.
Supposedly it's not POSIX, but every shell I have seems to support it, so
let's just reject any that don't.  And like magic, anybody using redo can
now count on the 'local' builtin working.
2011-01-18 00:48:51 -08:00
Avery Pennarun
5dbbfd4288 shelltest: die if 'cd ~' can't handle spaces in $HOME.
This fails on ash, dash, and busybox sh (for now).  But it's kind of
important since $HOME often has spaces on Win32.  I hope dash will be fixed
relatively soon.

I downgraded it to a warning since on Unix, this probably isn't a problem.
2011-01-18 00:48:51 -08:00
Avery Pennarun
eea3f5446a redo-sh: keep testing even after finding a 'good' shell.
Otherwise we miss out on seeing the results from additional tests.
2011-01-02 12:00:37 -08:00
Avery Pennarun
fb388b3dde Automatically select a good shell instead of relying on /bin/sh.
This includes a fairly detailed test of various known shell bugs from the
autoconf docs.

The idea here is that if redo works on your system, you should be able to
rely on a *good* shell to run your .do files; you shouldn't have to work
around zillions of bugs like autoconf does.
2010-12-21 04:44:39 -08:00