mirror of https://gitee.com/bigwinds/arangodb
155 lines
4.5 KiB
Makefile
155 lines
4.5 KiB
Makefile
# -*- mode: Makefile; -*-
|
|
|
|
################################################################################
|
|
## unittests target
|
|
################################################################################
|
|
|
|
.PHONY: unittests unittests-brief unittests-verbose
|
|
|
|
unittests: unittests-verbose unittests-brief
|
|
|
|
unittests-brief: unittests-boost unittests-shell-server unittests-http-server
|
|
|
|
unittests-verbose:
|
|
@echo "################################################################################"
|
|
@echo "#"
|
|
@echo "# In order to run the unit-tests you need to either install the JavaScript"
|
|
@echo "# library files or configure the AvocadoDB in such a way, that it uses a"
|
|
@echo "# relative path."
|
|
@echo "#"
|
|
@echo "# Library Files"
|
|
@echo "# -------------"
|
|
@echo "#"
|
|
@echo "# > ./configure ...."
|
|
@echo "# > make install"
|
|
@echo "# > make unittests"
|
|
@echo "#"
|
|
@echo "# Relative Paths"
|
|
@echo "# --------------"
|
|
@echo "#"
|
|
@echo "# > ./configure --enable-relative=devel ..."
|
|
@echo "# > make unittests"
|
|
@echo "#"
|
|
@echo "################################################################################"
|
|
@echo
|
|
|
|
@sleep 1
|
|
|
|
################################################################################
|
|
## start the avocado server
|
|
################################################################################
|
|
|
|
PID := $(shell echo $$PPID)
|
|
PIDFILE := /tmp/avocado.$(PID).pid
|
|
VOCDIR := /tmp/vocdir.$(PID)
|
|
VOCPORT := $(shell printf "3%04d" `expr $(PID) % 10000`)
|
|
VOCHOST := 127.0.0.1
|
|
|
|
.PHONY: start-server
|
|
|
|
start-server:
|
|
@echo "starting the server"
|
|
@rm -f "$(PIDFILE)"
|
|
@rm -rf "$(VOCDIR)"
|
|
@mkdir "$(VOCDIR)"
|
|
|
|
(@builddir@/avocado "$(VOCDIR)" --pid-file $(PIDFILE) --watch-process $(PID) --server.http-port $(VOCHOST):$(VOCPORT) && rm -rf "$(VOCDIR)") &
|
|
|
|
@curl -s http://$(VOCHOST):$(VOCPORT)/version > /dev/null || sleep 2
|
|
@curl -s http://$(VOCHOST):$(VOCPORT)/version > /dev/null || sleep 2
|
|
@curl -s http://$(VOCHOST):$(VOCPORT)/version > /dev/null || sleep 2
|
|
@curl -s http://$(VOCHOST):$(VOCPORT)/version > /dev/null || sleep 2
|
|
|
|
curl http://$(VOCHOST):$(VOCPORT)/version
|
|
|
|
@echo
|
|
|
|
################################################################################
|
|
## BOOST TESTS
|
|
################################################################################
|
|
|
|
.PHONY: unittests-boost
|
|
|
|
if ENABLE_BOOST_TEST
|
|
|
|
unittests-boost:
|
|
@echo
|
|
@echo "================================================================================"
|
|
@echo "BOOST TESTS"
|
|
@echo "================================================================================"
|
|
@echo
|
|
|
|
@builddir@/UnitTests/test_suite --show_progress
|
|
|
|
@echo
|
|
|
|
unittests-boost: UnitTests/test_suite
|
|
|
|
noinst_PROGRAMS = UnitTests/test_suite
|
|
|
|
UnitTests_test_suite_LDADD = -L@top_builddir@ -lavocado -lboost_unit_test_framework
|
|
UnitTests_test_suite_DEPENDENCIES = @top_builddir@/libavocado.a
|
|
|
|
UnitTests_test_suite_SOURCES = \
|
|
UnitTests/Runner.cpp \
|
|
UnitTests/Philadelphia/string-buffer-test.cpp \
|
|
UnitTests/Jutland/StringBufferTest.cpp \
|
|
UnitTests/Jutland/StringUtilsTest.cpp
|
|
|
|
else
|
|
|
|
unittests-boost:
|
|
@echo
|
|
@echo "================================================================================"
|
|
@echo "BOOST TESTS"
|
|
@echo "================================================================================"
|
|
@echo
|
|
|
|
@echo "enable unit-testing with 'configure --with-boost-test'"
|
|
|
|
@echo
|
|
endif
|
|
|
|
################################################################################
|
|
## SHELL SERVER TESTS
|
|
################################################################################
|
|
|
|
SHELL_SERVER = @srcdir@/js/server/tests/shell-documents.js
|
|
|
|
.PHONY: unittests-shell-server
|
|
|
|
OPTION = $(addprefix --unit-tests ,$(SHELL_SERVER))
|
|
|
|
unittests-shell-server:
|
|
@echo
|
|
@echo "================================================================================"
|
|
@echo "SHELL SERVER TESTS"
|
|
@echo "================================================================================"
|
|
@echo
|
|
|
|
@rm -rf "$(VOCDIR)"
|
|
@mkdir "$(VOCDIR)"
|
|
|
|
@builddir@/avocado "$(VOCDIR)" $(OPTION)
|
|
|
|
@rm -rf "$(VOCDIR)"
|
|
|
|
@echo
|
|
|
|
################################################################################
|
|
## HTTP SERVER TESTS
|
|
################################################################################
|
|
|
|
.PHONY: unittests-http-server
|
|
|
|
unittests-http-server: start-server
|
|
@echo
|
|
@echo "================================================================================"
|
|
@echo "HTTP SERVER TESTS"
|
|
@echo "================================================================================"
|
|
@echo
|
|
|
|
cd @srcdir@/UnitTests/HttpInterface && AVOCADO_SERVER="$(VOCHOST):$(VOCPORT)" ./run_tests
|
|
|
|
@echo
|