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/t0104-tree.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/t0104-tree.sh')
-rwxr-xr-x | tests/t0104-tree.sh | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 7aa3b8d..100b026 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh | |||
@@ -1,33 +1,32 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | test_description='Check content on tree page' | ||
3 | . ./setup.sh | 4 | . ./setup.sh |
4 | 5 | ||
5 | prepare_tests "Check content on tree page" | 6 | test_expect_success 'generate bar/tree' 'cgit_url "bar/tree" >tmp' |
7 | test_expect_success 'find file-1' 'grep "file-1" tmp' | ||
8 | test_expect_success 'find file-50' 'grep "file-50" tmp' | ||
6 | 9 | ||
7 | run_test 'generate bar/tree' 'cgit_url "bar/tree" >trash/tmp' | 10 | test_expect_success 'generate bar/tree/file-50' 'cgit_url "bar/tree/file-50" >tmp' |
8 | run_test 'find file-1' 'grep "file-1" trash/tmp' | ||
9 | run_test 'find file-50' 'grep "file-50" trash/tmp' | ||
10 | 11 | ||
11 | run_test 'generate bar/tree/file-50' 'cgit_url "bar/tree/file-50" >trash/tmp' | 12 | test_expect_success 'find line 1' ' |
12 | 13 | grep "<a class=.no. id=.n1. name=.n1. href=.#n1.>1</a>" tmp | |
13 | run_test 'find line 1' ' | ||
14 | grep "<a class=.no. id=.n1. name=.n1. href=.#n1.>1</a>" trash/tmp | ||
15 | ' | 14 | ' |
16 | 15 | ||
17 | run_test 'no line 2' ' | 16 | test_expect_success 'no line 2' ' |
18 | ! grep "<a class=.no. id=.n2. name=.n2. href=.#n2.>2</a>" trash/tmp | 17 | ! grep "<a class=.no. id=.n2. name=.n2. href=.#n2.>2</a>" tmp |
19 | ' | 18 | ' |
20 | 19 | ||
21 | run_test 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >trash/tmp' | 20 | test_expect_success 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >tmp' |
22 | 21 | ||
23 | run_test 'verify a+b link' ' | 22 | test_expect_success 'verify a+b link' ' |
24 | grep "/foo+bar/tree/a+b" trash/tmp | 23 | grep "/foo+bar/tree/a+b" tmp |
25 | ' | 24 | ' |
26 | 25 | ||
27 | run_test 'generate foo+bar/tree?h=1+2' 'cgit_url "foo%2bbar/tree&h=1%2b2" >trash/tmp' | 26 | test_expect_success 'generate foo+bar/tree?h=1+2' 'cgit_url "foo%2bbar/tree&h=1%2b2" >tmp' |
28 | 27 | ||
29 | run_test 'verify a+b?h=1+2 link' ' | 28 | test_expect_success 'verify a+b?h=1+2 link' ' |
30 | grep "/foo+bar/tree/a+b?h=1%2b2" trash/tmp | 29 | grep "/foo+bar/tree/a+b?h=1%2b2" tmp |
31 | ' | 30 | ' |
32 | 31 | ||
33 | tests_done | 32 | test_done |