sh: Don't hardcode relative paths in the tests stderr files.

These paths have had to be adjusted to changes in the testsuite runner
several times, so modify the tests to remove the need for such adjustment.

A cp in functional_test.sh is now unneeded, but this matters little in
performance.
This commit is contained in:
Jilles Tjoelker 2014-08-17 14:26:12 +00:00
parent 2a7470b178
commit 1c9c6ea481
11 changed files with 11 additions and 17 deletions

View File

@ -1,2 +1,2 @@
# $FreeBSD$
${}
eval '${}'

View File

@ -1 +1 @@
./bad-parm-exp2.2: ${}: Bad substitution
eval: ${}: Bad substitution

View File

@ -1,2 +1,2 @@
# $FreeBSD$
${foo/}
eval '${foo/}'

View File

@ -1 +1 @@
./bad-parm-exp3.2: ${foo/}: Bad substitution
eval: ${foo/}: Bad substitution

View File

@ -1,2 +1,2 @@
# $FreeBSD$
${foo:@abc}
eval '${foo:@abc}'

View File

@ -1 +1 @@
./bad-parm-exp4.2: ${foo:@...}: Bad substitution
eval: ${foo:@...}: Bad substitution

View File

@ -1,2 +1,2 @@
# $FreeBSD$
${/}
eval '${/}'

View File

@ -1 +1 @@
./bad-parm-exp5.2: ${/}: Bad substitution
eval: ${/}: Bad substitution

View File

@ -1,2 +1,2 @@
# $FreeBSD$
${#foo^}
eval '${#foo^}'

View File

@ -1 +1 @@
./bad-parm-exp6.2: ${foo...}: Bad substitution
eval: ${foo...}: Bad substitution

View File

@ -39,13 +39,7 @@ check()
local out_file="${SRCDIR}/${tc}.stdout"
[ -f "${out_file}" ] && out_flag="-o file:${out_file}"
# We need to copy the testcase scenario file because some of the
# testcases hardcode relative paths in the stderr/stdout.
#
# TODO: we might be able to generate this path at build time
cp ${SRCDIR}/${tc} .
atf_check -s exit:${tc##*.} ${err_flag} ${out_flag} ${SH} "./${tc}"
atf_check -s exit:${tc##*.} ${err_flag} ${out_flag} ${SH} "${SRCDIR}/${tc}"
}
add_testcase()