diff options
author | John Keeping | 2013-04-01 15:09:05 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2013-04-08 22:27:11 +0200 |
commit | c95cc5ec56dbb7394015eb18201403be6d80f69b (patch) | |
tree | 7014b96a1a1408b5291532c0c442082aba693a80 /tests/t0010-validate-html.sh | |
parent | 8a92df033e974af6338b530a0d78d1bdb0b0f918 (diff) | |
download | cgit-c95cc5ec56dbb7394015eb18201403be6d80f69b.tar.gz cgit-c95cc5ec56dbb7394015eb18201403be6d80f69b.tar.bz2 cgit-c95cc5ec56dbb7394015eb18201403be6d80f69b.zip |
tests: use Git's test framework
This allows tests to run in parallel as well as letting us use "prove"
or another TAP harness to run the tests.
Git's test framework requires Git to be fully built before letting any
tests run, so add a new target to the top-level Makefile which builds
all of Git instead of just libgit.a and make the "test" target depend on
that.
Signed-off-by: John Keeping <john@keeping.me.uk>
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 |