git-lfs/test/testenv.sh

39 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/sh
2015-05-19 01:09:32 +00:00
# Including in script/integration and every test/test-*.sh file.
set -e
2015-05-19 22:54:15 +00:00
# The root directory for the git-lfs repository
ROOTDIR=$(cd $(dirname "$0")/.. && pwd)
2015-05-19 22:54:15 +00:00
# Where Git LFS outputs the compiled binaries
BINPATH="$ROOTDIR/bin"
2015-05-19 22:54:15 +00:00
# Put bin path on PATH
PATH="$BINPATH:$PATH"
# create a temporary work space
2015-05-21 21:01:35 +00:00
TMPDIR=${GIT_LFS_TEST_DIR:-"$(cd $(dirname "$0")/.. && pwd)/tmp"}
2015-05-19 22:54:15 +00:00
# This is unique to every test file, and cleared after every test run.
TRASHDIR="$TMPDIR/$(basename "$0")-$$"
2015-05-19 22:54:15 +00:00
# Points to the git-lfs binary compiled just for the tests
GITLFS="$BINPATH/git-lfs"
2015-05-19 22:54:15 +00:00
# The directory that the test Git server works from. This cleared at the
# beginning of every test run.
REMOTEDIR="$ROOTDIR/test/remote"
2015-05-19 22:54:15 +00:00
# This is the prefix for Git config files. See the "Test Suite" section in
# test/README.md
LFS_CONFIG="$REMOTEDIR/config"
2015-05-19 22:54:15 +00:00
# This file contains the URL of the test Git server. See the "Test Suite"
# section in test/README.md
LFS_URL_FILE="$REMOTEDIR/url"
mkdir -p "$TRASHDIR"
. "test/testhelpers.sh"