--- /dev/null
+# compiler: creates the binaries
+add_executable(test_hoststatusanalyzer
+ test_hoststatusanalyzer.cpp
+ mock_linkstatusanalyzer.cpp
+ ${CMAKE_SOURCE_DIR}/src/host/hoststatusanalyzer.cpp
+)
+
+# linker: link the program against the libraries
+target_link_libraries(
+ test_hoststatusanalyzer
+ ${I2NCOMMON_LIBRARIES}
+ ${Boost_LIBRARIES}
+)
+
+# cmake: invocation via "make test"
+add_test(test_hoststatusanalyzer test_hoststatusanalyzer)
--- /dev/null
+# compiler: creates the binaries
+add_executable(test_icmpv4header
+ test_icmpv4header.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpv4header.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpmessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpdestinationunreachablemessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpechoreplymessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpechorequestmessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpgenericmessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
+)
+
+# linker: link the program against the libraries
+target_link_libraries(
+ test_icmpv4header
+ ${I2NCOMMON_LIBRARIES}
+ ${Boost_LIBRARIES}
+)
+
+# cmake: invocation via "make test"
+add_test(test_icmpv4header test_icmpv4header)
--- /dev/null
+# compiler: creates the binaries
+add_executable(test_icmpv6header
+ test_icmpv6header.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpv6header.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpmessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpdestinationunreachablemessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpechoreplymessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpechorequestmessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/icmp/icmpgenericmessage.cpp
+ ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
+)
+
+# linker: link the program against the libraries
+target_link_libraries(
+ test_icmpv6header
+ ${I2NCOMMON_LIBRARIES}
+ ${Boost_LIBRARIES}
+)
+
+# cmake: invocation via "make test"
+add_test(test_icmpv6header test_icmpv6header)
--- /dev/null
+# compiler: creates the binaries
+add_executable(test_ipv4header
+ test_ipv4header.cpp
+ ${CMAKE_SOURCE_DIR}/src/ip/ipv4header.cpp
+ ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
+)
+
+# linker: link the program against the libraries
+target_link_libraries(
+ test_ipv4header
+ ${I2NCOMMON_LIBRARIES}
+ ${Boost_LIBRARIES}
+)
+
+# cmake: invocation via "make test"
+add_test(test_ipv4header test_ipv4header)
--- /dev/null
+# compiler: creates the binaries
+add_executable(test_ipv6header
+ test_ipv6header.cpp
+ ${CMAKE_SOURCE_DIR}/src/ip/ipv6header.cpp
+ ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
+)
+
+# linker: link the program against the libraries
+target_link_libraries(
+ test_ipv6header
+ ${I2NCOMMON_LIBRARIES}
+ ${Boost_LIBRARIES}
+)
+
+# cmake: invocation via "make test"
+add_test(test_ipv6header test_ipv6header)
--- /dev/null
+# compiler: creates the binaries
+add_executable(test_messagepayload
+ test_messagepayload.cpp
+ ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
+)
+
+# linker: link the program against the libraries
+target_link_libraries(
+ test_messagepayload
+ ${I2NCOMMON_LIBRARIES}
+ ${Boost_LIBRARIES}
+)
+
+# cmake: invocation via "make test"
+add_test(test_messagepayload test_messagepayload)
# compiler: include directories where the source code is located
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
-# compiler: source code from test cases
-set(TESTS_SOURCES
- test_messagepayload.cpp
- test_hoststatusanalyzer.cpp
- test_ipv4header.cpp
- test_ipv6header.cpp
- test_icmpv4header.cpp
- test_icmpv6header.cpp
-)
-
-# compiler: source code from mock objects
-set(MOCK_SOURCES
- mock_linkstatusanalyzer.cpp
-)
-
-# compiler: source code to be tested
-set(SOURCES
- ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp
- ${CMAKE_SOURCE_DIR}/src/host/hoststatusanalyzer.cpp
- ${CMAKE_SOURCE_DIR}/src/ip/ipv4header.cpp
- ${CMAKE_SOURCE_DIR}/src/ip/ipv6header.cpp
- ${CMAKE_SOURCE_DIR}/src/icmp/icmpv4header.cpp
- ${CMAKE_SOURCE_DIR}/src/icmp/icmpv6header.cpp
- ${CMAKE_SOURCE_DIR}/src/icmp/icmpmessage.cpp
- ${CMAKE_SOURCE_DIR}/src/icmp/icmpdestinationunreachablemessage.cpp
- ${CMAKE_SOURCE_DIR}/src/icmp/icmpechoreplymessage.cpp
- ${CMAKE_SOURCE_DIR}/src/icmp/icmpechorequestmessage.cpp
- ${CMAKE_SOURCE_DIR}/src/icmp/icmpgenericmessage.cpp
-)
+# cmake: enable ctest
+enable_testing()
-# compiler: creates the binary
-add_executable(test_${TARGET} ${SOURCES} ${MOCK_SOURCES} ${TESTS_SOURCES})
+# cmake: inclusion of each test case cmake file
+include(CMakeLists.test_messagepayload.txt)
+include(CMakeLists.test_hoststatusanalyzer.txt)
+include(CMakeLists.test_ipv4header.txt)
+include(CMakeLists.test_ipv6header.txt)
+include(CMakeLists.test_icmpv4header.txt)
+include(CMakeLists.test_icmpv6header.txt)
# cmake: add a custom "make check" target which automatically builds the binary
-add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS test_${TARGET})
-
-# cmake: invocation via "make test"
-enable_testing()
-add_test(test_${TARGET} test_${TARGET})
-
-# linker: link the program against the libraries
-target_link_libraries(
- test_${TARGET}
- ${I2NCOMMON_LIBRARIES}
- ${Boost_LIBRARIES}
+add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS
+ test_messagepayload
+ test_hoststatusanalyzer
+ test_ipv4header
+ test_ipv6header
+ test_icmpv4header
+ test_icmpv6header
)
on this file might be covered by the GNU General Public License.
*/
+#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
-#define BOOST_TEST_MESSAGE usage
#include <streambuf>
}
BOOST_AUTO_TEST_SUITE_END()
-
-
on this file might be covered by the GNU General Public License.
*/
+#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <streambuf>
on this file might be covered by the GNU General Public License.
*/
+#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <streambuf>
on this file might be covered by the GNU General Public License.
*/
+#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <streambuf>
on this file might be covered by the GNU General Public License.
*/
+#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <streambuf>