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/t0101-index.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/t0101-index.sh')
-rwxr-xr-x | tests/t0101-index.sh | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index ab63aca..82ef9b0 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh | |||
@@ -1,18 +1,17 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | test_description='Check content on index page' | ||
3 | . ./setup.sh | 4 | . ./setup.sh |
4 | 5 | ||
5 | prepare_tests "Check content on index page" | 6 | test_expect_success 'generate index page' 'cgit_url "" >tmp' |
7 | test_expect_success 'find foo repo' 'grep "foo" tmp' | ||
8 | test_expect_success 'find foo description' 'grep "\[no description\]" tmp' | ||
9 | test_expect_success 'find bar repo' 'grep "bar" tmp' | ||
10 | test_expect_success 'find bar description' 'grep "the bar repo" tmp' | ||
11 | test_expect_success 'find foo+bar repo' 'grep ">foo+bar<" tmp' | ||
12 | test_expect_success 'verify foo+bar link' 'grep "/foo+bar/" tmp' | ||
13 | test_expect_success 'verify "with%20space" link' 'grep "/with%20space/" tmp' | ||
14 | test_expect_success 'no tree-link' '! grep "foo/tree" tmp' | ||
15 | test_expect_success 'no log-link' '! grep "foo/log" tmp' | ||
6 | 16 | ||
7 | run_test 'generate index page' 'cgit_url "" >trash/tmp' | 17 | test_done |
8 | run_test 'find foo repo' 'grep "foo" trash/tmp' | ||
9 | run_test 'find foo description' 'grep "\[no description\]" trash/tmp' | ||
10 | run_test 'find bar repo' 'grep "bar" trash/tmp' | ||
11 | run_test 'find bar description' 'grep "the bar repo" trash/tmp' | ||
12 | run_test 'find foo+bar repo' 'grep ">foo+bar<" trash/tmp' | ||
13 | run_test 'verify foo+bar link' 'grep "/foo+bar/" trash/tmp' | ||
14 | run_test 'verify "with%20space" link' 'grep "/with%20space/" trash/tmp' | ||
15 | run_test 'no tree-link' '! grep "foo/tree" trash/tmp' | ||
16 | run_test 'no log-link' '! grep "foo/log" trash/tmp' | ||
17 | |||
18 | tests_done | ||