1 # This file should be sourced by all test-scripts
4 # prepare_tests(description) - setup for testing, i.e. create repos+config
5 # run_test(description, script) - run one test, i.e. eval script
8 # cgit_query(querystring) - call cgit with the specified querystring
9 # cgit_url(url) - call cgit with the specified virtual url
14 # prepare_tests "html validation"
15 # run_test 'repo index' 'cgit_url "/" | tidy -e'
16 # run_test 'repo summary' 'cgit_url "/foo" | tidy -e'
18 : ${TEST_DIRECTORY=$(pwd)/../git/t}
19 : ${TEST_OUTPUT_DIRECTORY=$(pwd)}
20 TEST_NO_CREATE_REPO=YesPlease
21 . "$TEST_DIRECTORY"/test-lib.sh
23 # Prepend the directory containing cgit to PATH.
24 PATH="$(pwd)/../..:$PATH"
29 test_create_repo "$name"
33 while test $n -le $count
37 git commit -m "commit $n"
40 if test "$3" = "testplus"
44 git commit -m "add a+b"
54 mkrepo repos/foo 5 >/dev/null
55 mkrepo repos/bar 50 >/dev/null
56 mkrepo repos/foo+bar 10 testplus >/dev/null
57 mkrepo "repos/with space" 2 >/dev/null
63 snapshots=tar.gz tar.bz zip
64 enable-log-filecount=1
65 enable-log-linecount=1
69 clone-url=git://example.org/\$CGIT_REPO_URL.git
72 repo.path=$PWD/repos/foo/.git
73 # Do not specify a description for this repo, as it then will be assigned
74 # the constant value "[no description]" (which actually used to cause a
78 repo.path=$PWD/repos/bar/.git
79 repo.desc=the bar repo
82 repo.path=$PWD/repos/foo+bar/.git
83 repo.desc=the foo+bar repo
86 repo.path=$PWD/repos/with space/.git
93 CGIT_CONFIG="$PWD/cgitrc" QUERY_STRING="$1" cgit
98 CGIT_CONFIG="$PWD/cgitrc" QUERY_STRING="url=$1" cgit
104 test -z "$line" && break
109 test -z "$CGIT_TEST_NO_CREATE_REPOS" && setup_repos