diff options
Diffstat (limited to 'qpid/cpp/src/tests/legacystore')
-rw-r--r-- | qpid/cpp/src/tests/legacystore/CMakeLists.txt | 8 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh | 2 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/legacystore/run_python_tests | 32 |
3 files changed, 22 insertions, 20 deletions
diff --git a/qpid/cpp/src/tests/legacystore/CMakeLists.txt b/qpid/cpp/src/tests/legacystore/CMakeLists.txt index 9f6f6b7171..20a242b415 100644 --- a/qpid/cpp/src/tests/legacystore/CMakeLists.txt +++ b/qpid/cpp/src/tests/legacystore/CMakeLists.txt @@ -28,8 +28,6 @@ endif (QPID_LINK_BOOST_DYNAMIC) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) -set(test_wrap ${shell} ${CMAKE_SOURCE_DIR}/src/tests/run_test${test_script_suffix} -buildDir=${CMAKE_BINARY_DIR}) - if (BUILD_TESTING_UNITTESTS) # Like this to work with cmake 2.4 on Unix @@ -53,7 +51,7 @@ target_link_libraries (${testname} if ("${ARGV1}" STREQUAL "LONG") set_target_properties(${testname} PROPERTIES COMPILE_DEFINITIONS LONG_TEST) endif () -add_test (NAME ${testname} COMMAND ${test_wrap} -boostTest -- $<TARGET_FILE:${testname}>) +add_test (NAME ${testname} COMMAND ${CMAKE_BINARY_DIR}/src/tests/run.sh $<TARGET_FILE:${testname}>) unset (testname) ENDMACRO (define_journal_test) @@ -100,7 +98,7 @@ target_link_libraries (jtt__ut ${Boost_PROGRAM_OPTIONS_LIBRARY} ${clock_gettime_LIB} legacystore_shared) -add_test(journal_jtt_ut ${test_wrap} -boostTest -workingDir=${CMAKE_CURRENT_SOURCE_DIR}/jrnl/jtt -- ${CMAKE_CURRENT_BINARY_DIR}/jtt__ut) +add_test(journal_jtt_ut ${CMAKE_BINARY_DIR}/src/tests/run.sh ${CMAKE_CURRENT_BINARY_DIR}/jtt__ut) endif (BUILD_TESTING_UNITTESTS) @@ -127,6 +125,6 @@ target_link_libraries (jtt add_test(journal_jtt ${CMAKE_CURRENT_BINARY_DIR}/jtt -c ${CMAKE_CURRENT_SOURCE_DIR}/jrnl/jtt/jtt.csv) -add_test (legacystore_python_tests ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/run_python_tests${test_script_suffix}) +add_test(legacystore_python_tests ${PYTHON_EXECUTABLE} run_python_tests) endif (BUILD_LEGACYSTORE AND BUILD_TESTING) diff --git a/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh b/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh index bf75056444..be4504f3bf 100755 --- a/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh +++ b/qpid/cpp/src/tests/legacystore/federation/federation_tests_env.sh @@ -142,7 +142,7 @@ func_set_env () if test -z ${QPID_BLD}; then QPID_BLD="${QPID_DIR}/cpp" fi - source $QPID_BLD/src/tests/test_env.sh + source $QPID_BLD/src/tests/env.sh # CPP_CLUSTER_EXEC="${QPID_BLD}/src/tests/cluster_test" # PYTHON_CLUSTER_EXEC="${QPID_DIR}/cpp/src/tests/$PYTHON_TESTNAME" FEDERATION_SYS_TESTS_FAIL="${QPID_DIR}/cpp/src/tests/federation_sys_tests.fail" diff --git a/qpid/cpp/src/tests/legacystore/run_python_tests b/qpid/cpp/src/tests/legacystore/run_python_tests index c1d04a28a1..d87c72e966 100755 --- a/qpid/cpp/src/tests/legacystore/run_python_tests +++ b/qpid/cpp/src/tests/legacystore/run_python_tests @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env python + # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file @@ -18,26 +19,29 @@ # under the License. # -source $QPID_TEST_COMMON +import os +import sys -ensure_python_tests +# Put the python test library on the path so we can get our +# environment -#Add our directory to the python path -export PYTHONPATH=$srcdir/legacystore:$PYTHONPATH +file_path = os.path.abspath(__file__) +store_tests_dir = os.path.split(file_path)[0] +tests_dir = os.path.split(store_tests_dir)[0] -MODULENAME=python_tests +sys.path.insert(0, tests_dir) -echo "Running Python tests in module ${MODULENAME}..." +from common import * -QPID_PORT=${QPID_PORT:-5672} -FAILING=${FAILING:-/dev/null} -PYTHON_TESTS=${PYTHON_TESTS:-$*} +# Add our directory to the python path -OUTDIR=${MODULENAME}.tmp -rm -rf $OUTDIR +ENV["PYTHONPATH"] = "{}:{}".format(store_tests_dir, ENV["PYTHONPATH"]) # To debug a test, add the following options to the end of the following line: # -v DEBUG -c qpid.messaging.io.ops [*.testName] -${QPID_PYTHON_TEST} -m ${MODULENAME} -I $FAILING -DOUTDIR=$OUTDIR \ - $PYTHON_TEST || exit 1 +port = start_broker("broker", "--load-module {}".format(STORE_LIB)) + +run_broker_tests(port, "-m python_tests", "-DOUTDIR={}".format(WORK_DIR)) + +check_results() |