diff options
Diffstat (limited to 'tests/t0010-validate-html.sh')
-rwxr-xr-x | tests/t0010-validate-html.sh | 31 |
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 | ||
3 | test_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 | ||
24 | prepare_tests 'Validate html with tidy' | 25 | tidy=`which tidy 2>/dev/null` |
25 | |||
26 | tidy=`which tidy` | ||
27 | test -n "$tidy" || { | 26 | test -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 | ||
33 | run_test 'index page' 'test_url ""' | 32 | test_expect_success 'index page' 'test_url ""' |
34 | run_test 'foo' 'test_url "foo"' | 33 | test_expect_success 'foo' 'test_url "foo"' |
35 | run_test 'foo/log' 'test_url "foo/log"' | 34 | test_expect_success 'foo/log' 'test_url "foo/log"' |
36 | run_test 'foo/tree' 'test_url "foo/tree"' | 35 | test_expect_success 'foo/tree' 'test_url "foo/tree"' |
37 | run_test 'foo/tree/file-1' 'test_url "foo/tree/file-1"' | 36 | test_expect_success 'foo/tree/file-1' 'test_url "foo/tree/file-1"' |
38 | run_test 'foo/commit' 'test_url "foo/commit"' | 37 | test_expect_success 'foo/commit' 'test_url "foo/commit"' |
39 | run_test 'foo/diff' 'test_url "foo/diff"' | 38 | test_expect_success 'foo/diff' 'test_url "foo/diff"' |
40 | 39 | ||
41 | tests_done | 40 | test_done |