aboutsummaryrefslogtreecommitdiffstats
path: root/tests/t0010-validate-html.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/t0010-validate-html.sh')
-rwxr-xr-xtests/t0010-validate-html.sh31
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/t0010-validate-html.sh b/tests/t0010-validate-html.sh
index 3fe4800..5bd0a25 100755
--- a/tests/t0010-validate-html.sh
+++ b/tests/t0010-validate-html.sh
@@ -1,5 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2 2
3test_description='Validate html with tidy'
3. ./setup.sh 4. ./setup.sh
4 5
5 6
@@ -7,9 +8,9 @@ test_url()
7{ 8{
8 tidy_opt="-eq" 9 tidy_opt="-eq"
9 test -z "$NO_TIDY_WARNINGS" || tidy_opt+=" --show-warnings no" 10 test -z "$NO_TIDY_WARNINGS" || tidy_opt+=" --show-warnings no"
10 cgit_url "$1" >trash/tidy-$test_count || return 11 cgit_url "$1" >tidy-$test_count || return
11 sed -ie "1,4d" trash/tidy-$test_count || return 12 sed -ie "1,4d" tidy-$test_count || return
12 "$tidy" $tidy_opt trash/tidy-$test_count 13 "$tidy" $tidy_opt tidy-$test_count
13 rc=$? 14 rc=$?
14 15
15 # tidy returns with exitcode 1 on warnings, 2 on error 16 # tidy returns with exitcode 1 on warnings, 2 on error
@@ -21,21 +22,19 @@ test_url()
21 fi 22 fi
22} 23}
23 24
24prepare_tests 'Validate html with tidy' 25tidy=`which tidy 2>/dev/null`
25
26tidy=`which tidy`
27test -n "$tidy" || { 26test -n "$tidy" || {
28 echo "Skipping tests: tidy not found" 27 skip_all='Skipping html validation tests: tidy not found'
29 tests_done 28 test_done
30 exit 29 exit
31} 30}
32 31
33run_test 'index page' 'test_url ""' 32test_expect_success 'index page' 'test_url ""'
34run_test 'foo' 'test_url "foo"' 33test_expect_success 'foo' 'test_url "foo"'
35run_test 'foo/log' 'test_url "foo/log"' 34test_expect_success 'foo/log' 'test_url "foo/log"'
36run_test 'foo/tree' 'test_url "foo/tree"' 35test_expect_success 'foo/tree' 'test_url "foo/tree"'
37run_test 'foo/tree/file-1' 'test_url "foo/tree/file-1"' 36test_expect_success 'foo/tree/file-1' 'test_url "foo/tree/file-1"'
38run_test 'foo/commit' 'test_url "foo/commit"' 37test_expect_success 'foo/commit' 'test_url "foo/commit"'
39run_test 'foo/diff' 'test_url "foo/diff"' 38test_expect_success 'foo/diff' 'test_url "foo/diff"'
40 39
41tests_done 40test_done