Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Add the shared config writers and cgit_rc
The helpers are named by kind. cgitrc_repo and cgitrc_copy write the config file named first, and cgit_url, cgit_query and cgit_rc run cgit, each named after what it is handed first. A repository copies its defaults from the globals read before its repo.url, so cgitrc_repo places every setting itself, and a global can no longer land where it silently stops applying. The t00xx and t01xx files move to them here.
Diffstat (limited to '')
-rwxr-xr-xtests/t0002-html-validity.sh11
1 file changed, 2 insertions, 9 deletions
diff --git a/tests/t0002-html-validity.sh b/tests/t0002-html-validity.sh
index b9020d6..bdccaf2 100755
--- a/tests/t0002-html-validity.sh
+++ b/tests/t0002-html-validity.sh
@@ -11,7 +11,7 @@ test_description='Validate html with tidy'
test_url() {
# A second argument names a config of its own, for pages the shared
# config keeps turned off.
- CGIT_CONFIG="$PWD/${2:-cgitrc}" QUERY_STRING="url=$1" cgit >tidy-$test_count.tmp || return
+ cgit_rc "${2:-cgitrc}" "url=$1" >tidy-$test_count.tmp || return
# Tidy reads what it is given as a whole document, so the response
# headers are dropped before it sees the page.
strip_headers <tidy-$test_count.tmp >tidy-$test_count || return
@@ -49,14 +49,7 @@ test_expect_success 'error page' 'test_url "no-such-repo"'
# Stats and blame stay off in the shared config, so their pages validate
# through a config of their own.
test_expect_success 'set up a features config' '
- {
- echo "virtual-root=/" &&
- echo "cache-size=0" &&
- echo "max-stats=year" &&
- echo "enable-blame=1" &&
- echo "repo.url=feat" &&
- echo "repo.path=$PWD/repos/foo/.git"
- } >featrc
+ cgitrc_repo featrc feat max-stats=year enable-blame=1 "repo.path=$PWD/repos/foo/.git"
'
test_expect_success 'stats page' 'test_url "feat/stats/" featrc'