You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2017/10/20 21:03:41 UTC

qpid-proton git commit: NO-JIRA: Rearrange example CMakes to put test running stuff at end - Don't distract from the essential simplicity of file

Repository: qpid-proton
Updated Branches:
  refs/heads/master 4c21712aa -> d09511f19


NO-JIRA: Rearrange example CMakes to put test running stuff at end
- Don't distract from the essential simplicity of file


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/d09511f1
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/d09511f1
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/d09511f1

Branch: refs/heads/master
Commit: d09511f198b37310dc16de9a5fbd7c21e861901d
Parents: 4c21712
Author: Andrew Stitcher <as...@apache.org>
Authored: Fri Oct 20 16:30:35 2017 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Fri Oct 20 17:03:06 2017 -0400

----------------------------------------------------------------------
 examples/c/CMakeLists.txt   | 24 +++++++++++++-----------
 examples/cpp/CMakeLists.txt | 22 +++++++++++-----------
 2 files changed, 24 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d09511f1/examples/c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt
index 08a7a74..d9f6550 100644
--- a/examples/c/CMakeLists.txt
+++ b/examples/c/CMakeLists.txt
@@ -22,18 +22,9 @@ find_package(Proton REQUIRED Core Proactor)
 set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
 find_package(Threads REQUIRED)
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR})
-
 include_directories(${Proton_INCLUDE_DIRS})
 add_definitions(${Proton_DEFINITIONS})
 
-# Add a test with the correct environment to find test executables and valgrind.
-if(WIN32)
-  set(test_path "$<TARGET_FILE_DIR:broker>;$<TARGET_FILE_DIR:qpid-proton>")
-else()
-  set(test_path "${CMAKE_CURRENT_BINARY_DIR}:$ENV{PATH}")
-endif()
-
 foreach (name broker send receive direct send-abort send-ssl)
   add_executable(c-${name} ${name}.c)
   target_link_libraries(c-${name} ${Proton_Proactor_LIBRARIES} ${Proton_Core_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
@@ -41,9 +32,20 @@ foreach (name broker send receive direct send-abort send-ssl)
     OUTPUT_NAME ${name})
 endforeach()
 
-set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV} "PATH=${test_path}" ${VALGRIND_ENV})
+
+# Add a test to run all examples
 
 # windows exclusion only for 0.18 beta
 if(NOT WIN32)
-add_test(c-example-tests ${run_env} -- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v)
+
+# Make correct environment to find test executables and valgrind.
+if(WIN32)
+  set(test_path "$<TARGET_FILE_DIR:c-broker>;$<TARGET_FILE_DIR:qpid-proton-core>;$<TARGET_FILE_DIR:qpid-proton-proactor>")
+else()
+  set(test_path "$<TARGET_FILE_DIR:c-broker>:$ENV{PATH}")
+endif()
+set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV} "PATH=${test_path}" ${VALGRIND_ENV})
+
+add_test(NAME c-example-tests COMMAND ${run_env} -- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v)
+
 endif()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d09511f1/examples/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
index f00556c..3967fc1 100644
--- a/examples/cpp/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -39,17 +39,6 @@ if (DEFINED CMAKE_CXX_COMPILE_FEATURES)
   set(CMAKE_CXX_EXTENSIONS OFF)
 endif()
 
-# Add a test with the correct environment to find test executables and valgrind.
-macro(add_cpp_test name)
-  if(WIN32)
-    set(test_path "$<TARGET_FILE_DIR:broker>;$<TARGET_FILE_DIR:qpid-proton>;$<TARGET_FILE_DIR:qpid-proton-cpp>")
-  else(WIN32)
-    set(test_path "$<TARGET_FILE_DIR:broker>:$ENV{PATH}")
-  endif(WIN32)
-  set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV})
-  add_test(NAME ${name} COMMAND ${run_env} "PATH=${test_path}" ${VALGRIND_ENV} -- ${ARGN})
-endmacro()
-
 # Single-threaded examples that work on C++03
 foreach(example
     broker
@@ -87,6 +76,17 @@ if(HAS_CPP11)
   endforeach()
 endif()
 
+# Add a test with the correct environment to find test executables and valgrind.
+macro(add_cpp_test name)
+  if(WIN32)
+    set(test_path "$<TARGET_FILE_DIR:broker>;$<TARGET_FILE_DIR:qpid-proton>;$<TARGET_FILE_DIR:qpid-proton-cpp>")
+  else(WIN32)
+    set(test_path "$<TARGET_FILE_DIR:broker>:$ENV{PATH}")
+  endif(WIN32)
+  set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV})
+  add_test(NAME ${name} COMMAND ${run_env} "PATH=${test_path}" ${VALGRIND_ENV} -- ${ARGN})
+endmacro()
+
 add_cpp_test(cpp-example-container ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v ContainerExampleTest)
 
 if (NOT SSL_IMPL STREQUAL none)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org