Support running tests from any directory

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Frédéric Mangano-Tarumi 2020-02-29 01:01:38 +01:00 committed by Lukas Fleischer
parent e374a91feb
commit 90c0a361b5
11 changed files with 12 additions and 13 deletions

View file

@ -1,7 +1,6 @@
TEST_DIRECTORY="$(pwd)" TOPLEVEL="$(cd "$(dirname "$0")/.." && pwd)"
TOPLEVEL="$(cd .. && pwd)"
. ./sharness.sh . "$TOPLEVEL/test/sharness.sh"
# Configure python search path. # Configure python search path.
PYTHONPATH="$TOPLEVEL" PYTHONPATH="$TOPLEVEL"

View file

@ -2,7 +2,7 @@
test_description='git-auth tests' test_description='git-auth tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test basic authentication.' ' test_expect_success 'Test basic authentication.' '
"$GIT_AUTH" "$AUTH_KEYTYPE_USER" "$AUTH_KEYTEXT_USER" >out && "$GIT_AUTH" "$AUTH_KEYTYPE_USER" "$AUTH_KEYTEXT_USER" >out &&

View file

@ -2,7 +2,7 @@
test_description='git-serve tests' test_description='git-serve tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test interactive shell.' ' test_expect_success 'Test interactive shell.' '
"$GIT_SERVE" 2>&1 | grep -q "Interactive shell is disabled." "$GIT_SERVE" 2>&1 | grep -q "Interactive shell is disabled."

View file

@ -2,7 +2,7 @@
test_description='git-update tests' test_description='git-update tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
dump_package_info() { dump_package_info() {
for t in Packages Licenses PackageLicenses Groups PackageGroups \ for t in Packages Licenses PackageLicenses Groups PackageGroups \

View file

@ -2,7 +2,7 @@
test_description='mkpkglists tests' test_description='mkpkglists tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test package list generation with no packages.' ' test_expect_success 'Test package list generation with no packages.' '
echo "DELETE FROM Packages;" | sqlite3 aur.db && echo "DELETE FROM Packages;" | sqlite3 aur.db &&

View file

@ -2,7 +2,7 @@
test_description='tuvotereminder tests' test_description='tuvotereminder tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test Trusted User vote reminders.' ' test_expect_success 'Test Trusted User vote reminders.' '
now=$(date -d now +%s) && now=$(date -d now +%s) &&

View file

@ -2,7 +2,7 @@
test_description='pkgmaint tests' test_description='pkgmaint tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test package base cleanup script.' ' test_expect_success 'Test package base cleanup script.' '
now=$(date -d now +%s) && now=$(date -d now +%s) &&

View file

@ -2,7 +2,7 @@
test_description='aurblup tests' test_description='aurblup tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test official provider update script.' ' test_expect_success 'Test official provider update script.' '
mkdir -p remote/test/foobar-1.0-1 && mkdir -p remote/test/foobar-1.0-1 &&

View file

@ -2,7 +2,7 @@
test_description='notify tests' test_description='notify tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test out-of-date notifications.' ' test_expect_success 'Test out-of-date notifications.' '
cat <<-EOD | sqlite3 aur.db && cat <<-EOD | sqlite3 aur.db &&

View file

@ -2,7 +2,7 @@
test_description='rendercomment tests' test_description='rendercomment tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test comment rendering.' ' test_expect_success 'Test comment rendering.' '
cat <<-EOD | sqlite3 aur.db && cat <<-EOD | sqlite3 aur.db &&

View file

@ -2,7 +2,7 @@
test_description='usermaint tests' test_description='usermaint tests'
. ./setup.sh . "$(dirname "$0")/setup.sh"
test_expect_success 'Test removal of login IP addresses.' ' test_expect_success 'Test removal of login IP addresses.' '
now=$(date -d now +%s) && now=$(date -d now +%s) &&