-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from mwoehlke-kitware/tests-cmake
Add tests to CMake build
- Loading branch information
Showing
19 changed files
with
493 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
add_subdirectory(gtest) | ||
|
||
add_subdirectory(types) | ||
|
||
add_subdirectory(c) | ||
add_subdirectory(cpp) | ||
|
||
if(LCM_ENABLE_PYTHON) | ||
add_subdirectory(python) | ||
endif() | ||
|
||
if(LCM_ENABLE_JAVA) | ||
add_subdirectory(java) | ||
endif() | ||
|
||
if(LCM_ENABLE_LUA) | ||
add_subdirectory(lua) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
set(test_c_libs lcm-test-types-c lcm gtest gtest_main) | ||
|
||
add_executable(test-c-server server.c common.c) | ||
target_link_libraries(test-c-server lcm-test-types-c lcm) | ||
|
||
add_executable(test-c-client client.cpp common.c) | ||
target_link_libraries(test-c-client ${test_c_libs}) | ||
|
||
add_executable(test-c-memq_test memq_test.cpp common.c) | ||
target_link_libraries(test-c-memq_test ${test_c_libs}) | ||
|
||
add_executable(test-c-eventlog_test eventlog_test.cpp common.c) | ||
target_link_libraries(test-c-eventlog_test ${test_c_libs}) | ||
|
||
add_executable(test-c-udpm_test udpm_test.cpp common.c) | ||
target_link_libraries(test-c-udpm_test ${test_c_libs}) | ||
|
||
add_test(NAME C::memq_test COMMAND test-c-memq_test) | ||
add_test(NAME C::eventlog_test COMMAND test-c-eventlog_test) | ||
|
||
if(PYTHON_EXECUTABLE) | ||
add_test(NAME C::client_server COMMAND | ||
${PYTHON_EXECUTABLE} | ||
${CMAKE_CURRENT_SOURCE_DIR}/../run_client_server_test.py | ||
$<TARGET_FILE:test-c-server> | ||
$<TARGET_FILE:test-c-client>) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set(test_cpp_libs lcm-test-types-cpp lcm gtest gtest_main) | ||
if(CMAKE_VERSION VERSION_LESS 3.3) # TODO remove when we require >=3.3 | ||
# NOTE: with CMake 3.3 or later, this is added as a dependency of the | ||
# lcm-test-types-cpp INTERFACE target, so is not needed; CMake prior to | ||
# 3.3 does not support dependencies on INTERFACE targets, and we need to | ||
# enforce the build order for obvious reasons | ||
list(APPEND test_cpp_libs lcm-test-types-generate-cpp) | ||
endif() | ||
|
||
add_executable(test-cpp-client client.cpp common.cpp) | ||
target_link_libraries(test-cpp-client ${test_cpp_libs}) | ||
|
||
add_executable(test-cpp-memq_test memq_test.cpp common.cpp) | ||
target_link_libraries(test-cpp-memq_test ${test_cpp_libs}) | ||
|
||
add_test(NAME CPP::memq_test COMMAND test-cpp-memq_test) | ||
|
||
if(PYTHON_EXECUTABLE) | ||
add_test(NAME CPP::client_server COMMAND | ||
${PYTHON_EXECUTABLE} | ||
${CMAKE_CURRENT_SOURCE_DIR}/../run_client_server_test.py | ||
$<TARGET_FILE:test-c-server> | ||
$<TARGET_FILE:test-cpp-client>) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
project(gtest) | ||
|
||
find_package(Threads) | ||
|
||
add_library(gtest src/gtest-all.cc) | ||
target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT}) | ||
target_include_directories(gtest SYSTEM PUBLIC ${PROJECT_SOURCE_DIR}/include) | ||
|
||
add_library(gtest_main src/gtest_main.cc) | ||
target_link_libraries(gtest_main gtest ${CMAKE_THREAD_LIBS_INIT}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
include(UseJava) | ||
|
||
add_subdirectory(hamcrest-core-1.3) | ||
add_subdirectory(junit-4.11) | ||
|
||
add_jar(lcm-test-java | ||
OUTPUT_NAME lcm-test | ||
INCLUDE_JARS | ||
lcm-test-types-java | ||
lcm-java | ||
junit | ||
SOURCES | ||
lcmtest/LcmTestClient.java | ||
lcmtest/TestUDPMulticastProvider.java) | ||
|
||
set(lcm-test-java_CLASSPATH) | ||
foreach(jar lcm-test-java lcm-test-types-java lcm-java hamcrest-core junit) | ||
get_target_property(${jar}_JAR ${jar} JAR_FILE) | ||
list(APPEND lcm-test-java_CLASSPATH ${${jar}_JAR}) | ||
endforeach() | ||
if(NOT WIN32) | ||
string(REPLACE ";" ":" lcm-test-java_CLASSPATH "${lcm-test-java_CLASSPATH}") | ||
endif() | ||
|
||
add_test(NAME Java::client_server COMMAND | ||
${PYTHON_EXECUTABLE} | ||
${CMAKE_CURRENT_SOURCE_DIR}/../run_client_server_test.py | ||
$<TARGET_FILE:test-c-server> | ||
${Java_JAVA_EXECUTABLE} -cp "${lcm-test-java_CLASSPATH}" LcmTestClient) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
set(hamcrest-core_version 1.3) | ||
|
||
set(hamcrest-core_sources | ||
org/hamcrest/BaseDescription.java | ||
org/hamcrest/BaseMatcher.java | ||
org/hamcrest/Condition.java | ||
org/hamcrest/core/AllOf.java | ||
org/hamcrest/core/AnyOf.java | ||
org/hamcrest/core/CombinableMatcher.java | ||
org/hamcrest/core/DescribedAs.java | ||
org/hamcrest/core/Every.java | ||
org/hamcrest/core/IsAnything.java | ||
org/hamcrest/core/IsCollectionContaining.java | ||
org/hamcrest/core/IsEqual.java | ||
org/hamcrest/core/IsInstanceOf.java | ||
org/hamcrest/core/Is.java | ||
org/hamcrest/core/IsNot.java | ||
org/hamcrest/core/IsNull.java | ||
org/hamcrest/core/IsSame.java | ||
org/hamcrest/CoreMatchers.java | ||
org/hamcrest/core/ShortcutCombination.java | ||
org/hamcrest/core/StringContains.java | ||
org/hamcrest/core/StringEndsWith.java | ||
org/hamcrest/core/StringStartsWith.java | ||
org/hamcrest/core/SubstringMatcher.java | ||
org/hamcrest/CustomMatcher.java | ||
org/hamcrest/CustomTypeSafeMatcher.java | ||
org/hamcrest/Description.java | ||
org/hamcrest/DiagnosingMatcher.java | ||
org/hamcrest/Factory.java | ||
org/hamcrest/FeatureMatcher.java | ||
org/hamcrest/internal/ArrayIterator.java | ||
org/hamcrest/internal/ReflectiveTypeFinder.java | ||
org/hamcrest/internal/SelfDescribingValueIterator.java | ||
org/hamcrest/internal/SelfDescribingValue.java | ||
org/hamcrest/MatcherAssert.java | ||
org/hamcrest/Matcher.java | ||
org/hamcrest/SelfDescribing.java | ||
org/hamcrest/StringDescription.java | ||
org/hamcrest/TypeSafeDiagnosingMatcher.java | ||
org/hamcrest/TypeSafeMatcher.java | ||
) | ||
|
||
add_jar(hamcrest-core | ||
OUTPUT_NAME hamcrest-core-${hamcrest-core_version} | ||
SOURCES ${hamcrest-core_sources} | ||
) |
Oops, something went wrong.