[Positioner] tests: add CMake target
This commits makes the tests that are currently compilable to be built; a lot of test files are not included because of some compilation errors.
This commit is contained in:
parent
4a534755db
commit
f71c66590e
|
@ -30,7 +30,7 @@ endif()
|
|||
# Enable C++11
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
set(OWLPS_POSITIONER_SRC_FILES
|
||||
set(OWLPS_POSITIONER_CLASSES_SRC_FILES
|
||||
capturepoint.cc
|
||||
capturepointsreadercsv.cc
|
||||
area.cc
|
||||
|
@ -62,7 +62,6 @@ set(OWLPS_POSITIONER_SRC_FILES
|
|||
outputtcpsocketevaal.cc
|
||||
outputterminal.cc
|
||||
outputudpsocket.cc
|
||||
owlps-positionerd.cc
|
||||
point3d.cc
|
||||
posexcept.cc
|
||||
positioning.cc
|
||||
|
@ -83,6 +82,11 @@ set(OWLPS_POSITIONER_SRC_FILES
|
|||
wifidevice.cc
|
||||
)
|
||||
|
||||
set(OWLPS_POSITIONER_SRC_FILES
|
||||
owlps-positionerd.cc
|
||||
${OWLPS_POSITIONER_CLASSES_SRC_FILES}
|
||||
)
|
||||
|
||||
add_executable(owlps-positionerd
|
||||
${OWLPS_POSITIONER_SRC_FILES})
|
||||
target_link_libraries(owlps-positionerd
|
||||
|
@ -120,6 +124,43 @@ set_target_properties(
|
|||
PROPERTIES COMPILE_FLAGS ${EXE_FLAGS})
|
||||
|
||||
|
||||
### Tests ###
|
||||
|
||||
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
|
||||
set(TESTS_SRC_FILES
|
||||
${TESTS_DIR}/area_test.hh
|
||||
${TESTS_DIR}/building_test.hh
|
||||
${TESTS_DIR}/capturepoint_test.hh
|
||||
${TESTS_DIR}/configuration_test.hh
|
||||
${TESTS_DIR}/fbcm_test.hh
|
||||
${TESTS_DIR}/frbhmbasic_test.hh
|
||||
${TESTS_DIR}/inputdatareader_test.hh
|
||||
${TESTS_DIR}/input_test.hh
|
||||
${TESTS_DIR}/minmax_test.hh
|
||||
${TESTS_DIR}/mobile_test.hh
|
||||
${TESTS_DIR}/nss_test.hh
|
||||
${TESTS_DIR}/outputterminal_test.hh
|
||||
${TESTS_DIR}/output_test.hh
|
||||
${TESTS_DIR}/point3d_test.hh
|
||||
${TESTS_DIR}/positioning_test.hh
|
||||
${TESTS_DIR}/posutil_test.hh
|
||||
${TESTS_DIR}/waypoint_test.hh
|
||||
${TESTS_DIR}/wifidevice_test.hh
|
||||
)
|
||||
|
||||
# Create the test runner's source
|
||||
add_custom_command(OUTPUT test_positioner.cc
|
||||
COMMAND cxxtestgen --error-printer --include=${TESTS_DIR}/valuetraits.hh --include=${TESTS_DIR}/testutil.hh -o test_positioner.cc ${TESTS_SRC_FILES})
|
||||
|
||||
# Compile the test runner
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_executable(test_positioner EXCLUDE_FROM_ALL
|
||||
test_positioner.cc ${OWLPS_POSITIONER_CLASSES_SRC_FILES})
|
||||
target_link_libraries(test_positioner
|
||||
libowlps.a
|
||||
${EXTRA_LIBS})
|
||||
|
||||
|
||||
### Extra targets ###
|
||||
|
||||
# Indentation
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "building.hh"
|
||||
#include "waypoint.hh"
|
||||
#include "area.hh"
|
||||
#include "stock.hh"
|
||||
|
||||
class Building_test: public CxxTest::TestSuite
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue