mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 08:48:07 +02:00
tests to embedded tests: replaced in cmake files
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291
This commit is contained in:
parent
134701b758
commit
0cb7d487bc
5 changed files with 11 additions and 10 deletions
|
|
@ -231,7 +231,9 @@ ENABLE_TESTING()
|
|||
option (DBUS_BUILD_TESTS "enable unit test code" ON)
|
||||
|
||||
if(DBUS_BUILD_TESTS)
|
||||
add_definitions(-DDBUS_BUILD_TESTS -DDBUS_ENABLE_EMBEDDED_TESTS)
|
||||
set (DBUS_ENABLE_EMBEDDED_TESTS ON)
|
||||
set (DBUS_ENABLE_MODULAR_TESTS ON)
|
||||
add_definitions(-DDBUS_ENABLE_EMBEDDED_TESTS -DDBUS_ENABLE_MODULAR_TESTS)
|
||||
endif(DBUS_BUILD_TESTS)
|
||||
|
||||
option (DBUS_USE_OUTPUT_DEBUG_STRING "enable win32 debug port for message output" OFF)
|
||||
|
|
|
|||
|
|
@ -107,12 +107,12 @@ if (DBUS_SERVICE)
|
|||
install_targets(/bin dbus-service )
|
||||
endif (DBUS_SERVICE)
|
||||
|
||||
if (DBUS_BUILD_TESTS)
|
||||
if (DBUS_ENABLE_EMBEDDED_TESTS)
|
||||
add_executable(bus-test ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
|
||||
target_link_libraries(bus-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
|
||||
set_target_properties(bus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
|
||||
add_test(bus-test ${EXECUTABLE_OUTPUT_PATH}/bus-test ${CMAKE_BINARY_DIR}/test/data)
|
||||
endif (DBUS_BUILD_TESTS)
|
||||
endif (DBUS_ENABLE_EMBEDDED_TESTS)
|
||||
|
||||
if(MSVC)
|
||||
project_source_group(${GROUP_CODE} bus_test_SOURCES dummy)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
#define TEST_BUS_BINARY "@TEST_BUS_BINARY@"
|
||||
|
||||
/* Some dbus features */
|
||||
#cmakedefine DBUS_BUILD_TESTS 1
|
||||
#cmakedefine DBUS_ENABLE_ANSI 1
|
||||
#cmakedefine DBUS_ENABLE_VERBOSE_MODE 1
|
||||
#cmakedefine DBUS_DISABLE_ASSERT 1
|
||||
|
|
|
|||
|
|
@ -166,12 +166,12 @@ set (DBUS_UTIL_SOURCES
|
|||
${DBUS_DIR}/dbus-sysdeps-util.c
|
||||
)
|
||||
|
||||
if (DBUS_BUILD_TESTS)
|
||||
if (DBUS_ENABLE_EMBEDDED_TESTS)
|
||||
set (DBUS_UTIL_SOURCES
|
||||
${DBUS_UTIL_SOURCES}
|
||||
${DBUS_DIR}/dbus-test.c
|
||||
)
|
||||
endif (DBUS_BUILD_TESTS)
|
||||
endif (DBUS_ENABLE_EMBEDDED_TESTS)
|
||||
|
||||
set (DBUS_UTIL_HEADERS
|
||||
${DBUS_DIR}/dbus-asv-util.h
|
||||
|
|
@ -298,13 +298,13 @@ else(WIN32)
|
|||
target_link_libraries(dbus-internal ${CMAKE_THREAD_LIBS_INIT} rt)
|
||||
endif(WIN32)
|
||||
|
||||
if (DBUS_BUILD_TESTS)
|
||||
if (DBUS_ENABLE_EMBEDDED_TESTS)
|
||||
set (TESTS_ENVIRONMENT "DBUS_TEST_DATA=${CMAKE_SOURCE_DIR}/test/data DBUS_TEST_HOMEDIR=${CMAKE_BUILD_DIR}/dbus")
|
||||
ADD_EXECUTABLE(dbus-test ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c)
|
||||
target_link_libraries(dbus-test ${DBUS_INTERNAL_LIBRARIES})
|
||||
add_test(dbus-test ${EXECUTABLE_OUTPUT_PATH}/dbus-test ${CMAKE_SOURCE_DIR}/../test/data)
|
||||
set_target_properties(dbus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
|
||||
ENDIF (DBUS_BUILD_TESTS)
|
||||
ENDIF (DBUS_ENABLE_EMBEDDED_TESTS)
|
||||
|
||||
if (UNIX)
|
||||
# set version info
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
if (DBUS_BUILD_TESTS)
|
||||
if (DBUS_ENABLE_EMBEDDED_TESTS)
|
||||
|
||||
set (NAMEtest-DIR ../../../test/name-test)
|
||||
|
||||
|
|
@ -36,4 +36,4 @@ add_executable(test-autolaunch ${NAMEtest-DIR}/test-autolaunch.c)
|
|||
target_link_libraries(test-autolaunch dbus-testutils)
|
||||
ADD_TEST(test-autolaunch ${EXECUTABLE_OUTPUT_PATH}/test-autolaunch)
|
||||
|
||||
endif (DBUS_BUILD_TESTS)
|
||||
endif (DBUS_ENABLE_EMBEDDED_TESTS)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue