Skip to content

Commit

Permalink
check: shorten names of testcase outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
ndim committed Jan 14, 2019
1 parent 7f83007 commit 7ea8692
Show file tree
Hide file tree
Showing 27 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -30,6 +30,10 @@
/tests/*.actual.output
/tests/*.output.actual.new
/tests/*.output.actual
/tests/*.actual.new
/tests/*.actual
/tests/*.output.new
/tests/*.output

# Misc results
*.strace
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions tests/run-tests
Expand Up @@ -69,31 +69,31 @@ for executable; do
export FREQ="${FREQS[${freq_idx}]}"
base="$(basename $(basename "$test" .bash) .sh)"
dir="$(dirname "$test")"
actual="${dir}/${executable}--${base}.output.actual"
actual="${dir}/${executable}--${base}.actual"
printf "${hilite}%-13s${normal} ${hilite}%-32s${normal} " "${executable}" "${base}"
if "${test}" > "${actual}.new" 2>&1; then
canonicalize_output < "${actual}.new" > "${actual}"
expects_output=false
for file in "${dir}/${base}.output.expected".[0-9]; do
for file in "${dir}/${base}.expected".[0-9]; do
if test -f "$file"; then
expects_output=true
break
fi
done
if "${expects_output}"; then
expect_fail="true"
for expected in "${dir}/${base}.output.expected".[0-9]; do
for expected in "${dir}/${base}.expected".[0-9]; do
if ${CMP} --quiet "${expected}" "${actual}"; then
pass="$(expr "${pass}" + 1)"
echo "${passmsg}${expected/#*output.expected}"
echo "${passmsg}${expected/#*expected}"
expect_fail="false"
break
fi
done
if "$expect_fail"; then
fail="$(expr "${fail}" + 1)"
echo "${failmsg}"
for expected in "${dir}/${base}.output.expected".[0-9]; do
for expected in "${dir}/${base}.expected".[0-9]; do
${DIFF} -u "${expected}" "${actual}"
done
fi
Expand Down

0 comments on commit 7ea8692

Please sign in to comment.