Return-Path: X-Original-To: apmail-qpid-proton-archive@minotaur.apache.org Delivered-To: apmail-qpid-proton-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 74AEC10B94 for ; Tue, 1 Apr 2014 11:25:38 +0000 (UTC) Received: (qmail 23002 invoked by uid 500); 1 Apr 2014 11:25:37 -0000 Delivered-To: apmail-qpid-proton-archive@qpid.apache.org Received: (qmail 22922 invoked by uid 500); 1 Apr 2014 11:25:34 -0000 Mailing-List: contact proton-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: proton@qpid.apache.org Delivered-To: mailing list proton@qpid.apache.org Received: (qmail 22910 invoked by uid 99); 1 Apr 2014 11:25:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2014 11:25:31 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of prvs=9168cf7b10=rhs@alum.mit.edu designates 18.7.68.14 as permitted sender) Received: from [18.7.68.14] (HELO alum-mailsec-scanner-3.mit.edu) (18.7.68.14) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2014 11:25:23 +0000 X-AuditID: 1207440e-f79c76d000003e2c-20-533aa20c212c Received: from outgoing-alum.mit.edu (OUTGOING-ALUM.MIT.EDU [18.7.68.33]) by alum-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id 8E.9E.15916.C02AA335; Tue, 1 Apr 2014 07:25:00 -0400 (EDT) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) (authenticated bits=0) (User authenticated as rhs@ALUM.MIT.EDU) by outgoing-alum.mit.edu (8.13.8/8.12.4) with ESMTP id s31BOw17022705 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 1 Apr 2014 07:25:00 -0400 Received: by mail-pa0-f53.google.com with SMTP id ld10so9674370pab.40 for ; Tue, 01 Apr 2014 04:24:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=J7iR2Epr2T1+eahiANPfP8emoNxe3uwDWcaGCOifByo=; b=FtaJ2YEc454X7z2CEG/3nqDFX3mZ+WoYSEUYZbUUvWmD040LFA8kUvVseBfoz37NqO glPa3LvrjxvnMIsB5Z5pqVNdvHwcT/0N6k+eZ3mb1DM2DU8d2l5E7lNwhsfG8yCgh2mc ZPfPy4RR43JYF06UYhYy94YaDcFHw3RRK83KJWh4P2bsSIZQXUx/LyeqCo6X1kpOLq47 1rKg2+pSmnojL10cfS03GpAlJ7F5ou5jGQst4RfcPTQV1BkxQBcvBg6tK0EJcj+yRQWL mnTWjPBdKX+NylDxnwgfA9RShfxg9tpp8Y3zBulG9laAnsjwMy75OXP6NgKxAgqCVLBb dSPA== MIME-Version: 1.0 X-Received: by 10.66.246.229 with SMTP id xz5mr12019392pac.119.1396351498855; Tue, 01 Apr 2014 04:24:58 -0700 (PDT) Received: by 10.70.30.228 with HTTP; Tue, 1 Apr 2014 04:24:58 -0700 (PDT) In-Reply-To: <20140331202129.1B5F323889B9@eris.apache.org> References: <20140331202129.1B5F323889B9@eris.apache.org> Date: Tue, 1 Apr 2014 07:24:58 -0400 Message-ID: Subject: Re: svn commit: r1583443 - in /qpid/proton/trunk: README proton-c/CMakeLists.txt proton-c/bindings/CMakeLists.txt From: Rafael Schloming To: "proton@qpid.apache.org" Content-Type: multipart/alternative; boundary=047d7b15acc9122e2504f5f96b30 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFKsWRmVeSWpSXmKPExsUixO6iqMuzyCrYYP0qCYu1Jz0dGD2m3nnA FsAYxW2TlFhSFpyZnqdvl8Cd8XjHYcaCB4UVF5vbWBsY/yV2MXJySAiYSLROP8EEYYtJXLi3 ng3EFhK4zCgxYxlvFyMXkH2XSaLjz3omiMQkRoll/bkgCQmBuawSbzf2sIMkeAUEJU7OfMIC MalU4ueJbSwQDZ4S07buBpvKKWAlcfL3YWaIuKXEpb0/GUFsFgEVibb5F5kg5gRILH7yAcwW FqiR2LrxM1gvm4CmxLbLG8FsEQFTiUtXrrCC2MwCXhLXVvexTmAUnIXkjFlIUhC2jsS7vgfM ELa2xKres0ww9rKFr5kXMLKuYpRLzCnN1c1NzMwpTk3WLU5OzMtLLdI11svNLNFLTSndxAgJ b74djO3rZQ4xCnAwKvHwWpRbBguxJpYVV+YeYpTkYFIS5T0x3SpYiC8pP6UyI7E4I76oNCe1 +BCjBAezkgjvxhlAOd6UxMqq1KJ8mJQ0B4uSOK/aEnU/IYH0xJLU7NTUgtQimKwMB4eSBO/v BUCNgkWp6akVaZk5JQhpJg5OkOFcUiLFqXkpqUWJpSUZ8aCYjy8GRj1Iigdob+l8kL3FBYm5 QFGI1lOMlhxNd1c3MnGcWrcBSN5avrGRSYglLz8vVUqc9xdIgwBIQ0ZpHtw6WJJ7xSgO9L0w 7xOQq3iACRJu6iughUxAC28mgi0sSURISTUwSu7qCn+4sESH5YH1A6ZZXHN0Bee/706SvV9y LnfVy796xWcXTb54P44hwUBfseraptN+SdLc1jY2ExZWeWtefXhNU7mi11Nlj1zU0TYTtyss Eoyfmq8Uf4qNz3tg+nVjTo/8/U0zSn5YVX6U0FE9+va36PXcp51Hsk6YcuZ75dkxOKa1/RFQ YinOSDTUYi4qTgQAu2AsM00DAAA= X-Virus-Checked: Checked by ClamAV on apache.org --047d7b15acc9122e2504f5f96b30 Content-Type: text/plain; charset=ISO-8859-1 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, 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 > > --047d7b15acc9122e2504f5f96b30--