aboutsummaryrefslogtreecommitdiffstats
path: root/test/rake/test_rake_functional.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rake/test_rake_functional.rb')
-rw-r--r--test/rake/test_rake_functional.rb26
1 files changed, 24 insertions, 2 deletions
diff --git a/test/rake/test_rake_functional.rb b/test/rake/test_rake_functional.rb
index 3764709f38..ad59f7b9f8 100644
--- a/test/rake/test_rake_functional.rb
+++ b/test/rake/test_rake_functional.rb
@@ -5,8 +5,8 @@ require 'open3'
class TestRakeFunctional < Rake::TestCase
def setup
- @rake_path = File.expand_path("../../../bin/rake", __FILE__)
- lib_path = File.expand_path("../../../lib", __FILE__)
+ @rake_path = File.expand_path("bin/rake")
+ lib_path = File.expand_path("lib")
@ruby_options = ["-I#{lib_path}", "-I."]
@verbose = ENV['VERBOSE']
@@ -417,6 +417,28 @@ class TestRakeFunctional < Rake::TestCase
assert_equal "1\n", @out
end
+ def can_detect_signals?
+ system "ruby -e 'Process.kill \"TERM\", $$'"
+ status = $?
+ if @verbose
+ puts " SIG status = #{$?.inspect}"
+ puts " SIG status.respond_to?(:signaled?) = #{$?.respond_to?(:signaled?).inspect}"
+ puts " SIG status.signaled? = #{status.signaled?}" if status.respond_to?(:signaled?)
+ end
+ status.respond_to?(:signaled?) && status.signaled?
+ end
+
+ def test_signal_propagation_in_tests
+ if can_detect_signals?
+ rakefile_test_signal
+ rake
+ assert_match(/ATEST/, @out)
+ refute_match(/BTEST/, @out)
+ else
+ skip "Signal detect seems broken on this system"
+ end
+ end
+
private
# Run a shell Ruby command with command line options (using the