summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-09-20 20:52:34 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-09-29 22:07:24 +0200
commit1a999810e3a6da21181c91f6b383f69db399cf1c (patch)
tree6131d61b15e3bb03e55c8e62a527b8cd9812e690
parent8c99184f6d0922a7a4076d0c050a924e07a42b3d (diff)
downloadaur-1a999810e3a6da21181c91f6b383f69db399cf1c.tar.gz
aur-1a999810e3a6da21181c91f6b383f69db399cf1c.tar.xz
Make test suite paths top-level directory relative
Determine the top-level directory before running tests and make all script paths relative to that directory. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
-rw-r--r--git-interface/test/setup.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/git-interface/test/setup.sh b/git-interface/test/setup.sh
index d269af66..0995f053 100644
--- a/git-interface/test/setup.sh
+++ b/git-interface/test/setup.sh
@@ -1,15 +1,16 @@
TEST_DIRECTORY="$(pwd)"
+TOPLEVEL="$(cd ../.. && pwd)"
. ./sharness.sh
# Configure python search path.
-PYTHONPATH="$TEST_DIRECTORY/../../"
+PYTHONPATH="$TOPLEVEL"
export PYTHONPATH
# Configure paths to the Git interface scripts.
-GIT_AUTH="$TEST_DIRECTORY/../git-auth.py"
-GIT_SERVE="$TEST_DIRECTORY/../git-serve.py"
-GIT_UPDATE="$TEST_DIRECTORY/../git-update.py"
+GIT_AUTH="$TOPLEVEL/git-interface/git-auth.py"
+GIT_SERVE="$TOPLEVEL/git-interface/git-serve.py"
+GIT_UPDATE="$TOPLEVEL/git-interface/git-update.py"
# Create the configuration file and a dummy notification script.
cat >config <<-EOF
@@ -86,7 +87,7 @@ sed \
-e 's/ ENGINE = InnoDB//' \
-e 's/ [A-Z]* UNSIGNED NOT NULL AUTO_INCREMENT/ INTEGER NOT NULL/' \
-e 's/([0-9, ]*) UNSIGNED / UNSIGNED /' \
- "$TEST_DIRECTORY/../../schema/aur-schema.sql" | sqlite3 aur.db
+ "$TOPLEVEL/schema/aur-schema.sql" | sqlite3 aur.db
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (1, 'user', '!', 'user@localhost', 1);" | sqlite3 aur.db
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (2, 'tu', '!', 'tu@localhost', 2);" | sqlite3 aur.db