You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2016/06/01 04:01:59 UTC

svn commit: r1746375 - in /qpid/trunk/qpid/cpp/src/tests: CMakeLists.txt brokertest.py common.py env.py.in run_windows_store_tests

Author: jross
Date: Wed Jun  1 04:01:58 2016
New Revision: 1746375

URL: http://svn.apache.org/viewvc?rev=1746375&view=rev
Log:
QPID-7281: Various fixes for the tests on windows

 - Adjust environment script for windows paths
 - Pythonify the test runner for the windows store tests
 - Run the HA tests only on posix systems
 - Remove a finicky assertion in brokertest.py

Added:
    qpid/trunk/qpid/cpp/src/tests/run_windows_store_tests
Modified:
    qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/tests/brokertest.py
    qpid/trunk/qpid/cpp/src/tests/common.py
    qpid/trunk/qpid/cpp/src/tests/env.py.in

Modified: qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt?rev=1746375&r1=1746374&r2=1746375&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt Wed Jun  1 04:01:58 2016
@@ -285,7 +285,6 @@ add_test(NAME cli_tests COMMAND ${PYTHON
 add_test(NAME client_tests COMMAND ${PYTHON_EXECUTABLE} run_client_tests)
 add_test(NAME federation_tests COMMAND ${PYTHON_EXECUTABLE} run_federation_tests)
 add_test(NAME flow_control_tests COMMAND ${PYTHON_EXECUTABLE} run_flow_control_tests)
-add_test(NAME ha_tests COMMAND ${PYTHON_EXECUTABLE} run_ha_tests)
 add_test(NAME msg_group_tests COMMAND ${PYTHON_EXECUTABLE} run_msg_group_tests)
 add_test(NAME performance_tests COMMAND ${PYTHON_EXECUTABLE} run_performance_tests)
 add_test(NAME python_tests COMMAND ${PYTHON_EXECUTABLE} run_python_tests)
@@ -302,18 +301,14 @@ endif (BUILD_AMQP)
 if (CMAKE_SYSTEM_NAME STREQUAL Windows)
     # Windows-only tests
 
-    if (BUILD_MSSQL)
-        add_test(NAME store_tests COMMAND powershell run_store_tests.ps1 MSSQL)
-    endif (BUILD_MSSQL)
-
-    if (BUILD_MSCLFS)
-        add_test(NAME store_tests_clfs COMMAND powershell run_store_tests.ps1 MSSQL-CLFS)
-    endif (BUILD_MSCLFS)
+    add_test(NAME windows_store_tests COMMAND ${PYTHON_EXECUTABLE} run_windows_store_tests)
 else (CMAKE_SYSTEM_NAME STREQUAL Windows)
     # Posix-only tests
 
-    add_test(NAME logging_tests COMMAND run_logging_tests) # Pretty simple to convert
+    add_test(NAME ha_tests COMMAND ${PYTHON_EXECUTABLE} run_ha_tests)
+    
     add_test(NAME ipv6_tests COMMAND run_ipv6_tests) # Also pretty simple to convert
+    add_test(NAME logging_tests COMMAND run_logging_tests) # Pretty simple to convert
     add_test(NAME paged_queue_tests COMMAND run_paged_queue_tests)
     add_test(NAME ring_queue_tests COMMAND run_ring_queue_tests)
     add_test(NAME topic_tests COMMAND run_topic_tests)

Modified: qpid/trunk/qpid/cpp/src/tests/brokertest.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/brokertest.py?rev=1746375&r1=1746374&r2=1746375&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/brokertest.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/brokertest.py Wed Jun  1 04:01:58 2016
@@ -157,7 +157,6 @@ class Popen(subprocess.Popen):
         """
         self._clean = False
         self._clean_lock = Lock()
-        assert find_exe(cmd[0]), "executable not found: "+cmd[0]
         if type(cmd) is type(""): cmd = [cmd] # Make it a list.
         self.cmd  = [ str(x) for x in cmd ]
         self.expect = expect

Modified: qpid/trunk/qpid/cpp/src/tests/common.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/common.py?rev=1746375&r1=1746374&r2=1746375&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/common.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/common.py Wed Jun  1 04:01:58 2016
@@ -23,7 +23,6 @@ from env import *
 
 import atexit as _atexit
 import os as _os
-import platform as _platform
 import re as _re
 import shlex as _shlex
 import shutil as _shutil
@@ -32,8 +31,6 @@ import subprocess as _subprocess
 import time as _time
 import uuid as _uuid
 
-WINDOWS = _platform.system() == "Windows"
-
 def _unique_id():
     return str(_uuid.uuid4())[:4]
 

Modified: qpid/trunk/qpid/cpp/src/tests/env.py.in
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/env.py.in?rev=1746375&r1=1746374&r2=1746375&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/env.py.in (original)
+++ qpid/trunk/qpid/cpp/src/tests/env.py.in Wed Jun  1 04:01:58 2016
@@ -21,6 +21,10 @@ from __future__ import print_function
 
 from plano import *
 
+import platform as _platform
+
+WINDOWS = _platform.system() == "Windows"
+
 def _export(name, value):
     globals()[name] = value
 
@@ -33,6 +37,8 @@ def _export_module(name, path):
     if exists(path):
         _export(name, path)
 
+_cmake_build_type = "RelWithDebInfo" # XXX
+
 # Variables substituted by cmake
 
 _export("BUILD_DIR", normalize_path("@CMAKE_BINARY_DIR@"))
@@ -59,11 +65,16 @@ ENV["PYTHONPATH"] = PATH_VAR_SEP.join(_p
 
 # Path
 
+_build_src_dir = join(BUILD_DIR, "src")
+_build_tests_dir = join(BUILD_DIR, "src", "tests")
+
+if WINDOWS:
+    _build_src_dir = join(_build_src_dir, _cmake_build_type)
+    _build_tests_dir = join(_build_tests_dir, _cmake_build_type)
+
 _path = [
-    join(BUILD_DIR, "src"),
-    join(BUILD_DIR, "src", "RelWithDebInfo"),
-    join(BUILD_DIR, "src", "tests"),
-    join(BUILD_DIR, "src", "tests", "RelWithDebInfo"),
+    _build_src_dir,
+    _build_tests_dir,
     join(BUILD_DIR, "management", "python", "bin"),
 ]
 
@@ -74,14 +85,19 @@ ENV["PATH"] = PATH_VAR_SEP.join(_path)
 
 # Modules
 
-_export_module("HA_LIB", join(BUILD_DIR, "src", "ha.so"))
-_export_module("XML_LIB", join(BUILD_DIR, "src", "xml.so"))
-_export_module("AMQP_LIB", join(BUILD_DIR, "src", "amqp.so"))
-_export_module("TEST_STORE_LIB", join(BUILD_DIR, "src", "tests", "test_store.so"))
-_export_module("STORE_LIB", join(BUILD_DIR, "src", "linearstore.so"))
+_module_prefix = join(BUILD_DIR, "src")
+              
+if WINDOWS:
+    _module_prefix = join(_module_prefix, _cmake_build_type)
+
+_export_module("HA_LIB", join(_module_prefix, "ha@CMAKE_SHARED_LIBRARY_SUFFIX@"))
+_export_module("XML_LIB", join(_module_prefix, "xml@CMAKE_SHARED_LIBRARY_SUFFIX@"))
+_export_module("AMQP_LIB", join(_module_prefix, "amqp@CMAKE_SHARED_LIBRARY_SUFFIX@"))
+_export_module("TEST_STORE_LIB", join(_module_prefix, "tests", "test_store@CMAKE_SHARED_LIBRARY_SUFFIX@"))
+_export_module("STORE_LIB", join(_module_prefix, "linearstore@CMAKE_SHARED_LIBRARY_SUFFIX@"))
 
 if STORE_LIB is None:
-    _export_module("STORE_LIB", join(BUILD_DIR, "src", "legacystore.so"))
+    _export_module("STORE_LIB", join(_module_prefix, "legacystore@CMAKE_SHARED_LIBRARY_SUFFIX@"))
 
 # Summarize
 

Added: qpid/trunk/qpid/cpp/src/tests/run_windows_store_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_windows_store_tests?rev=1746375&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_windows_store_tests (added)
+++ qpid/trunk/qpid/cpp/src/tests/run_windows_store_tests Wed Jun  1 04:01:58 2016
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from common import *
+
+store_lib = join(BUILD_DIR, "src", "qpid", "store", "RelWithDebInfo", "store.dll")
+store_sql_lib = join(BUILD_DIR, "src", "qpid", "store", "RelWithDebInfo", "mssql_store.dll")
+store_clfs_lib = join(BUILD_DIR, "src", "qpid", "store", "RelWithDebInfo", "msclfs_store.dll")
+
+if exists(store_sql_lib):
+    port = start_broker("broker_sql",
+                        "--load-module {0}".format(store_lib),
+                        "--load-module {0}".format(store_sql_lib))
+
+    run_broker_tests(port,
+                     "-m qpid_tests.broker_0_10.dtx",
+                     "-m qpid_tests.broker_0_10.persistence")
+
+    stop_broker(port)
+
+if exists(store_clfs_lib):
+    port = start_broker("broker_clfs",
+                        "--load-module {0}".format(store_lib),
+                        "--load-module {0}".format(store_clfs_lib))
+
+    run_broker_tests(port,
+                     "-m qpid_tests.broker_0_10.dtx",
+                     "-m qpid_tests.broker_0_10.persistence")
+
+    stop_broker(port)
+
+ENV["STORE_SQL_LIB"] = store_sql_lib
+ENV["STORE_SQL_CLFS_LIB"] = store_clfs_lib
+
+if exists(store_sql_lib):
+    ENV["STORE_CATALOG"] = join(WORK_DIR, "store_recovery_sql_test")
+    call("qpid-python-test -m store -DOUTDIR={0}", WORK_DIR)
+
+if exists(store_clfs_lib):
+    ENV["STORE_CATALOG"] = join(WORK_DIR, "store_recovery_clfs_test")
+    call("qpid-python-test -m store -DOUTDIR={0}", WORK_DIR)
+
+check_results()



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