qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jda...@apache.org
Subject [qpid-proton] 01/02: PROTON-2135 Set TEST_ENV more consistently
Date Wed, 22 Jan 2020 15:10:52 GMT
This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit ad322fe18538a29decdb47aecf4d967ab7a290a7
Author: Jiri Danek <jdanek@redhat.com>
AuthorDate: Thu Nov 7 13:50:54 2019 +0100

    PROTON-2135 Set TEST_ENV more consistently
---
 c/tests/CMakeLists.txt      | 10 ++++++----
 c/tests/fuzz/CMakeLists.txt |  2 +-
 cpp/CMakeLists.txt          |  3 ++-
 python/CMakeLists.txt       |  4 ++--
 ruby/CMakeLists.txt         |  6 +++---
 5 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/c/tests/CMakeLists.txt b/c/tests/CMakeLists.txt
index 6a754c7..137ac15 100644
--- a/c/tests/CMakeLists.txt
+++ b/c/tests/CMakeLists.txt
@@ -20,8 +20,9 @@
 configure_file(test_config.h.in test_config.h)
 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/tests/include)
 if (WIN32)
-  set(test_env ${PN_ENV_SCRIPT} -- "PATH=$<TARGET_FILE_DIR:qpid-proton-core>")
+  set(test_env "PATH=$<TARGET_FILE_DIR:qpid-proton-core>" ${TEST_ENV})
 else()
+  set(test_env ${TEST_ENV})
   set(platform_test_src ssl_test.cpp)
 endif()
 
@@ -44,7 +45,7 @@ if (CMAKE_CXX_COMPILER)
     add_executable(${exe} $<TARGET_OBJECTS:test_main> pn_test.cpp ${ARGN})
     set_target_properties(${exe} PROPERTIES
       COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARNING_FLAGS}")
