From afea4a499510483975b88491af51ed8674261489 Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 27 Oct 2008 02:39:17 +0000 Subject: [PATCH] * test/minitest/test_mini_test.rb (test_filter_backtrace): fixed failure on Ruby built at out of $(srcdir). * test/minitest/test_mini_test.rb (test_Filter_backtrace_unit_starts): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ test/minitest/test_mini_test.rb | 25 ++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0b9ed255e..714a0a3e3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Oct 27 11:34:56 2008 Yuki Sonoda (Yugui) + + * test/minitest/test_mini_test.rb (test_filter_backtrace): + fixed failure on Ruby built at out of $(srcdir). + + * test/minitest/test_mini_test.rb (test_Filter_backtrace_unit_starts): + ditto. + Mon Oct 27 10:02:47 2008 NAKAMURA Usaku * io.c (read_all): the 3rd argument maybe Qnil. diff --git a/test/minitest/test_mini_test.rb b/test/minitest/test_mini_test.rb index 8561acb5bf..6c3a2c4b4e 100644 --- a/test/minitest/test_mini_test.rb +++ b/test/minitest/test_mini_test.rb @@ -5,6 +5,7 @@ ############################################################ require 'stringio' +require 'pathname' require 'minitest/unit' MiniTest::Unit.autorun @@ -27,22 +28,24 @@ class TestMiniTest < MiniTest::Unit::TestCase Object.send :remove_const, :ATestCase if defined? ATestCase end - BT_MIDDLE = ["./lib/mini/test.rb:165:in `run_test_suites'", - "./lib/mini/test.rb:161:in `each'", - "./lib/mini/test.rb:161:in `run_test_suites'", - "./lib/mini/test.rb:158:in `each'", - "./lib/mini/test.rb:158:in `run_test_suites'", - "./lib/mini/test.rb:139:in `run'", - "./lib/mini/test.rb:106:in `run'"] + pwd = Pathname.new(Dir.pwd) + MINITEST_BASE_DIR = Pathname.new(File.expand_path(MiniTest::MINI_DIR)).relative_path_from(pwd) + BT_MIDDLE = ["#{MINITEST_BASE_DIR}/test.rb:165:in `run_test_suites'", + "#{MINITEST_BASE_DIR}/test.rb:161:in `each'", + "#{MINITEST_BASE_DIR}/test.rb:161:in `run_test_suites'", + "#{MINITEST_BASE_DIR}/test.rb:158:in `each'", + "#{MINITEST_BASE_DIR}/test.rb:158:in `run_test_suites'", + "#{MINITEST_BASE_DIR}/test.rb:139:in `run'", + "#{MINITEST_BASE_DIR}/test.rb:106:in `run'"] def test_filter_backtrace # this is a semi-lame mix of relative paths. # I cheated by making the autotest parts not have ./ bt = (["lib/autotest.rb:571:in `add_exception'", "test/test_autotest.rb:62:in `test_add_exception'", - "./lib/mini/test.rb:165:in `__send__'"] + + "#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] + BT_MIDDLE + - ["./lib/mini/test.rb:29", + ["#{MINITEST_BASE_DIR}/test.rb:29", "test/test_autotest.rb:422"]) bt = util_expand_bt bt @@ -73,9 +76,9 @@ class TestMiniTest < MiniTest::Unit::TestCase end def test_filter_backtrace_unit_starts - bt = (["./lib/mini/test.rb:165:in `__send__'"] + + bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] + BT_MIDDLE + - ["./lib/mini/test.rb:29", + ["#{MINITEST_BASE_DIR}/mini/test.rb:29", "-e:1"]) bt = util_expand_bt bt