Skip to content

Commit

Permalink
Added tests for better code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
henryso committed Feb 3, 2016
1 parent 169a428 commit 22c2294
Show file tree
Hide file tree
Showing 57 changed files with 830 additions and 117 deletions.
96 changes: 48 additions & 48 deletions harness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function gabc_gtex_test {
testing "$filename" "$filename.result" "gabc_gtex_clean '$filename'"

export TEXINPUTS="$(dirname "$filename"):"
if eval $gregorio -W -f gabc -F gtex -o "$outfile" -l "$logfile" "$filename"
if eval $gregorio -Wv -f gabc -F gtex -o "$outfile" -l "$logfile" "$filename"
then
if [[ "$filename" == */should-fail/* ]]
then
Expand Down Expand Up @@ -283,7 +283,7 @@ function gabc_dump_test {
testing "$filename" "$filename.result" "gabc_dump_clean '$filename'"

export TEXINPUTS="$(dirname "$filename"):"
if eval $gregorio -W -f gabc -F dump -o "$outfile" -l "$logfile" "$filename"
if eval $gregorio -Wv -f gabc -F dump -o "$outfile" -l "$logfile" "$filename"
then
if [[ "$filename" == */should-fail/* ]]
then
Expand Down Expand Up @@ -345,7 +345,7 @@ function gabc_gabc_test {
testing "$filename" "$filename.result" "gabc_gabc_clean '$filename'"

export TEXINPUTS="$(dirname "$filename"):"
if eval $gregorio -W -f gabc -F gabc -o "$outfile" -l "$logfile" "$filename"
if eval $gregorio -Wv -f gabc -F gabc -o "$outfile" -l "$logfile" "$filename"
then
if [[ "$filename" == */should-fail/* ]]
then
Expand Down Expand Up @@ -401,6 +401,51 @@ function gabc_gabc_view_output {
}
register gabc_gabc

function scripted_find {
find scripted -name '*.sh' -print
}
function scripted_test {
indir="$(dirname "$1")"
filename="$(basename "$1")"
outfile="${filename%.sh}.log"
logfile="${filename%.sh}.log"

testing "$1" "$filename.result" "scripted_clean '$filename'"

if cd "$indir"
then
if bash "$filename" >"$outfile" 2>"$logfile"
then
pass
else
fail "Failed to compile" "Failed to compile $filename"
fi
else
fail "Failed to create directory" "Could not change to $indir"
fi

return $RESULT
}
function scripted_clean {
true
}
function scripted_accept {
echo "Nothing to accept"
}
function scripted_view_log {
view_text "${1%.sh}.log"
}
function scripted_view_diff {
echo "Nothing to diff"
}
function scripted_view_expected {
echo "No expectation to view"
}
function scripted_view_output {
view_text "${1%.sh}.out"
}
register scripted

function typeset_and_compare {
indir="$1"; shift
outdir="$1"; shift
Expand Down Expand Up @@ -685,48 +730,3 @@ function plain_tex_view_output {
view_pdf "$indir/$outdir/${filename%.tex}.pdf"
}
register plain_tex

function scripted_find {
find scripted -name '*.sh' -print
}
function scripted_test {
indir="$(dirname "$1")"
filename="$(basename "$1")"
outfile="${filename%.sh}.log"
logfile="${filename%.sh}.log"

testing "$1" "$filename.result" "scripted_clean '$filename'"

if cd "$indir"
then
if bash "$filename" >"$outfile" 2>"$logfile"
then
pass
else
fail "Failed to compile" "Failed to compile $filename"
fi
else
fail "Failed to create directory" "Could not change to $indir"
fi

return $RESULT
}
function scripted_clean {
true
}
function scripted_accept {
echo "Nothing to accept"
}
function scripted_view_log {
view_text "${1%.sh}.log"
}
function scripted_view_diff {
echo "Nothing to diff"
}
function scripted_view_expected {
echo "No expectation to view"
}
function scripted_view_output {
view_text "${1%.sh}.out"
}
register scripted
Loading

0 comments on commit 22c2294

Please sign in to comment.