1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/mkmf.rb (Logging.log_close): separate from Logging.logfile.

* test/mkmf/base.rb (TestMkmf::MKMFLOG): show mkmf.log at failures.
* test/mkmf/base.rb (TestMkmf#teardown): close log file for each tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-12-10 09:11:10 +00:00
parent fe1f0df92b
commit b38cc52c13
5 changed files with 22 additions and 4 deletions

View file

@ -1,3 +1,11 @@
Fri Dec 10 18:11:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (Logging.log_close): separate from Logging.logfile.
* test/mkmf/base.rb (TestMkmf::MKMFLOG): show mkmf.log at failures.
* test/mkmf/base.rb (TestMkmf#teardown): close log file for each tests.
Fri Dec 10 11:36:43 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* compile.c (enum): remove a comma at end of enumerator list.

View file

@ -264,6 +264,10 @@ module Logging
def self::logfile file
@logfile = file
log_close
end
def self::log_close
if @log and not @log.closed?
@log.flush
@log.close

View file

@ -9,6 +9,11 @@ $INCFLAGS << " -I."
$extout_prefix = "$(extout)$(target_prefix)/"
class TestMkmf < Test::Unit::TestCase
MKMFLOG = proc {File.read("mkmf.log") rescue ""}
class << MKMFLOG
alias to_s call
end
def setup
@tmpdir = Dir.mktmpdir
@curdir = Dir.pwd
@ -19,6 +24,7 @@ class TestMkmf < Test::Unit::TestCase
def teardown
Logging.quiet = @quiet
Logging.log_close
Dir.chdir(@curdir)
FileUtils.rm_rf(@tmpdir)
end

View file

@ -6,7 +6,7 @@ class TestMkmf
["", ["signed ", ""], "unsigned "].each do |signed, prefix|
%w[short int long].each do |type|
assert_equal((prefix || signed)+type,
mkmf {convertible_int(signed+type)})
mkmf {convertible_int(signed+type)}, MKMFLOG)
end
end
end
@ -19,7 +19,7 @@ class TestMkmf
}
$defs.clear
assert_equal((prefix || signed)+type,
mkmf {convertible_int("test1_t", "confdefs.h")})
mkmf {convertible_int("test1_t", "confdefs.h")}, MKMFLOG)
(u = signed[/^u/]) and u.upcase!
assert_includes($defs, "-DTYPEOF_TEST1_T="+"#{prefix||signed}#{type}".quote)
assert_includes($defs, "-DPRI_TEST1T_PREFIX=PRI_#{type.upcase}_PREFIX")

View file

@ -4,7 +4,7 @@ class TestMkmf
class TestSizeof < TestMkmf
def test_sizeof_builtin
%w[char short int long float double void*].each do |type|
assert_kind_of(Integer, mkmf {check_sizeof(type)})
assert_kind_of(Integer, mkmf {check_sizeof(type)}, MKMFLOG)
end
end
@ -12,7 +12,7 @@ class TestMkmf
open("confdefs.h", "w") {|f|
f.puts "typedef struct {char x;} test1_t;"
}
assert_equal(1, mkmf {check_sizeof("test1_t", "confdefs.h")})
assert_equal(1, mkmf {check_sizeof("test1_t", "confdefs.h")}, MKMFLOG)
end
end
end