Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Correct the comments on the test plumbing
cgit_rc keeps its name, close as it is to cgitrc_repo and cgitrc_copy,
since every script calls it, so a comment now says what it runs.
| -rw-r--r-- | Makefile | 5 | |
| -rw-r--r-- | tests/Makefile | 6 | |
| -rwxr-xr-x | tests/setup.sh | 7 |
3 files changed, 13 insertions, 5 deletions
@@ -101,8 +101,9 @@ test: cgit-with-git +@$(MAKE) cgit-nolua +@$(MAKE) -C tests all -# The test helpers link against a fully built Git tree, so this asks the sub -# make for Git's own all target alongside cgit. +# The test library refuses to start without Git's own build, its bin-wrappers, +# templates and test-tool among it, so this asks the sub make for Git's all +# target alongside cgit. .PHONY: cgit-with-git cgit-with-git: +@$(MAKE) cgit EXTRA_GIT_TARGETS=all diff --git a/tests/Makefile b/tests/Makefile index bd6aad9..a693e92 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -7,8 +7,10 @@ .DEFAULT_GOAL := all .SUFFIXES: -# SHELL_PATH comes from Git's platform detection, and cgit.conf may override it, -# so both are read before anything below uses it. +# Git's platform detection names a shell only for the few systems whose /bin/sh +# cannot run the tests, such as SunOS and UnixWare, and cgit.conf may name one +# too, so both are read before anything below uses SHELL_PATH. Elsewhere it is +# the /bin/sh make runs recipes with. include ../vendor/git/config.mak.uname -include ../cgit.conf diff --git a/tests/setup.sh b/tests/setup.sh index d69fce7..d631197 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -45,7 +45,7 @@ TEST_OUTPUT_DIRECTORY=$(pwd) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME # The library would otherwise leave a repository of its own in the trash -# directory, and every repository these tests want is built by mkrepo below. +# directory, and the tests build the repositories they want themselves. TEST_NO_CREATE_REPO=YesPlease . "$TEST_DIRECTORY"/test-lib.sh @@ -247,10 +247,15 @@ cgitrc_copy() { } >"$cgitrc_file" } +# Runs cgit on the config file named first for the query string named second, +# passing on its output and its exit status, which is 0 for an error page too. cgit_rc() { CGIT_CONFIG="$PWD/$1" QUERY_STRING="$2" cgit } +# These two ask the shared config, which keeps each page in a cache keyed on +# the request alone. A test that changes a repository and asks again for a page +# fetched before gets the old copy back, unless it uses cgit_ok_url. cgit_query() { cgit_rc cgitrc "$1" } |
