Author: aconway
Date: Tue Jun  3 15:52:36 2014
New Revision: 1599632

URL: http://svn.apache.org/r1599632
Log:
DISPATCH-56: Fix PYTHONPATH for running qdrouterd_man.py and tests.

These were breaking because pythohn path was not set correctly during the build.

Added:
    qpid/dispatch/trunk/build_env.py.in   (with props)
Modified:
    qpid/dispatch/trunk/CMakeLists.txt
    qpid/dispatch/trunk/doc/man/CMakeLists.txt
    qpid/dispatch/trunk/tests/CMakeLists.txt

Modified: qpid/dispatch/trunk/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/dispatch/trunk/CMakeLists.txt?rev=1599632&r1=1599631&r2=1599632&view=diff
==============================================================================
--- qpid/dispatch/trunk/CMakeLists.txt (original)
+++ qpid/dispatch/trunk/CMakeLists.txt Tue Jun  3 15:52:36 2014
@@ -103,6 +103,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DI
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/qdtest.in
                ${CMAKE_CURRENT_BINARY_DIR}/tools/qdtest)
 
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/build_env.py.in
+               ${CMAKE_CURRENT_BINARY_DIR}/build_env.py)
+
 ##
 ## Build the Multi-Threaded Server Library
 ##

Added: qpid/dispatch/trunk/build_env.py.in
URL: 
http://svn.apache.org/viewvc/qpid/dispatch/trunk/build_env.py.in?rev=1599632&view=auto
==============================================================================
--- qpid/dispatch/trunk/build_env.py.in (added)
+++ qpid/dispatch/trunk/build_env.py.in Tue Jun  3 15:52:36 2014
@@ -0,0 +1,37 @@
+#!/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
+##
+
+"""
+Run a program with environment set up for the cmake build.
+Note you can run an interactive shell.
+"""
+
+import os, sys
+
+os.environ['PYTHONPATH'] = os.pathsep.join(
+    sys.path+[
+        "${CMAKE_SOURCE_DIR}/python",
+        "${CMAKE_BUILD_DIR}/python",
+        "${CMAKE_SOURCE_DIR}/tests"
+    ])
+
+if __name__ == "__main__":
+    print "FIXME", sys.argv
+    os.execvp(sys.argv[1], sys.argv[1:])

Propchange: qpid/dispatch/trunk/build_env.py.in
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/dispatch/trunk/doc/man/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/dispatch/trunk/doc/man/CMakeLists.txt?rev=1599632&r1=1599631&r2=1599632&view=diff
==============================================================================
--- qpid/dispatch/trunk/doc/man/CMakeLists.txt (original)
+++ qpid/dispatch/trunk/doc/man/CMakeLists.txt Tue Jun  3 15:52:36 2014
@@ -36,7 +36,7 @@ file (GLOB_RECURSE MAN_PAGE_GENERATOR
 set (QDROUTERD_MAN qdrouterdconf.conf.5.new)
 
 add_custom_command (OUTPUT ${QDROUTERD_MAN}
-    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qdrouterd_man.py 
${QDROUTERD_MAN}
+    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/build_env.py 
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qdrouterd_man.py 
${QDROUTERD_MAN}
     DEPENDS ${MAN_PAGE_GENERATOR})
 
 add_custom_target(man ALL DEPENDS ${QDROUTERD_MAN})

Modified: qpid/dispatch/trunk/tests/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/CMakeLists.txt?rev=1599632&r1=1599631&r2=1599632&view=diff
==============================================================================
--- qpid/dispatch/trunk/tests/CMakeLists.txt (original)
+++ qpid/dispatch/trunk/tests/CMakeLists.txt Tue Jun  3 15:52:36 2014
@@ -51,8 +51,8 @@ add_test(unit_tests_size_3     unit_test
 add_test(unit_tests_size_2     unit_tests_size 2)
 add_test(unit_tests_size_1     unit_tests_size 1)
 add_test(unit_tests            unit_tests 
${CMAKE_CURRENT_SOURCE_DIR}/threads4.conf)
-add_test(router_tests          python 
${CMAKE_CURRENT_SOURCE_DIR}/router_engine_test.py -v)
-add_test(management_tests      python -m unittest -v management)
+add_test(router_tests          ${PYTHON_EXECUTABLE} 
${CMAKE_CURRENT_SOURCE_DIR}/router_engine_test.py -v)
+add_test(management_tests      ${PYTHON_EXECUTABLE} 
${CMAKE_BINARY_DIR}/build_env.py ${PYTHON_EXECUTABLE} -m unittest -v management)
 
 set(SYSTEM_TEST_FILES system_test.py system_tests_one_router.py 
system_tests_two_routers.py system_tests_broker.py)
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to