-    add_test(NAME ${exe} COMMAND ${test_env} ${TEST_EXE_PREFIX_CMD} $<TARGET_FILE:${exe}>)
+    add_test(NAME ${exe} COMMAND ${PN_ENV_SCRIPT} -- ${test_env} ${TEST_EXE_PREFIX_CMD} $<TARGET_FILE:${exe}>)
     set_tests_properties(${exe} PROPERTIES
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
   endmacro()
@@ -82,7 +83,7 @@ if (CMAKE_CXX_COMPILER)
     if (THREADERCISER)
       add_executable(c-threaderciser threaderciser.c)
       set_target_properties(c-threaderciser PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} ${C_WARNING_FLAGS}")
-      add_test(NAME c-threaderciser COMMAND ${test_env} ${TEST_EXE_PREFIX_CMD} $<TARGET_FILE:c-threaderciser>)
+      add_test(NAME c-threaderciser COMMAND ${PN_ENV_SCRIPT} -- ${test_env} ${TEST_EXE_PREFIX_CMD}
$<TARGET_FILE:c-threaderciser>)
       set_tests_properties(c-threaderciser PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
       target_link_libraries (c-threaderciser qpid-proton-proactor)
       find_library(Pthread_LIBRARY pthread)
@@ -99,10 +100,11 @@ if (CMAKE_CXX_COMPILER)
 
     set(pypath "${CMAKE_SOURCE_DIR}/tests/py")
 
+    # unset TEST_EXE_PREFIX as valgrind does not run succesfully when fds are limited
     add_test(
         NAME c-fdlimit-tests
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        COMMAND ${PN_ENV_SCRIPT} -- "PATH=${path}" "PYTHONPATH=${pypath}" ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/fdlimit.py)
+        COMMAND ${PN_ENV_SCRIPT} -- "PATH=${path}" "PYTHONPATH=${pypath}" ${test_env} "TEST_EXE_PREFIX="
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/fdlimit.py)
   endif(HAS_PROACTOR)
 else (CMAKE_CXX_COMPILER)
   message(WARNING "No C++ compiler, some C library tests were not built")
diff --git a/c/tests/fuzz/CMakeLists.txt b/c/tests/fuzz/CMakeLists.txt
index aa6d49e..5db916d 100644
--- a/c/tests/fuzz/CMakeLists.txt
+++ b/c/tests/fuzz/CMakeLists.txt
@@ -55,7 +55,7 @@ macro (pn_add_fuzz_test test)
       set(file_lines "${file_lines}${f}\n")
     endforeach()
     file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${test}-files" "${file_lines}")
-    add_test (NAME ${test} COMMAND ${test_env} ${TEST_EXE_PREFIX_CMD} $<TARGET_FILE:${test}>
"@${CMAKE_CURRENT_BINARY_DIR}/${test}-files")
+    add_test (NAME ${test} COMMAND ${PN_ENV_SCRIPT} -- ${test_env} ${TEST_EXE_PREFIX_CMD}
$<TARGET_FILE:${test}> "@${CMAKE_CURRENT_BINARY_DIR}/${test}-files")
   else ()
     add_test (NAME ${test} COMMAND $<TARGET_FILE:${test}> -runs=1 ${CMAKE_CURRENT_SOURCE_DIR}/${test}>)
   endif ()
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 0708649..5b7399e 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -248,6 +248,7 @@ install (FILES
   DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
 
 set(testdata "${CMAKE_CURRENT_BINARY_DIR}/testdata")
+set(test_env ${TEST_ENV})
 
 # SASL configuration for tests
 if(CyrusSASL_Saslpasswd_EXECUTABLE)
@@ -272,7 +273,7 @@ macro(add_cpp_test test)
   add_executable (${test} src/${test}.cpp)
   target_link_libraries (${test} qpid-proton-cpp ${PLATFORM_LIBS})
   add_test (NAME cpp-${test}
-    COMMAND ${PN_ENV_SCRIPT} -- ${test_env}  ${TEST_EXE_PREFIX_CMD} $<TARGET_FILE:${test}>
${ARGN})
+    COMMAND ${PN_ENV_SCRIPT} -- ${test_env} ${TEST_EXE_PREFIX_CMD} $<TARGET_FILE:${test}>
${ARGN})
 endmacro(add_cpp_test)
 
 add_cpp_test(codec_test)
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index a396319..942d55b 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -266,11 +266,11 @@ else ()
         "${CMAKE_CURRENT_SOURCE_DIR}/tox.ini.in"
         "${CMAKE_CURRENT_BINARY_DIR}/tox.ini")
       add_test (NAME python-tox-test
-        COMMAND ${PN_ENV_SCRIPT}
+        COMMAND ${PN_ENV_SCRIPT} --
         "PATH=${py_path}"
         "SASLPASSWD=${CyrusSASL_Saslpasswd_EXECUTABLE}"
         "SWIG=${SWIG_EXECUTABLE}"
-        ${TEST_ENV} --
+        ${TEST_ENV}
         ${TEST_WRAP_PREFIX_CMD} ${PYTHON_EXECUTABLE} -m tox)
       set_tests_properties(python-tox-test
         PROPERTIES
diff --git a/ruby/CMakeLists.txt b/ruby/CMakeLists.txt
index c17550d..cd03305 100644
--- a/ruby/CMakeLists.txt
+++ b/ruby/CMakeLists.txt
@@ -121,7 +121,7 @@ to_native_path("${bin};${c_lib_dir};$ENV{PATH}" PATH)
 execute_process(COMMAND ${RUBY_EXECUTABLE} -r minitest -e ""
   RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
 if (result EQUAL 0)  # Have minitest
-  set(test_env ${PN_ENV_SCRIPT} --
+  set(test_env
     "PATH=${PATH}"
     "RUBYLIB=${RUBYLIB}"
     "SASLPASSWD=${CyrusSASL_Saslpasswd_EXECUTABLE}"
@@ -132,13 +132,13 @@ if (result EQUAL 0)  # Have minitest
     string(REPLACE "_" "-" name "ruby-${name}")
     add_test(
       NAME ${name}
-      COMMAND ${test_env} ${TEST_WRAP_PREFIX_CMD} ${RUBY_EXECUTABLE} ${script} -v
+      COMMAND ${PN_ENV_SCRIPT} -- ${test_env} ${TEST_WRAP_PREFIX_CMD} ${RUBY_EXECUTABLE}
${script} -v
       ${ARGN})
   endmacro()
 
   add_test(
     NAME ruby-example-test
-    COMMAND ${test_env} ${RUBY_EXECUTABLE} testme -v
+    COMMAND ${PN_ENV_SCRIPT} -- ${test_env} ${RUBY_EXECUTABLE} testme -v
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/examples)
 
   file(GLOB TESTS tests/test_*.rb)


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


Mime
View raw message