summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-05-14 15:19:56 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-05-14 15:19:56 +0000
commit4a9c0dd7a00d7d20d44b9ac0b34e345868ad3421 (patch)
tree1b9dd7dc0d8907a773a4635feb23b272dc0ede4a /cpp/src/tests
parent9783f2ec69b9da8f28bd0e671b5dcfcc4b8572c2 (diff)
downloadqpid-python-4a9c0dd7a00d7d20d44b9ac0b34e345868ad3421.tar.gz
More work on cmake:
Make tests build on Linux Fix XML tests to run Fix cmake installed locations for modules/config files git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@774814 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/CMakeLists.txt18
-rw-r--r--cpp/src/tests/XmlClientSessionTest.cpp6
2 files changed, 16 insertions, 8 deletions
diff --git a/cpp/src/tests/CMakeLists.txt b/cpp/src/tests/CMakeLists.txt
index da7bb7d89b..a02ecad9cb 100644
--- a/cpp/src/tests/CMakeLists.txt
+++ b/cpp/src/tests/CMakeLists.txt
@@ -17,6 +17,9 @@
# under the License.
#
+# Make sure that everything get built before the tests
+# Need to create a var with all the necessary top level targets
+
add_definitions(-DBOOST_TEST_DYN_LINK)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
@@ -30,7 +33,10 @@ if (MSVC)
add_definitions( /wd4275 /wd4503 )
endif (MSVC)
-set (qpid_test_boost_libs ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY})
+# Like this to work with cmake 2.4 on Unix
+set (qpid_test_boost_libs
+ boost_regex
+ boost_unit_test_framework)
#
# Unit test program
@@ -40,7 +46,6 @@ set (qpid_test_boost_libs ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY
# ccmake and set unit_tests_to_build to the set you want to build.
set(unit_tests_to_build
- unit_test
exception_test
RefCounted
SessionState
@@ -89,11 +94,10 @@ set(unit_tests_to_build
ReplicationTest
ClientMessageTest
PollableCondition
+ ${xml_tests}
CACHE STRING "Which unit tests to build"
)
-if (QPID_HAS_XML)
- set(unit_tests_to_build ${unit_tests_to_build} XmlClientSessionTest)
-endif (QPID_HAS_XML)
+
mark_as_advanced(unit_tests_to_build)
# Disabled till we move to amqp_0_10 codec.
@@ -103,11 +107,11 @@ mark_as_advanced(unit_tests_to_build)
# amqp_0_10/Map.cpp \
# amqp_0_10/handlers.cpp
-add_executable (unit_test ${unit_tests_to_build})
+add_executable (unit_test unit_test ${unit_tests_to_build})
# The generally recommended way to add macro settings is to use
# COMPILE_DEFINITIONS, but it's a rough go to add more than one definition
# with a value; in this case, assuming that -D works everywhere is easier.
-set_source_files_properties (ReplicationTest.cpp Shlib.cpp
+set_source_files_properties (ReplicationTest.cpp Shlib.cpp ${xml_tests}
PROPERTIES
COMPILE_FLAGS
"-DQPID_MODULE_SUFFIX=\\\"${CMAKE_SHARED_MODULE_SUFFIX}\\\" -DQPID_MODULE_PREFIX=\\\"${CMAKE_SHARED_MODULE_PREFIX}\\\"")
diff --git a/cpp/src/tests/XmlClientSessionTest.cpp b/cpp/src/tests/XmlClientSessionTest.cpp
index aeb13c292f..b6b8520bd8 100644
--- a/cpp/src/tests/XmlClientSessionTest.cpp
+++ b/cpp/src/tests/XmlClientSessionTest.cpp
@@ -52,7 +52,11 @@ using std::string;
using std::cout;
using std::endl;
-Shlib shlib("../.libs/xml.so");
+#if defined (QPID_MODULE_SUFFIX)
+ Shlib shlib("../xml" QPID_MODULE_SUFFIX);
+#else
+ Shlib shlib("../.libs/xml.so");
+#endif
class SubscribedLocalQueue : public LocalQueue {
private: