mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-08-17 01:00:24 +03:00
[ test ] Set IDRIS2_PREFIX
to a local dir when testing
This commit is contained in:
parent
847b525189
commit
567f019230
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,6 +18,7 @@ idris2docs_venv
|
|||||||
/ipkg/build
|
/ipkg/build
|
||||||
|
|
||||||
/tests/**/build
|
/tests/**/build
|
||||||
|
/tests/**/prefix
|
||||||
/tests/**/output*
|
/tests/**/output*
|
||||||
/tests/**/*.so
|
/tests/**/*.so
|
||||||
/tests/**/*.dylib
|
/tests/**/*.dylib
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
. ../../../testutils.sh
|
. ../../../testutils.sh
|
||||||
|
|
||||||
export IDRIS2_PACKAGE_PATH=$IDRIS2_PREFIX/$NAME_VERSION
|
|
||||||
export IDRIS2_PREFIX=$test_dir/currently/nonexistent/dir/
|
export IDRIS2_PREFIX=$test_dir/currently/nonexistent/dir/
|
||||||
|
|
||||||
export IDRIS2_INC_CGS=
|
export IDRIS2_INC_CGS=
|
||||||
|
@ -6,7 +6,3 @@ idris2 --install baz.ipkg > /dev/null
|
|||||||
idris2 --build test.ipkg
|
idris2 --build test.ipkg
|
||||||
|
|
||||||
build/exec/test
|
build/exec/test
|
||||||
|
|
||||||
rm -r "${IDRIS2_PREFIX}"/idris2-*/foo-0
|
|
||||||
rm -r "${IDRIS2_PREFIX}"/idris2-*/bar-0
|
|
||||||
rm -r "${IDRIS2_PREFIX}"/idris2-*/baz-0
|
|
||||||
|
@ -9,6 +9,7 @@ idris2="$1"
|
|||||||
# Delete build files between runs to prevent unexpected differences.
|
# Delete build files between runs to prevent unexpected differences.
|
||||||
# As this is at the top-level, this is run when this script is imported.
|
# As this is at the top-level, this is run when this script is imported.
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
rm -rf prefix
|
||||||
|
|
||||||
idris2() {
|
idris2() {
|
||||||
$idris2 --no-banner --console-width 0 --no-color "$@"
|
$idris2 --no-banner --console-width 0 --no-color "$@"
|
||||||
@ -32,8 +33,30 @@ sed_literal() {
|
|||||||
# Folder containing the currently running test
|
# Folder containing the currently running test
|
||||||
if [ "$OS" = "windows" ]; then
|
if [ "$OS" = "windows" ]; then
|
||||||
test_dir="$(cygpath -m "$(pwd)")"
|
test_dir="$(cygpath -m "$(pwd)")"
|
||||||
|
SEP=";"
|
||||||
else
|
else
|
||||||
test_dir="$(pwd)"
|
test_dir="$(pwd)"
|
||||||
|
SEP=":"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set variables for hygiene testing
|
||||||
|
if [ -z "$PREFIX_CHANGED" ] && [ -n "$IDRIS2_PREFIX" ]; then
|
||||||
|
OLD_PREFIX="$IDRIS2_PREFIX"
|
||||||
|
NEW_PREFIX="$test_dir/prefix"
|
||||||
|
|
||||||
|
OLD_PP="$OLD_PREFIX/$NAME_VERSION"
|
||||||
|
NEW_PP="$NEW_PREFIX/$NAME_VERSION"
|
||||||
|
|
||||||
|
# Set where to look to installed stuff
|
||||||
|
export IDRIS2_PACKAGE_PATH="$OLD_PP$SEP$NEW_PP"
|
||||||
|
export IDRIS2_LIBS="$OLD_PP/libs$SEP$NEW_PP/libs"
|
||||||
|
export IDRIS2_DATA="$OLD_PP/support$SEP$NEW_PP/support"
|
||||||
|
|
||||||
|
# Set where to install stuff
|
||||||
|
export IDRIS2_PREFIX="$NEW_PREFIX"
|
||||||
|
|
||||||
|
# Save from re-sourcing this file several times
|
||||||
|
export PREFIX_CHANGED=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove test directory from output
|
# Remove test directory from output
|
||||||
|
Loading…
Reference in New Issue
Block a user