Merge branch 'jc/test-prereq-validate'
Help us to find broken test script that splits the body part of the test by mistaken use of wrong kind of quotes. * jc/test-prereq-validate: test: validate prerequistes syntaxmaint
commit
072f391c53
|
@ -348,11 +348,18 @@ test_declared_prereq () {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_verify_prereq () {
|
||||||
|
test -z "$test_prereq" ||
|
||||||
|
expr >/dev/null "$test_prereq" : '[A-Z0-9_,!]*$' ||
|
||||||
|
error "bug in the test script: '$test_prereq' does not look like a prereq"
|
||||||
|
}
|
||||||
|
|
||||||
test_expect_failure () {
|
test_expect_failure () {
|
||||||
test_start_
|
test_start_
|
||||||
test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
|
test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
|
||||||
test "$#" = 2 ||
|
test "$#" = 2 ||
|
||||||
error "bug in the test script: not 2 or 3 parameters to test-expect-failure"
|
error "bug in the test script: not 2 or 3 parameters to test-expect-failure"
|
||||||
|
test_verify_prereq
|
||||||
export test_prereq
|
export test_prereq
|
||||||
if ! test_skip "$@"
|
if ! test_skip "$@"
|
||||||
then
|
then
|
||||||
|
@ -372,6 +379,7 @@ test_expect_success () {
|
||||||
test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
|
test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
|
||||||
test "$#" = 2 ||
|
test "$#" = 2 ||
|
||||||
error "bug in the test script: not 2 or 3 parameters to test-expect-success"
|
error "bug in the test script: not 2 or 3 parameters to test-expect-success"
|
||||||
|
test_verify_prereq
|
||||||
export test_prereq
|
export test_prereq
|
||||||
if ! test_skip "$@"
|
if ! test_skip "$@"
|
||||||
then
|
then
|
||||||
|
@ -400,6 +408,7 @@ test_external () {
|
||||||
error >&5 "bug in the test script: not 3 or 4 parameters to test_external"
|
error >&5 "bug in the test script: not 3 or 4 parameters to test_external"
|
||||||
descr="$1"
|
descr="$1"
|
||||||
shift
|
shift
|
||||||
|
test_verify_prereq
|
||||||
export test_prereq
|
export test_prereq
|
||||||
if ! test_skip "$descr" "$@"
|
if ! test_skip "$descr" "$@"
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue