printing port/addr for broker
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6cee4cac Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6cee4cac Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6cee4cac Branch: refs/heads/fix Commit: 6cee4cac3ca52c953ff7ed1460e3cca5799c6411 Parents: 9268d46 Author: Alan Conway <[email protected]> Authored: Tue Jan 26 16:56:07 2016 -0500 Committer: Alan Conway <[email protected]> Committed: Tue Jan 26 16:56:07 2016 -0500 ---------------------------------------------------------------------- examples/cpp/CMakeLists.txt | 70 ++++++++++++++++---------------- examples/cpp/engine/example_test.py | 2 + 2 files changed, 37 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6cee4cac/examples/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index 3297302..65d814a 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -21,43 +21,43 @@ find_package(ProtonCpp REQUIRED) # include_directories(${ProtonCpp_INCLUDE_DIRS}) -# set(examples -# broker -# helloworld -# helloworld_direct -# simple_recv -# simple_send -# direct_recv -# direct_send -# client -# server -# server_direct -# recurring_timer -# connection_options -# queue_browser -# selected_recv -# ssl -# ssl_client_cert -# encode_decode) +set(examples + broker + helloworld + helloworld_direct + simple_recv + simple_send + direct_recv + direct_send + client + server + server_direct + recurring_timer + connection_options + queue_browser + selected_recv + ssl + ssl_client_cert + encode_decode) -# foreach(example ${examples}) -# add_executable(${example} ${example}.cpp) -# target_link_libraries(${example} ${ProtonCpp_LIBRARIES}) -# set_source_files_properties(${example}.cpp PROPERTIES COMPILE_FLAGS "${CXX_WARNING_FLAGS}") -# endforeach() +foreach(example ${examples}) + add_executable(${example} ${example}.cpp) + target_link_libraries(${example} ${ProtonCpp_LIBRARIES}) + set_source_files_properties(${example}.cpp PROPERTIES COMPILE_FLAGS "${CXX_WARNING_FLAGS}") +endforeach() -# set(env_py "${CMAKE_SOURCE_DIR}/proton-c/env.py") -# set(test_bin_dir "$<TARGET_FILE_DIR:broker>") -# if (WIN32) -# # Ignore existing path (usualy containting spaces, escape chars). -# # Choose just enough path for Windows, ';' separated. -# set(test_path "${test_bin_dir}" "$<TARGET_FILE_DIR:qpid-proton>" "$<TARGET_FILE_DIR:qpid-proton-cpp>") -# else(WIN32) -# # ':' separated path with test_bin_dir first. -# set(test_path "${test_bin_dir}:$ENV{PATH}") -# endif(WIN32) +set(env_py "${CMAKE_SOURCE_DIR}/proton-c/env.py") +set(test_bin_dir "$<TARGET_FILE_DIR:broker>") +if (WIN32) + # Ignore existing path (usualy containting spaces, escape chars). + # Choose just enough path for Windows, ';' separated. + set(test_path "${test_bin_dir}" "$<TARGET_FILE_DIR:qpid-proton>" "$<TARGET_FILE_DIR:qpid-proton-cpp>") +else(WIN32) + # ':' separated path with test_bin_dir first. + set(test_path "${test_bin_dir}:$ENV{PATH}") +endif(WIN32) -# add_test(NAME cpp_example_test -# COMMAND ${PYTHON_EXECUTABLE} ${env_py} -- "PATH=${test_path}" ${VALGRIND_ENV} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v) +add_test(NAME cpp_example_test + COMMAND ${PYTHON_EXECUTABLE} ${env_py} -- "PATH=${test_path}" ${VALGRIND_ENV} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v) add_subdirectory(engine) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6cee4cac/examples/cpp/engine/example_test.py ---------------------------------------------------------------------- diff --git a/examples/cpp/engine/example_test.py b/examples/cpp/engine/example_test.py index 52bc37e..e71c2ec 100644 --- a/examples/cpp/engine/example_test.py +++ b/examples/cpp/engine/example_test.py @@ -101,6 +101,7 @@ vvvvvvvvvvvvvvvv """Pick a new host:port address.""" # TODO aconway 2015-07-14: need a safer way to pick ports. p = randrange(10000, 20000) + print >>sys.stderr, "FIXME port", p return "127.0.0.1:%s" % p def background(self, *args): @@ -158,6 +159,7 @@ class BrokerExampleTest(ExampleTest): try: if not getattr(cls, "broker", None): cls.addr = cls.pick_addr() + "/examples" + print >>sys.stderr, "FIXME broker addr", cls.addr cls.broker = Popen([cls.broker_exe, "-a", cls.addr], stdout=PIPE, stderr=sys.stderr) cls.wait_line(cls.broker.stdout, "listening") finally: --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
