diff options
| author | Justin Ross <jross@apache.org> | 2016-04-21 12:31:34 +0000 |
|---|---|---|
| committer | Justin Ross <jross@apache.org> | 2016-04-21 12:31:34 +0000 |
| commit | 71149592670f7592886751a9a866459bef0f12cc (patch) | |
| tree | e4d1fd948055e36d1560112a318e77a210506d06 /qpid/cpp/src/tests/linearstore | |
| parent | a835fb2724824dcd8a470fb51424cedeb6b38f62 (diff) | |
| download | qpid-python-71149592670f7592886751a9a866459bef0f12cc.tar.gz | |
QPID-7207: Create independent cpp and python subtrees, with content from tools and extras
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1740289 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/linearstore')
| -rw-r--r-- | qpid/cpp/src/tests/linearstore/CMakeLists.txt | 7 | ||||
| -rwxr-xr-x | qpid/cpp/src/tests/linearstore/run_python_tests | 31 |
2 files changed, 20 insertions, 18 deletions
diff --git a/qpid/cpp/src/tests/linearstore/CMakeLists.txt b/qpid/cpp/src/tests/linearstore/CMakeLists.txt index bf6c164818..760c54f3b1 100644 --- a/qpid/cpp/src/tests/linearstore/CMakeLists.txt +++ b/qpid/cpp/src/tests/linearstore/CMakeLists.txt @@ -17,13 +17,10 @@ # under the License. # -if(BUILD_LINEARSTORE AND BUILD_TESTING) +if (BUILD_LINEARSTORE AND BUILD_TESTING) message(STATUS "Building linearstore tests") -set(test_wrap ${shell} ${CMAKE_SOURCE_DIR}/src/tests/run_test${test_script_suffix} -buildDir=${CMAKE_BINARY_DIR}) - -add_test (linearstore_python_tests ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/run_python_tests${test_script_suffix}) +add_test(linearstore_python_tests ${PYTHON_EXECUTABLE} run_python_tests) endif (BUILD_LINEARSTORE AND BUILD_TESTING) - diff --git a/qpid/cpp/src/tests/linearstore/run_python_tests b/qpid/cpp/src/tests/linearstore/run_python_tests index 4ff212a71c..d87c72e966 100755 --- a/qpid/cpp/src/tests/linearstore/run_python_tests +++ b/qpid/cpp/src/tests/linearstore/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,25 +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/linearstore:${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() |
