mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 04:46:38 +01:00
Fix building tests, move binaries to different output directory.
This commit is contained in:
parent
103b6db717
commit
5d00ad6473
4 changed files with 14 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -13,6 +13,8 @@ build/CMakeFiles/*
|
||||||
build/tests
|
build/tests
|
||||||
build/client
|
build/client
|
||||||
build/core
|
build/core
|
||||||
|
build/i2pd
|
||||||
|
build/i2pd-tests
|
||||||
*.cmake
|
*.cmake
|
||||||
*.a
|
*.a
|
||||||
*.o
|
*.o
|
||||||
|
|
|
@ -11,6 +11,9 @@ option(WITH_UPNP "Include support for UPnP client" OFF)
|
||||||
option(WITH_TESTS "Build unit tests" OFF)
|
option(WITH_TESTS "Build unit tests" OFF)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake_modules")
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake_modules")
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
# Default build is Debug
|
# Default build is Debug
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
@ -167,6 +170,7 @@ include(GNUInstallDirs)
|
||||||
|
|
||||||
set(CORE_NAME "${PROJECT_NAME}-core")
|
set(CORE_NAME "${PROJECT_NAME}-core")
|
||||||
set(CLIENT_NAME "${PROJECT_NAME}-client")
|
set(CLIENT_NAME "${PROJECT_NAME}-client")
|
||||||
|
set(TESTS_NAME "${PROJECT_NAME}-tests")
|
||||||
add_subdirectory(core)
|
add_subdirectory(core)
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
|
|
@ -12,12 +12,15 @@ if(WITH_TESTS)
|
||||||
unit_test_framework REQUIRED
|
unit_test_framework REQUIRED
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(i2pd_tests ${TESTS_SRC})
|
add_executable(${TESTS_NAME} ${TESTS_SRC})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
i2pd_tests core ${DL_LIB} ${Boost_LIBRARIES} ${CRYPTO++_LIBRARIES}
|
${TESTS_NAME} ${CORE_NAME} ${DL_LIB} ${Boost_LIBRARIES} ${CRYPTO++_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
)
|
)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_test(i2pdTest i2pd_tests)
|
add_test(i2pdTest ${TESTS_NAME})
|
||||||
|
install(TARGETS
|
||||||
|
${TESTS_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define BOOST_TEST_DYN_LINK
|
#define BOOST_TEST_DYN_LINK
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
#include "../Identity.h"
|
#include "Identity.h"
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE(IdentityTests)
|
BOOST_AUTO_TEST_SUITE(IdentityTests)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue