From bfe5e738e6a70f9958aebf16d37ce6eea7583dd1 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 08:19:33 -1000 Subject: 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. --- tests/Makefile | 6 ++++-- tests/setup.sh | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'tests') 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" } -- cgit 2.12.1