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

mkmf.rb: different strings from conflict markers

* lib/mkmf.rb (MakeMakefile#macro_defined?): use clearly different
  strings from conflict markers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-12-05 02:37:41 +00:00
parent 1d50afc2a2
commit 1692d49338
3 changed files with 41 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Wed Dec 5 11:37:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (MakeMakefile#macro_defined?): use clearly different
strings from conflict markers.
Wed Dec 5 04:25:00 2012 Zachary Scott <zachary@zacharyscott.net> Wed Dec 5 04:25:00 2012 Zachary Scott <zachary@zacharyscott.net>
* lib/README: Add rdoc modeline directive and formatting libs * lib/README: Add rdoc modeline directive and formatting libs

View file

@ -757,7 +757,7 @@ SRC
/*top*/ /*top*/
#ifndef #{macro} #ifndef #{macro}
# error # error
>>>>>> #{macro} undefined <<<<<< |:/ === #{macro} undefined === /:|
#endif #endif
SRC SRC
end end

View file

@ -0,0 +1,35 @@
require_relative 'base'
require 'tempfile'
class TestMkmf
class TestMacro < TestMkmf
MACRO_NAME = "RUBY_MKMFTEST_FOOBAR"
def test_have_macro_opt
assert_equal(true, have_macro(MACRO_NAME, nil, "-D#{MACRO_NAME}"), MKMFLOG)
end
def test_have_macro_header
Tempfile.open(%w"test_mkmf .h", ".") do |tmp|
tmp.puts("#undef #{MACRO_NAME}")
tmp.puts("#define #{MACRO_NAME} 1")
tmp.close
dir, base = File.split(tmp.path)
assert_equal(true, have_macro(MACRO_NAME, base, "-I."), MKMFLOG)
end
end
def test_not_have_macro_opt
assert_equal(false, have_macro(MACRO_NAME, nil, "-U#{MACRO_NAME}"), MKMFLOG)
end
def test_not_have_macro_header
Tempfile.open(%w"test_mkmf .h", ".") do |tmp|
tmp.puts("#undef #{MACRO_NAME}")
tmp.close
dir, base = File.split(tmp.path)
assert_equal(false, have_macro(MACRO_NAME, base, "-I."), MKMFLOG)
end
end
end
end