diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-07-08 16:56:32 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-07-08 18:18:35 +0900 |
commit | 524513be399e81bb170ec88aa0d501f33cbde8c3 (patch) | |
tree | 3fc823c15917e56fd3e568423368635ccbc7fd43 /test/mkmf | |
parent | d6cf4c0c997752c9e23876a8d5c205737317a6e3 (diff) | |
download | ruby-524513be399e81bb170ec88aa0d501f33cbde8c3.tar.gz |
mkmf.rb: try linking at try_var
To check for variables accessible but not declared.
Diffstat (limited to 'test/mkmf')
-rw-r--r-- | test/mkmf/test_have_var.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/mkmf/test_have_var.rb b/test/mkmf/test_have_var.rb new file mode 100644 index 0000000000..5367ec2248 --- /dev/null +++ b/test/mkmf/test_have_var.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: false +require_relative 'base' +require 'tempfile' + +class TestMkmf + class TestHaveVar < TestMkmf + def test_have_var + assert_equal(true, have_var("ruby_version"), MKMFLOG) + assert_include($defs, '-DHAVE_RUBY_VERSION') + end + + def test_not_have_var + assert_equal(false, have_var("rb_vm_something_flag"), MKMFLOG) + assert_not_include($defs, '-DHAVE_RB_VM_SOMETHING_FLAG') + end + end +end |