ruby-changes:61095
From: David <ko1@a...>
Date: Fri, 8 May 2020 14:14:05 +0900 (JST)
Subject: [ruby-changes:61095] acb793b71c (master): [rubygems/rubygems] Make cmake tests less verbose on jruby
https://git.ruby-lang.org/ruby.git/commit/?id=acb793b71c From acb793b71c2465c2cc527393eab57fe29f53f665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Mon, 23 Mar 2020 22:22:32 +0100 Subject: [rubygems/rubygems] Make cmake tests less verbose on jruby These tests work on jruby, but the flags to the system command used to detect whether `cmake` is present seem to be ignored on jruby and the output is printed to screen instead of being sent to /dev/null. This results in very verbose tests, like this: ``` $ rake TESTOPTS=--name=TestGemExtCmakeBuilder#test_self_build (... warnings skipped ...) Skipping `gem cert` tests on jruby. Skipping Gem::Security tests on jruby. Run options: --name=TestGemExtCmakeBuilder#test_self_build --seed 16839 # Running: /home/deivid/Code/rubygems/test/rubygems/test_gem_ext_cmake_builder.rb:13: warning: system does not support options in JRuby yet: {:out=>"/dev/null", :err=>[:child, :out]} Usage cmake [options] <path-to-source> cmake [options] <path-to-existing-build> Specify a source directory to (re-)generate a build system for it in the current working directory. Specify an existing build directory to re-generate its build system. Run 'cmake --help' for more information. . Finished in 0.387301s, 2.5820 runs/s, 20.6558 assertions/s. 1 runs, 8 assertions, 0 failures, 0 errors, 0 skips Coverage report generated for Unit Tests to /home/deivid/Code/rubygems/coverage. 2258 / 8832 LOC (25.57%) covered. ``` By using `Open3`, we get the test output clean: ``` $ rake TESTOPTS=--name=TestGemExtCmakeBuilder#test_self_build (... warnings skipped ...) Skipping `gem cert` tests on jruby. Skipping Gem::Security tests on jruby. Run options: --name=TestGemExtCmakeBuilder#test_self_build --seed 22605 # Running: . Finished in 0.381959s, 2.6181 runs/s, 20.9446 assertions/s. 1 runs, 8 assertions, 0 failures, 0 errors, 0 skips Coverage report generated for Unit Tests to /home/deivid/Code/rubygems/coverage. 2258 / 8832 LOC (25.57%) covered. ``` https://github.com/rubygems/rubygems/commit/531ce37ea3 diff --git a/test/rubygems/test_gem_ext_cmake_builder.rb b/test/rubygems/test_gem_ext_cmake_builder.rb index 899fde6..6d4c670 100644 --- a/test/rubygems/test_gem_ext_cmake_builder.rb +++ b/test/rubygems/test_gem_ext_cmake_builder.rb @@ -10,9 +10,9 @@ class TestGemExtCmakeBuilder < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_cmake_builder.rb#L10 # Details: https://github.com/rubygems/rubygems/issues/1270#issuecomment-177368340 skip "CmakeBuilder doesn't work on Windows." if Gem.win_platform? - system('cmake', out: IO::NULL, err: [:child, :out]) + _, status = Open3.capture2e('cmake') - skip 'cmake not present' unless $?.success? + skip 'cmake not present' unless status.success? @ext = File.join @tempdir, 'ext' @dest_path = File.join @tempdir, 'prefix' -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/