1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
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"
cgit_url "$1" >tidy-$test_count.tmp || return
strip_headers <tidy-$test_count.tmp >tidy-$test_count || return
"$tidy" $tidy_options tidy-$test_count
status=$?
if test $status = 2
then
false
else
:
fi
}
tidy=$(command -v tidy) || {
skip_all='Skipping html validation tests: tidy not found'
test_done
exit
}
printf '<!DOCTYPE html>\n<html lang="en"><head><title>t</title></head><body><header>x</header></body></html>\n' \
| "$tidy" -q -e >/dev/null 2>&1
test $? -ge 2 && {
skip_all='Skipping html validation tests: tidy is too old for HTML5'
test_done
exit
}
test_expect_success 'index page' 'test_url ""'
test_expect_success 'foo' 'test_url "foo"'
test_expect_success 'foo/log' 'test_url "foo/log"'
test_expect_success 'foo/tree' 'test_url "foo/tree"'
test_expect_success 'foo/tree/file-1' 'test_url "foo/tree/file-1"'
test_expect_success 'foo/commit' 'test_url "foo/commit"'
test_expect_success 'foo/diff' 'test_url "foo/diff"'
test_done
|