From commits-return-43781-archive-asf-public=cust-asf.ponee.io@qpid.apache.org Thu Feb 15 20:58:26 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E63AA18067B for ; Thu, 15 Feb 2018 20:58:25 +0100 (CET) Received: (qmail 60014 invoked by uid 500); 15 Feb 2018 19:58:25 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 60005 invoked by uid 99); 15 Feb 2018 19:58:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Feb 2018 19:58:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CFB4AE090C; Thu, 15 Feb 2018 19:58:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aconway@apache.org To: commits@qpid.apache.org Message-Id: <3b75c94355e544a4b30d164d7023236a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: qpid-proton git commit: PROTON-1762: [ruby] ruby-gem tests, examples and self-test Date: Thu, 15 Feb 2018 19:58:24 +0000 (UTC) Repository: qpid-proton Updated Branches: refs/heads/master 9a8f9f59a -> 6b1518605 PROTON-1762: [ruby] ruby-gem tests, examples and self-test - ctests to install and smoke test the gem with the example self-tests - package ruby/tests/ and examples/ruby directories in ruby gem Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6b151860 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6b151860 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6b151860 Branch: refs/heads/master Commit: 6b15186051f7f535cdf2be38cac1355abaa8687c Parents: 9a8f9f5 Author: Alan Conway Authored: Wed Feb 14 17:11:56 2018 -0500 Committer: Alan Conway Committed: Thu Feb 15 14:41:18 2018 -0500 ---------------------------------------------------------------------- proton-c/bindings/ruby/CMakeLists.txt | 32 +++++++++++++++++++--- proton-c/bindings/ruby/qpid_proton.gemspec.in | 2 ++ 2 files changed, 30 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6b151860/proton-c/bindings/ruby/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/ruby/CMakeLists.txt b/proton-c/bindings/ruby/CMakeLists.txt index 8df7b55..039dea8 100644 --- a/proton-c/bindings/ruby/CMakeLists.txt +++ b/proton-c/bindings/ruby/CMakeLists.txt @@ -52,19 +52,43 @@ file(GLOB_RECURSE RUBY_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.rb *.rdoc) find_program(GEM_EXE gem DOC "Program to build and install ruby gem packages") mark_as_advanced(GEM_EXE) if (GEM_EXE) + set(GEM_FILE "${bin}/gem/qpid_proton-${PN_VERSION}.gem") # Copy source and generated files to the build tree so we can build the gem in one place configure_file(${src}/qpid_proton.gemspec.in ${bin}/gem/qpid_proton.gemspec) add_custom_command( - OUTPUT ${bin}/qpid_proton-${PN_VERSION}.gem + OUTPUT ${GEM_FILE} COMMAND ${CMAKE_COMMAND} -E copy_directory ${src} ${bin}/gem + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/examples/ruby/ ${bin}/gem/examples COMMAND ${CMAKE_COMMAND} -E copy ${bin}/cprotonRUBY_wrap.c ${bin}/gem/ext/cproton/cproton.c COMMAND ${GEM_EXE} build qpid_proton.gemspec - COMMAND ${CMAKE_COMMAND} -E copy ${bin}/gem/qpid_proton-${PN_VERSION}.gem ${bin} WORKING_DIRECTORY ${bin}/gem - DEPENDS ${RUBY_SRC} ${src}/LICENSE ${src}/TODO ${src}/ChangeLog cproton-ruby ${bin}/cprotonRUBY_wrap.c + DEPENDS ${bin}/gem/qpid_proton.gemspec ${RUBY_SRC} ${src}/LICENSE ${src}/TODO ${src}/ChangeLog + cproton-ruby + # NOTE: cproton-ruby is not strictly a dependency, we only need + # cprotonRUBY_wrap.c which is generated as a side effect of + # cproton-ruby. However it is easier to depend on cproton-ruby than to work + # around CMake's issues with dependencies on add_custom_command output in + # parallel builds. ) - add_custom_target(ruby-gem ALL DEPENDS ${bin}/qpid_proton-${PN_VERSION}.gem ) + add_custom_target(ruby-gem ALL DEPENDS ${GEM_FILE}) + + # Test installing the gem + to_native_path("${bin}/install" gem_home) + set(gem_env ${env_py} -- "GEM_HOME=${gem_home}" "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/proton-c") + add_test( + NAME ruby-gem-install COMMAND ${gem_env} ${GEM_EXE} install "${GEM_FILE}" -- + "--with-qpid-proton-include=${CMAKE_SOURCE_DIR}/proton-c/include" + "--with-qpid-proton-lib=${CMAKE_BINARY_DIR}/proton-c" + ) + + # Test running examples against the installed gem + add_test( + NAME ruby-gem-examples + COMMAND ${gem_env} ${RUBY_EXECUTABLE} example_test.rb -v + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/examples/ruby + ) + SET_TESTS_PROPERTIES(ruby-gem-examples PROPERTIES DEPENDS ruby-gem-install) # Run after install endif () ## CMake-based install http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6b151860/proton-c/bindings/ruby/qpid_proton.gemspec.in ---------------------------------------------------------------------- diff --git a/proton-c/bindings/ruby/qpid_proton.gemspec.in b/proton-c/bindings/ruby/qpid_proton.gemspec.in index a78f25b..58f3614 100644 --- a/proton-c/bindings/ruby/qpid_proton.gemspec.in +++ b/proton-c/bindings/ruby/qpid_proton.gemspec.in @@ -26,6 +26,8 @@ EOF "ext/cproton/*.rb", "ext/cproton/*.c", "lib/**/*.rb", + "tests/**/*.rb", + "examples/**/*" ] s.require_path = 'lib' s.required_ruby_version = '>= 1.9.3' --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org