1
0
Fork 0

added tests

This commit is contained in:
Frank Celler 2013-10-20 18:46:40 +02:00
parent b6b381c663
commit d620386a7b
5 changed files with 148 additions and 3 deletions

View File

@ -30,7 +30,8 @@ set(BIN_ARANGOIRB arangoirb)
set(BIN_ARANGORESTORE arangorestore) set(BIN_ARANGORESTORE arangorestore)
set(BIN_ARANGOSH arangosh) set(BIN_ARANGOSH arangosh)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/") set(TEST_BASICS_SUITE basics_suite)
set(TEST_GEO_SUITE geo_suite)
################################################################################ ################################################################################
### @brief threads ### @brief threads
@ -43,11 +44,12 @@ find_package(Threads)
################################################################################ ################################################################################
if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu89") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu89 -g")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g")
endif () endif ()
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -g")
endif () endif ()
if (APPLE) if (APPLE)
@ -71,6 +73,10 @@ add_definitions("-DTRI_BITS=${BITS}")
option(USE_MRUBY "Do you want to use MRUBY" OFF) option(USE_MRUBY "Do you want to use MRUBY" OFF)
if (USE_MRUBY)
add_definitions("-DTRI_ENABLE_MRUBY=1")
endif ()
################################################################################ ################################################################################
### @brief SYSTEM CONFIGURATION DIRECTORY (/etc) ### @brief SYSTEM CONFIGURATION DIRECTORY (/etc)
################################################################################ ################################################################################
@ -238,6 +244,14 @@ if (USE_MRUBY)
add_subdirectory(arangoirb) add_subdirectory(arangoirb)
endif () endif ()
## -----------------------------------------------------------------------------
## --SECTION-- TESTS
## -----------------------------------------------------------------------------
enable_testing()
add_subdirectory(UnitTests)
## ----------------------------------------------------------------------------- ## -----------------------------------------------------------------------------
## --SECTION-- PACKAGES ## --SECTION-- PACKAGES
## ----------------------------------------------------------------------------- ## -----------------------------------------------------------------------------

113
UnitTests/CMakeLists.txt Normal file
View File

@ -0,0 +1,113 @@
# -*- mode: CMAKE; -*-
## -----------------------------------------------------------------------------
## --SECTION-- COMMON INCLUDES
## -----------------------------------------------------------------------------
include_directories(.)
include_directories(${PROJECT_SOURCE_DIR}/lib)
include_directories(${PROJECT_SOURCE_DIR}/arangod)
## -----------------------------------------------------------------------------
## --SECTION-- BOOST FRAMEWORK
## -----------------------------------------------------------------------------
################################################################################
### @brief BOOST unit-test framework
################################################################################
find_package(Boost COMPONENTS unit_test_framework)
## -----------------------------------------------------------------------------
## --SECTION-- TEST EXECUTABLES
## -----------------------------------------------------------------------------
################################################################################
### @brief output directory
################################################################################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests/")
################################################################################
### @brief basics_suite
################################################################################
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
add_executable(
${TEST_BASICS_SUITE}
Runner.cpp
Philadelphia/conversions-test.cpp
Philadelphia/csv-test.cpp
Philadelphia/files-test.cpp
Philadelphia/json-test.cpp
Philadelphia/json-utilities-test.cpp
Philadelphia/hashes-test.cpp
Philadelphia/mersenne-test.cpp
Philadelphia/associative-pointer-test.cpp
Philadelphia/associative-synced-test.cpp
Philadelphia/string-buffer-test.cpp
Philadelphia/string-utf8-normalize-test.cpp
Philadelphia/string-utf8-test.cpp
Philadelphia/string-test.cpp
Philadelphia/structure-size-test.cpp
Philadelphia/vector-pointer-test.cpp
Philadelphia/vector-test.cpp
Jutland/EndpointTest.cpp
Jutland/StringBufferTest.cpp
Jutland/StringUtilsTest.cpp
)
target_link_libraries(
${TEST_BASICS_SUITE}
${LIB_ARANGO}
${ICU_LIBS}
${OPENSSL_LIBS}
${ZLIB_LIBS}
${Boost_LIBRARIES}
)
add_test(
basics
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_BASICS_SUITE}
)
endif ()
################################################################################
### @brief geo_suite
################################################################################
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
add_executable(
${TEST_GEO_SUITE}
Cambridge/Runner.cpp
Cambridge/georeg.cpp
../arangod/GeoIndex/GeoIndex.c
)
target_link_libraries(
${TEST_GEO_SUITE}
${LIB_ARANGO}
${ICU_LIBS}
${OPENSSL_LIBS}
${ZLIB_LIBS}
${Boost_LIBRARIES}
)
add_test(
geo
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_GEO_SUITE}
)
endif ()
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------
## Local Variables:
## mode: outline-minor
## outline-regexp: "^\\(### @brief\\|## --SECTION--\\|# -\\*- \\)"
## End:

View File

@ -11,6 +11,12 @@ include_directories(${PROJECT_SOURCE_DIR}/lib)
## --SECTION-- EXECUTABLES ## --SECTION-- EXECUTABLES
## ----------------------------------------------------------------------------- ## -----------------------------------------------------------------------------
################################################################################
### @brief output directory
################################################################################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/")
################################################################################ ################################################################################
### @brief arangod ### @brief arangod
################################################################################ ################################################################################

View File

@ -12,6 +12,12 @@ include_directories(${PROJECT_SOURCE_DIR}/arangosh)
## --SECTION-- EXECUTABLES ## --SECTION-- EXECUTABLES
## ----------------------------------------------------------------------------- ## -----------------------------------------------------------------------------
################################################################################
### @brief output directory
################################################################################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/")
################################################################################ ################################################################################
### @brief arangoirb ### @brief arangoirb
################################################################################ ################################################################################

View File

@ -11,6 +11,12 @@ include_directories(${PROJECT_SOURCE_DIR}/lib)
## --SECTION-- EXECUTABLES ## --SECTION-- EXECUTABLES
## ----------------------------------------------------------------------------- ## -----------------------------------------------------------------------------
################################################################################
### @brief output directory
################################################################################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/")
################################################################################ ################################################################################
### @brief arangob ### @brief arangob
################################################################################ ################################################################################