qpid-proton mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Schloming <...@alum.mit.edu>
Subject Re: svn commit: r1583443 - in /qpid/proton/trunk: README proton-c/CMakeLists.txt proton-c/bindings/CMakeLists.txt
Date Tue, 01 Apr 2014 11:24:58 GMT
It's good that we are checking for rubygem dependencies in cmake now, but I
think the checks should probably be mandatory when building the binding is
enabled rather than simply omitting the tests. Previously we could take a
source tarball and run 'cmake -DBUILD_[LANG}=ON && make test' and have
confidence that the language binding would be tested. With the tests being
(relatively) silently omitted when the test dependencies are not present,
it is much easier to get a false positive and think that we've tested
something when we haven't.

--Rafael


On Mon, Mar 31, 2014 at 4:21 PM, <mcpierce@apache.org> wrote:

> Author: mcpierce
> Date: Mon Mar 31 20:21:28 2014
> New Revision: 1583443
>
> URL: http://svn.apache.org/r1583443
> Log:
> PROTON-550: Add check for Ruby gem dependencies for tests.
>
> If these dependencies are missing then raise a warning message during
> the CMake generation process.
>
> Modified:
>     qpid/proton/trunk/README
>     qpid/proton/trunk/proton-c/CMakeLists.txt
>     qpid/proton/trunk/proton-c/bindings/CMakeLists.txt
>
> Modified: qpid/proton/trunk/README
> URL:
> http://svn.apache.org/viewvc/qpid/proton/trunk/README?rev=1583443&r1=1583442&r2=1583443&view=diff
>
> ==============================================================================
> --- qpid/proton/trunk/README (original)
> +++ qpid/proton/trunk/README Mon Mar 31 20:21:28 2014
> @@ -236,10 +236,14 @@ Testing
>
>  Additional packages required for testing:
>
> -    yum install rubygem-minitest
> +    yum install rubygem-minitest rubygem-rspec rubygem-simplecov
> +
> +On non-RPM based systems, you can install them using:
> +
> +    gem install minitest rspec simplecov
>
>  To test Proton, use the cmake build and run 'make test'. Note that
> -this will invoke the maven tests as well, so the maven prerequisates
> +this will invoke the maven tests as well, so the maven prerequisites
>  are required in addition to the cmake prerequisites.
>
>  Running Tests
>
> Modified: qpid/proton/trunk/proton-c/CMakeLists.txt
> URL:
> http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/CMakeLists.txt?rev=1583443&r1=1583442&r2=1583443&view=diff
>
> ==============================================================================
> --- qpid/proton/trunk/proton-c/CMakeLists.txt (original)
> +++ qpid/proton/trunk/proton-c/CMakeLists.txt Mon Mar 31 20:21:28 2014
> @@ -472,20 +472,25 @@ if (RUBY_EXE)
>    set (rb_rubylib "${rb_root}:${rb_src}:${rb_bin}:${rb_bld}:${rb_lib}")
>
>    # ruby unit tests:  tests/ruby/proton-test
> -  add_test (ruby-unit-test ${PYTHON_EXECUTABLE} ${env_py}
> "PATH=${rb_path}" "RUBYLIB=${rb_rubylib}"
> -    "${rb_root}/proton-test")
> +  # only enable the tests if the Ruby gem dependencies were found
> +  if (DEFAULT_RUBY_TESTING)
> +    add_test (ruby-unit-test ${PYTHON_EXECUTABLE} ${env_py}
> "PATH=${rb_path}" "RUBYLIB=${rb_rubylib}"
> +      "${rb_root}/proton-test")
>
> -  # ruby spec tests
> -  find_program(RSPEC_EXE rspec)
> -  if (RSPEC_EXE)
> -    add_test (NAME ruby-spec-test
> -              WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bindings/ruby
> -              COMMAND ${PYTHON_EXECUTABLE} ${env_py} "PATH=${rb_path}"
> "RUBYLIB=${rb_rubylib}"
> -                      ${RSPEC_EXE})
> +    # ruby spec tests
> +    find_program(RSPEC_EXE rspec)
> +    if (RSPEC_EXE)
> +      add_test (NAME ruby-spec-test
> +                WORKING_DIRECTORY
> ${CMAKE_CURRENT_SOURCE_DIR}/bindings/ruby
> +                COMMAND ${PYTHON_EXECUTABLE} ${env_py} "PATH=${rb_path}"
> "RUBYLIB=${rb_rubylib}"
> +                        ${RSPEC_EXE})
>
> -  else(RSPEC_EXE)
> -    message (STATUS "Cannot find rspec, skipping rspec tests")
> -  endif(RSPEC_EXE)
> +    else(RSPEC_EXE)
> +      message (STATUS "Cannot find rspec, skipping rspec tests")
> +    endif(RSPEC_EXE)
> +  else (DEFAULT_RUBY_TESTING)
> +    message(STATUS "Skipping Ruby tests: missing dependencies")
> +  endif (DEFAULT_RUBY_TESTING)
>  else (RUBY_EXE)
>    message (STATUS "Cannot find ruby, skipping ruby tests")
>  endif (RUBY_EXE)
>
> Modified: qpid/proton/trunk/proton-c/bindings/CMakeLists.txt
> URL:
> http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/CMakeLists.txt?rev=1583443&r1=1583442&r2=1583443&view=diff
>
> ==============================================================================
> --- qpid/proton/trunk/proton-c/bindings/CMakeLists.txt (original)
> +++ qpid/proton/trunk/proton-c/bindings/CMakeLists.txt Mon Mar 31 20:21:28
> 2014
> @@ -36,9 +36,34 @@ if (PYTHONLIBS_FOUND)
>  endif (PYTHONLIBS_FOUND)
>
>  # Prerequisites for Ruby:
> +find_program(GEM_EXE "gem")
> +macro(CheckRubyGem varname gemname)
> +  execute_process(COMMAND ${GEM_EXE} list --local ${gemname}
> +    OUTPUT_VARIABLE CHECK_OUTPUT)
> +
> +  set (${varname} OFF)
> +
> +  if (CHECK_OUTPUT MATCHES "${gemname}[ ]+\(.*\)")
> +    message(STATUS "Found Ruby gem: ${gemname}")
> +    set (${varname} ON)
> +  else()
> +    message(STATUS "Missing Ruby gem dependency: ${gemname}")
> +    set (${varname} OFF)
> +  endif()
> +endmacro()
> +
>  find_package(Ruby)
>  if (RUBY_FOUND)
>    set (DEFAULT_RUBY ON)
> +
> +  CheckRubyGem("HAS_RUBY_GEM_RSPEC"     "rspec")
> +  CheckRubyGem("HAS_RUBY_GEM_SIMPLECOV" "simplecov")
> +
> +  if (HAS_RUBY_GEM_RSPEC AND HAS_RUBY_GEM_SIMPLECOV)
> +    set (DEFAULT_RUBY_TESTING ON CACHE INTERNAL "")
> +  else()
> +    set (DEFAULT_RUBY_TESTING OFF CACHE INTERNAL "")
> +  endif (HAS_RUBY_GEM_RSPEC AND HAS_RUBY_GEM_SIMPLECOV)
>  endif (RUBY_FOUND)
>
>  # Prerequites for PHP:
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
> For additional commands, e-mail: commits-help@qpid.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message