coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] maint: make some shell and perl scripts executable in 'tests


From: Pádraig Brady
Subject: Re: [PATCH] maint: make some shell and perl scripts executable in 'tests/'
Date: Sun, 21 Jul 2013 23:22:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 07/21/2013 10:00 PM, Bernhard Voelker wrote:
> Some newer test scripts - partially ones from me - are not executable.
> It does not seem to be a problem, but for consistency and to avoid
> future problems on unusual platforms or shells change the permissions
> by adding the executable bit.

Good one.
It's best to be consistent.

> +# Ensure that all version-controlled test scripts are executable.
> +sc_tests_executable:
> +     @for t in $(all_tests) \
> +       tests/factor/run.sh tests/factor/create-test.sh tests/init.sh; do \
> +       test -x $$t \
> +       || { echo "$(ME): Please make test executable: $$t" 1>&2; \
> +            exit 1; } \
> +     done; :
> +

It might be better to avoid shell looping which is relatively slow.
Also this names some tests explicitly and so might introduce maintenance 
overhead.
Also it only names the first script found without execute perms.
How about something like this instead?

find tests/ \( -name '*.sh' -o -name '*.pl' \) \! -perm /111 -print |
grep . && { echo ...; exit 1; }

thanks!
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]