aboutsummaryrefslogtreecommitdiffstats
path: root/test/mkmf/test_flags.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-03 08:15:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-03 08:15:47 +0000
commitaf5b7053f17b61681b7c492800cc8bf347de1cdd (patch)
tree40bbedd3bfb68d3ec12820ddeac7b793a95fb905 /test/mkmf/test_flags.rb
parent26127361dd2100afe73bc5b2304735f82716ce3c (diff)
downloadruby-af5b7053f17b61681b7c492800cc8bf347de1cdd.tar.gz
mkmf.rb: avoid interference
* lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): get rid of interference by modifying global variables in have_devel? method. [ruby-core:67962] [Bug #10821] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/mkmf/test_flags.rb')
-rw-r--r--test/mkmf/test_flags.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/mkmf/test_flags.rb b/test/mkmf/test_flags.rb
index 3bb278071a..4e0d5f66a2 100644
--- a/test/mkmf/test_flags.rb
+++ b/test/mkmf/test_flags.rb
@@ -31,5 +31,26 @@ class TestMkmf
$warnflags = warnflags
$extmk = val
end
+
+ def test_try_ldflag_invalid_opt
+ assert_separately([], <<-'end;') #do
+ assert(!try_ldflags("----------"))
+ assert(have_devel?, TestMkmf::MKMFLOG)
+ end;
+ end
+
+ def test_try_cflag_invalid_opt
+ assert_separately([], <<-'end;') #do
+ assert(!try_cflags("----------"))
+ assert(have_devel?, TestMkmf::MKMFLOG)
+ end;
+ end
+
+ def test_try_cppflag_invalid_opt
+ assert_separately([], <<-'end;') #do
+ assert(!try_cppflags("----------"))
+ assert(have_devel?, TestMkmf::MKMFLOG)
+ end;
+ end
end
end