Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Trim the tidy check down to what it does
Nothing sets NO_TIDY_WARNINGS, and a warning never fails the check, so
the knob only quieted the output of a verbose run.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0002-html-validity.sh | 20 |
1 file changed, 3 insertions, 17 deletions
diff --git a/tests/t0002-html-validity.sh b/tests/t0002-html-validity.sh index 15875ba..65f6a48 100755 --- a/tests/t0002-html-validity.sh +++ b/tests/t0002-html-validity.sh @@ -9,30 +9,16 @@ test_description='Validate html with tidy' . ./setup.sh test_url() { - tidy_options="-eq" - test -z "$NO_TIDY_WARNINGS" || tidy_options="$tidy_options --show-warnings no" # A second argument names a config of its own, for pages the shared # config keeps turned off. - if test -n "$2" - then - CGIT_CONFIG="$PWD/$2" QUERY_STRING="url=$1" cgit >tidy-$test_count.tmp || return - else - cgit_url "$1" >tidy-$test_count.tmp || return - fi + CGIT_CONFIG="$PWD/${2:-cgitrc}" QUERY_STRING="url=$1" cgit >tidy-$test_count.tmp || return # Tidy reads what it is given as a whole document, so the response # headers are dropped before it sees the page. strip_headers <tidy-$test_count.tmp >tidy-$test_count || return - "$tidy" $tidy_options tidy-$test_count - status=$? - # Tidy leaves with 1 for warnings and 2 for errors, and only an error is # worth failing the test over. - if test $status = 2 - then - false - else - : - fi + "$tidy" -eq tidy-$test_count + test $? != 2 } tidy=$(command -v tidy) || { |
