[ re #1162 ] Test without install (#1240)

Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
This commit is contained in:
Mathew Polzin 2021-04-05 03:27:56 -07:00 committed by GitHub
parent 7714bdf3fd
commit 178f26ec17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ result
*.d
*.a
*.dll
*.dylib
# Editor/IDE Related
.\#* # Emacs swap file

View File

@ -37,6 +37,10 @@ else
SEP := :
endif
# Library and data paths for test
IDRIS2_TEST_LIBS ?= ${IDRIS2_CURDIR}/lib
IDRIS2_TEST_DATA ?= ${IDRIS2_CURDIR}/support
# Library and data paths for bootstrap-test
IDRIS2_BOOT_TEST_LIBS := ${IDRIS2_CURDIR}/bootstrap/${NAME}-${IDRIS2_VERSION}/lib
IDRIS2_BOOT_TEST_DATA := ${IDRIS2_CURDIR}/bootstrap/${NAME}-${IDRIS2_VERSION}/support
@ -47,15 +51,19 @@ export IDRIS2_BOOT_PATH := "${IDRIS2_CURDIR}/libs/prelude/build/ttc${SEP}${IDRIS
export SCHEME
.PHONY: all idris2-exec ${TARGET} testbin support support-clean clean distclean FORCE
.PHONY: all idris2-exec ${TARGET} testbin support support-lib support-clean clean distclean FORCE
all: support ${TARGET} libs
all: support ${TARGET} support-lib libs
idris2-exec: ${TARGET}
${TARGET}: src/IdrisPaths.idr
${IDRIS2_BOOT} --build ${IDRIS2_APP_IPKG}
support-lib:
mkdir -p lib
install support/c/${IDRIS2_SUPPORT} lib
# We use FORCE to always rebuild IdrisPath so that the git SHA1 info is always up to date
src/IdrisPaths.idr: FORCE
echo '-- @generated' > src/IdrisPaths.idr
@ -82,15 +90,15 @@ test-lib: contrib
libs : prelude base contrib network test-lib
testbin: test-lib
@${MAKE} -C tests testbin IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH}
testbin:
@${MAKE} -C tests testbin IDRIS2=../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_DATA=${IDRIS2_TEST_DATA} IDRIS2_LIBS=${IDRIS2_TEST_LIBS}
test: testbin
@echo
@echo "NOTE: \`${MAKE} test\` does not rebuild idris; to do that run \`${MAKE}\`"
@echo "NOTE: \`${MAKE} test\` does not rebuild Idris or the libraries packaged with it; to do that run \`${MAKE}\`"
@if [ ! -x "${TARGET}" ]; then echo "ERROR: Missing IDRIS2 executable. Cannot run tests!\n"; exit 1; fi
@echo
@${MAKE} -C tests only=$(only) IDRIS2=../../../${TARGET}
@${MAKE} -C tests only=$(only) IDRIS2=../../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_DATA=${IDRIS2_TEST_DATA} IDRIS2_LIBS=${IDRIS2_TEST_LIBS}
support:
@${MAKE} -C support/c
@ -112,6 +120,7 @@ clean: clean-libs support-clean
$(RM) src/IdrisPaths.idr
${MAKE} -C tests clean
$(RM) -r build
$(RM) -r lib
install: install-idris2 install-support install-libs
@ -125,7 +134,7 @@ ifeq ($(OS), windows)
-install ${TARGET}.cmd ${PREFIX}/bin
endif
mkdir -p ${PREFIX}/lib/
install support/c/${IDRIS2_SUPPORT} ${PREFIX}/lib
install lib/${IDRIS2_SUPPORT} ${PREFIX}/lib
mkdir -p ${PREFIX}/bin/${NAME}_app
install ${TARGETDIR}/${NAME}_app/* ${PREFIX}/bin/${NAME}_app
@ -152,7 +161,7 @@ install-libs:
.PHONY: bootstrap bootstrap-build bootstrap-racket bootstrap-racket-build bootstrap-test bootstrap-clean
# Bootstrapping using SCHEME
bootstrap: support
bootstrap: support support-lib
cp support/c/${IDRIS2_SUPPORT} bootstrap/idris2_app
sed 's/libidris2_support.so/${IDRIS2_SUPPORT}/g; s|__PREFIX__|${IDRIS2_CURDIR}/bootstrap|g' \
bootstrap/idris2_app/idris2.ss \
@ -161,7 +170,7 @@ bootstrap: support
IDRIS2_CG="chez" $(SHELL) ./bootstrap-stage2.sh
# Bootstrapping using racket
bootstrap-racket: support
bootstrap-racket: support support-lib
cp support/c/${IDRIS2_SUPPORT} bootstrap/idris2_app
sed 's|__PREFIX__|${IDRIS2_CURDIR}/bootstrap|g' \
bootstrap/idris2_app/idris2.rkt \
@ -170,7 +179,7 @@ bootstrap-racket: support
IDRIS2_CG="racket" $(SHELL) ./bootstrap-stage2.sh
bootstrap-test:
$(MAKE) test INTERACTIVE='' IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_DATA=${IDRIS2_BOOT_TEST_DATA} IDRIS2_LIBS=${IDRIS2_BOOT_TEST_LIBS}
$(MAKE) test INTERACTIVE='' IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_TEST_DATA=${IDRIS2_BOOT_TEST_DATA} IDRIS2_TEST_LIBS=${IDRIS2_BOOT_TEST_LIBS}
bootstrap-clean:
$(RM) -r bootstrap/bin bootstrap/lib bootstrap/idris2-${IDRIS2_VERSION}

View File

@ -7,7 +7,7 @@ test:
./build/exec/runtests $(IDRIS2) $(INTERACTIVE) --threads $(threads) --only $(only)
testbin:
${IDRIS2_BOOT} --build tests.ipkg
${IDRIS2} --build tests.ipkg
clean:
$(RM) -r build

View File

@ -1,5 +1,4 @@
package runtests
depends = test
main = Main
executable = runtests