Yet another round of fixes for the test setup.

Including some Makefile hacks where test doesn't depend on the main pgloader
binary anymore because I coulnd't stop the binary to get being built again
even if it's been done already...
This commit is contained in:
Dimitri Fontaine 2013-10-20 23:27:11 +02:00
parent 5868a80717
commit 9fd0bbabe2
3 changed files with 22 additions and 10 deletions

View File

@ -4,6 +4,11 @@ POMO_PATCH = $(realpath patches/postmodern-send-copy-done.patch)
ASDF_CONFD = ~/.config/common-lisp/source-registry.conf.d
ASDF_CONF = $(ASDF_CONFD)/projects.conf
LIBS = build/libs.stamp
BUILDAPP = build/buildapp
MANIFEST = build/manifest.ql
PGLOADER = build/pgloader.exe
docs:
pandoc pgloader.1.md -o pgloader.1
pandoc pgloader.1.md -o pgloader.html
@ -34,24 +39,26 @@ $(ASDF_CONF):
asdf-config: $(ASDF_CONF) ;
libs: quicklisp $(ASDF_CONF) postmodern cl-csv
# Quicklisp Install needed Common Lisp libs
$(LIBS): quicklisp $(ASDF_CONF) postmodern cl-csv
sbcl --load ~/quicklisp/setup.lisp \
--eval '(ql:quickload "pgloader")' \
--eval '(quit)'
touch $@
./build/manifest.ql: libs
libs: $(LIBS) ;
$(MANIFEST): libs
sbcl --load ~/quicklisp/setup.lisp \
--eval '(ql:write-asdf-manifest-file "./build/manifest.ql")' \
--eval '(quit)'
./build/buildapp: quicklisp
$(BUILDAPP): quicklisp
sbcl --load ~/quicklisp/setup.lisp \
--eval '(ql:quickload "buildapp")' \
--eval '(buildapp:build-buildapp "./build/buildapp")' \
--eval '(quit)'
./build/pgloader.exe: ./build/buildapp ./build/manifest.ql
$(PGLOADER): $(MANIFEST) $(BUILDAPP)
./build/buildapp --logfile /tmp/build.log \
--asdf-tree ~/quicklisp/local-projects \
--manifest-file ./build/manifest.ql \
@ -63,7 +70,11 @@ libs: quicklisp $(ASDF_CONF) postmodern cl-csv
--compress-core \
--output build/pgloader.exe
test: ./build/pgloader.exe
$(MAKE) PGLOADER=$(realpath ./build/pgloader.exe) -C test all
pgloader: $(PGLOADER) ;
test:
$(MAKE) PGLOADER=$(realpath $(PGLOADER)) -C test all
check: test ;
.PHONY: test

View File

@ -18,7 +18,9 @@ echo "local all all trust" | sudo tee $HBA
echo "host all all 127.0.0.1/32 trust" | sudo tee -a $HBA
sudo pg_ctlcluster 9.3 main reload
sudo createuser -U postgres -SdR `whoami`
sudo createdb -U postgres -O `whoami` pgloader
createuser -U postgres -SdR `whoami`
createdb -U postgres -O `whoami` pgloader
psql -U postgres -d pgloader -c 'create extension ip4r'
make -C /vagrant pgloader
make -C /vagrant test

View File

@ -2,7 +2,6 @@ TESTS = $(wildcard *.load)
OUT = $(TESTS:.load=.out)
all: $(OUT)
echo $(OUT)
%.out: %.load
$(PGLOADER) --verbose $<