diff options
author | Stephen D. Huston <shuston@apache.org> | 2012-02-24 17:08:52 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2012-02-24 17:08:52 +0000 |
commit | 84aa47345dd4fd972284086e6f3a1f06bd1adb6f (patch) | |
tree | a6e7c5ff804d12b75a68ade2e8bc4c3355ed5e74 | |
parent | 7c0146192f181793594a2f8f805708fae6502031 (diff) | |
download | qpid-python-84aa47345dd4fd972284086e6f3a1f06bd1adb6f.tar.gz |
Generate a correct test_env.ps1 for Windows test runs; modify the python-invoking test scripts to pick up proper settings from test_env.ps1. Also improved run_test.ps1 to not look for an exe whose proper path has been supplied already; allowed ha_test to try to execute. Fixes QPID-3870
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1293340 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/tests/CMakeLists.txt | 10 | ||||
-rw-r--r-- | qpid/cpp/src/tests/python_tests.ps1 | 5 | ||||
-rw-r--r-- | qpid/cpp/src/tests/run_acl_tests.ps1 | 5 | ||||
-rw-r--r-- | qpid/cpp/src/tests/run_federation_tests.ps1 | 3 | ||||
-rw-r--r-- | qpid/cpp/src/tests/run_header_test.ps1 | 3 | ||||
-rw-r--r-- | qpid/cpp/src/tests/run_store_tests.ps1 | 9 | ||||
-rw-r--r-- | qpid/cpp/src/tests/run_test.ps1 | 5 |
7 files changed, 19 insertions, 21 deletions
diff --git a/qpid/cpp/src/tests/CMakeLists.txt b/qpid/cpp/src/tests/CMakeLists.txt index 75ecffe866..79c82106cb 100644 --- a/qpid/cpp/src/tests/CMakeLists.txt +++ b/qpid/cpp/src/tests/CMakeLists.txt @@ -34,8 +34,14 @@ set (abs_builddir ${CMAKE_CURRENT_BINARY_DIR}) set (abs_top_srcdir ${CMAKE_SOURCE_DIR}) set (abs_top_builddir ${CMAKE_BINARY_DIR}) set (builddir_lib_suffix "") -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/test_env.sh.in - ${CMAKE_CURRENT_BINARY_DIR}/test_env.sh) + +if (CMAKE_SYSTEM_NAME STREQUAL Windows) + configure_file (${CMAKE_CURRENT_SOURCE_DIR}/test_env.ps1.in + ${CMAKE_CURRENT_BINARY_DIR}/test_env.ps1) +else (CMAKE_SYSTEM_NAME STREQUAL Windows) + configure_file (${CMAKE_CURRENT_SOURCE_DIR}/test_env.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/test_env.sh) +endif (CMAKE_SYSTEM_NAME STREQUAL Windows) # If valgrind is selected in the configuration step, set up the path to it diff --git a/qpid/cpp/src/tests/python_tests.ps1 b/qpid/cpp/src/tests/python_tests.ps1 index 9f8b9890c4..f7caa8f75a 100644 --- a/qpid/cpp/src/tests/python_tests.ps1 +++ b/qpid/cpp/src/tests/python_tests.ps1 @@ -26,8 +26,7 @@ if (!(Test-Path $PYTHON_DIR -pathType Container)) { exit 1 } -$PYTHON_TEST_DIR = "$srcdir\..\..\..\tests\src\py" -$QMF_LIB = "$srcdir\..\..\..\extras\qmf\src\py" +. .\test_env.ps1 if (Test-Path env:FAILING) { $fails = "-I $env:FAILING" @@ -39,7 +38,5 @@ else { $tests = "$args" } -#cd $PYTHON_DIR -$env:PYTHONPATH="$PYTHON_DIR;$PYTHON_TEST_DIR;$env:PYTHONPATH;$QMF_LIB" python $PYTHON_DIR/qpid-python-test -m qpid_tests.broker_0_10 -m qpid.tests -b localhost:$env:QPID_PORT $fails $tests exit $LASTEXITCODE diff --git a/qpid/cpp/src/tests/run_acl_tests.ps1 b/qpid/cpp/src/tests/run_acl_tests.ps1 index 46e070477f..8279d87e54 100644 --- a/qpid/cpp/src/tests/run_acl_tests.ps1 +++ b/qpid/cpp/src/tests/run_acl_tests.ps1 @@ -20,15 +20,12 @@ # Run the acl tests. $srcdir = Split-Path $myInvocation.InvocationName -$PYTHON_DIR = "$srcdir\..\..\..\python" +. .\test_env.ps1 if (!(Test-Path $PYTHON_DIR -pathType Container)) { "Skipping acl tests as python libs not found" exit 1 } -$PYTHON_TEST_DIR = "$srcdir\..\..\..\tests\src\py" -$QMF_LIB = "$srcdir\..\..\..\extras\qmf\src\py" -$env:PYTHONPATH="$PYTHON_DIR;$srcdir;$PYTHON_TEST_DIR;$QMF_LIB" $Global:BROKER_EXE = "" Function start_broker($acl_options) diff --git a/qpid/cpp/src/tests/run_federation_tests.ps1 b/qpid/cpp/src/tests/run_federation_tests.ps1 index 35353a870f..803b3eef6f 100644 --- a/qpid/cpp/src/tests/run_federation_tests.ps1 +++ b/qpid/cpp/src/tests/run_federation_tests.ps1 @@ -26,8 +26,7 @@ if (!(Test-Path $PYTHON_DIR -pathType Container)) { exit 1 } -$PYTHON_TEST_DIR = "$srcdir\..\..\..\tests\src\py" -$QMF_LIB = "$srcdir\..\..\..\extras\qmf\src\py" +. .\test_env.ps1 # Test runs from the tests directory but the broker executable is one level # up, and most likely in a subdirectory from there based on what build type. diff --git a/qpid/cpp/src/tests/run_header_test.ps1 b/qpid/cpp/src/tests/run_header_test.ps1 index 7d3e43a30f..344fac9cf9 100644 --- a/qpid/cpp/src/tests/run_header_test.ps1 +++ b/qpid/cpp/src/tests/run_header_test.ps1 @@ -28,6 +28,8 @@ if (!(Test-Path $PYTHON_DIR -pathType Container)) { exit 0 } +. .\test_env.ps1 + if (Test-Path qpidd.port) { set-item -path env:QPID_PORT -value (get-content -path qpidd.port -totalcount 1) } @@ -42,6 +44,5 @@ if (!(Test-Path $prog)) { } Invoke-Expression "$prog -p $env:QPID_PORT" | Write-Output -$env:PYTHONPATH="$PYTHON_DIR;$env:PYTHONPATH" Invoke-Expression "python $srcdir/header_test.py localhost $env:QPID_PORT" | Write-Output exit $LASTEXITCODE diff --git a/qpid/cpp/src/tests/run_store_tests.ps1 b/qpid/cpp/src/tests/run_store_tests.ps1 index b2f0b1ccd8..0683892393 100644 --- a/qpid/cpp/src/tests/run_store_tests.ps1 +++ b/qpid/cpp/src/tests/run_store_tests.ps1 @@ -30,14 +30,14 @@ if ($test_store -ne "MSSQL" -and $test_store -ne "MSSQL-CLFS") { } $srcdir = Split-Path $myInvocation.InvocationName -$PYTHON_DIR = "$srcdir\..\..\..\python" + +. .\test_env.ps1 + if (!(Test-Path $PYTHON_DIR -pathType Container)) { "Skipping store tests as python libs not found" exit 1 } -$QMF_LIB = "$srcdir\..\..\..\extras\qmf\src\py" - # Test runs from the tests directory but the broker executable is one level # up, and most likely in a subdirectory from there based on what build type. # Look around for it before trying to start it. @@ -97,7 +97,7 @@ set-item -path env:QPID_PORT -value (get-content -path qpidd-store.port -totalco Remove-Item qpidd-store.port $PYTHON_TEST_DIR = "$srcdir\..\..\..\tests\src\py\qpid_tests\broker_0_10" -$env:PYTHONPATH="$PYTHON_DIR;$PYTHON_TEST_DIR;$env:PYTHONPATH;$QMF_LIB" +$env:PYTHONPATH="$PYTHON_TEST_DIR;$srcdir;$env:PYTHONPATH" python $PYTHON_DIR/qpid-python-test -m dtx -m persistence -b localhost:$env:QPID_PORT $fails $tests $RETCODE=$LASTEXITCODE if ($RETCODE -ne 0) { @@ -111,7 +111,6 @@ Invoke-Expression "$prog --quit --port $env:QPID_PORT" | Write-Output # Test 2... store.py starts/stops/restarts its own brokers $tests = "*" -$env:PYTHONPATH="$PYTHON_DIR;$QMF_LIB;$srcdir" $env:QPIDD_EXEC="$prog" $env:STORE_LIB="$store_dir\store$suffix.dll" if ($test_store -eq "MSSQL") { diff --git a/qpid/cpp/src/tests/run_test.ps1 b/qpid/cpp/src/tests/run_test.ps1 index ca990bc057..872e1dddb1 100644 --- a/qpid/cpp/src/tests/run_test.ps1 +++ b/qpid/cpp/src/tests/run_test.ps1 @@ -20,8 +20,7 @@ $srcdir = Split-Path $myInvocation.InvocationName # Set up environment and run a test executable or script. -$env:QPID_DATA_DIR = "" -$env:BOOST_TEST_SHOW_PROGRESS = "yes" +. .\test_env.ps1 # The test exe is probably not in the current binary dir - it's usually # placed in a subdirectory based on the configuration built in Visual Studio. @@ -30,7 +29,7 @@ $env:BOOST_TEST_SHOW_PROGRESS = "yes" # one level up. $prog = $args[0] $is_script = $prog -match ".ps1$" -if (!$is_script) { +if (!$is_script -and !(Test-Path "$prog")) { . $srcdir\find_prog.ps1 $prog $args[0] = $prog $env:QPID_LIB_DIR = "..\$sub" |