GitHub user matlo607 opened a pull request:

    https://github.com/apache/qpid-proton/pull/112

    fix paths to test binaries

    I could not execute the unit tests on Linux after a build with the package 
manager conan.
    I got various errors as below :
    ```
    Could not find executable 
/home/vagrant/.conan/data/qpid-proton/0.17.0/murex/testing/build/0a97a1801350fba2ff4f9c864097f04752c8d5c5/build-dir/proton-c/bindings/cpp/codec_test
    ...
    The following tests passed:
            python-test
            cpp-example-container
    
    11% tests passed, 17 tests failed out of 19
    
    Total Test time (real) =  38.84 sec
    
    The following tests FAILED:
              2 - cpp-codec_test (Not Run)
              3 - cpp-thread_safe_test (Not Run)
              4 - cpp-interop_test (Not Run)
              5 - cpp-message_test (Not Run)
              6 - cpp-scalar_test (Not Run)
              7 - cpp-value_test (Not Run)
              8 - cpp-container_test (Not Run)
              9 - cpp-url_test (Not Run)
             10 - c-object-tests (Not Run)
             11 - c-message-tests (Not Run)
             12 - c-engine-tests (Not Run)
             13 - c-parse-url-tests (Not Run)
             14 - c-refcount-tests (Not Run)
             15 - c-reactor-tests (Not Run)
             16 - c-event-tests (Not Run)
             17 - c-data-tests (Not Run)
             18 - c-condition-tests (Not Run)
    Errors while running CTest
    ```
    To reproduce the initial problem, please feel free to use this conan recipe 
:
    ```cmake
    PROJECT(conan-qpid-proton)
    cmake_minimum_required(VERSION 2.8)
    include(${CMAKE_CURRENT_SOURCE_DIR}/../conanbuildinfo.cmake)
    CONAN_BASIC_SETUP()
    
    macro(use_cxx11)
        if(CMAKE_VERSION VERSION_LESS "3.1")
            if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
                set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
            endif()
        else()
            set(CMAKE_CXX_STANDARD 11)
        endif()
    endmacro(use_cxx11)
    
    if(CXX_14)
        MESSAGE("Activating CXX_STANDARD 14")
        set(CMAKE_CXX_STANDARD 14)
    else()
        MESSAGE("Not activating CXX_STANDARD 14")
        MESSAGE("Activating CXX_STANDARD 11")
        use_cxx11()
    endif()
    
    include("CMakeListsOriginal.cmake")
    ```
    ```python
    #!/usr/bin/env python
    
    import os
    import shutil
    from conans import ConanFile, CMake
    
    def _defs_to_string(defs):
        return " ".join(['-D{0}="{1}"'.format(k, v) for k, v in defs.items()])
    
    class QpidProtonConan(ConanFile):
        name = 'qpid-proton'
        version = '0.17.0'
        license = "https://github.com/apache/qpid-proton/blob/master/LICENSE";
        settings = "os", "compiler", "build_type", "arch"
        options = {
            "PIC": [True, False],
            "shared": [True, False],
            "include_pdbs": [True, False],
            "tests": [True, False],
            "std": ['c++98', 'c++11']
        }
        default_options = "PIC=True", "shared=True", "include_pdbs=False", 
"tests=False", "std=c++11"
        sources = "https://github.com/apache/qpid-proton.git";
        source_dir = "qpid-proton"
        generators = "cmake"
        exports_sources = "CMakeLists.txt"
    
        def source(self):
            self.run("git clone %s" % (self.sources))
            self.run("cd %s && git checkout tags/%s" % (self.source_dir, 
self.version))
            os.rename(os.path.join(self.source_dir, 'CMakeLists.txt'), 
os.path.join(self.source_dir, 'CMakeListsOriginal.cmake'))
            shutil.move('CMakeLists.txt', self.source_dir)
    
        def requirements(self):
            self.requires("OpenSSL/1.0.2l@conan/stable")
    
        def build(self):
            cmake = CMake(self.settings)
            cmake.definitions['CMAKE_C_FLAGS'] = '-D_REENTRANT'
            cmake.definitions['CMAKE_CXX_FLAGS'] = '-D_REENTRANT -std=%s' % 
(self.options.std)
            cmake.definitions['CMAKE_SHARED_LINKER_FLAGS'] = '-ldl'
            cmake.definitions['CMAKE_INSTALL_PREFIX'] = '%s' % 
(self.package_folder)
            #cmake.definitions['CMAKE_VERBOSE_MAKEFILE:BOOL'] = 'ON'
    
            python_home = os.environ['PYTHONHOME']
    
            cmake_defs = dict()
            cmake_defs['ENABLE_VALGRIND'] = 'OFF'
            # proton-j was removed in version 0.17.0 and '-DBUILD_JAVA' becomes 
obsolete
            cmake_defs['BUILD_JAVA'] = 'OFF'
            cmake_defs['BUILD_PERL'] = 'OFF'
            cmake_defs['BUILD_PHP'] = 'OFF'
            cmake_defs['BUILD_PYTHON'] = 'ON'
            cmake_defs['BUILD_RUBY'] = 'OFF'
            cmake_defs['SASL_IMPL'] = 'none'
            cmake_defs['PYTHON_EXECUTABLE'] = '%s/bin/python' % (python_home)
            cmake_defs['PYTHON_INCLUDE_DIR'] = '%s/include/python2.7' % 
(python_home)
            cmake_defs['PYTHON_LIBRARY'] = '%s/lib/libpython2.7.so' % 
(python_home)
    
            self.output.info("Configuring: cmake %s %s" % (cmake.command_line, 
_defs_to_string(cmake_defs)))
    
            old_ld_library_path = os.environ['LD_LIBRARY_PATH']
            ld_library_path = os.path.join(python_home, 'lib') + os.pathsep + 
old_ld_library_path
            old_path = os.environ['PATH']
            path = os.path.join(python_home, 'bin') + os.pathsep + old_path
            self.output.info("PYTHONHOME=%s" % (python_home))
            self.output.info("LD_LIBRARY_PATH=%s" % (ld_library_path))
            self.output.info("PATH=%s" % (path))
            os.environ['PATH'] = path
            os.environ['LD_LIBRARY_PATH'] = ld_library_path
            os.environ['PYTHONHOME'] = python_home
    
            cmake.configure(self, args=None, defs=cmake_defs, \
                    source_dir=os.path.join('..', self.source_dir), 
build_dir='build-dir')
            cmake.build(self, args=None, build_dir='build-dir', 
target='install')
    
            if self.options.tests:
                # exclude java tests as we are not interested in proton-j
                self.run("cd build-dir && ctest -VV -E proton-java")
    
        def package(self):
            pass
    
        def package_info(self):
            self.cpp_info.includedirs = ['include']
            self.cpp_info.libdirs = ['lib64']
            self.cpp_info.resdir = ['share']
            self.cpp_info.libs = [
                'qpid-proton-core',
                'qpid-proton-cpp',
                'qpid-proton-proactor',
                'qpid-proton'
            ]
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/matlo607/qpid-proton fix-path-test-binaries

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/qpid-proton/pull/112.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #112
    
----
commit c7d79645e1e29d5444ed093b70ba3a4f0c14a8bb
Author: Matthieu Longo <[email protected]>
Date:   2017-07-21T12:21:37Z

    fix paths to test binaries

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to