summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/!Nothing_to_test.rb5
-rw-r--r--test/lib/jit_support.rb8
2 files changed, 13 insertions, 0 deletions
diff --git a/test/lib/!Nothing_to_test.rb b/test/lib/!Nothing_to_test.rb
new file mode 100644
index 0000000000..c1f4c439d3
--- /dev/null
+++ b/test/lib/!Nothing_to_test.rb
@@ -0,0 +1,5 @@
+### Empty test file for chkbuild ###
+
+# If chkbuild fails with `test-all`, each child file/directory is
+# executed individually, but test-unit fails if there are no test
+# files in the specified directory.
diff --git a/test/lib/jit_support.rb b/test/lib/jit_support.rb
index 3f21367987..cf3baaaeb7 100644
--- a/test/lib/jit_support.rb
+++ b/test/lib/jit_support.rb
@@ -9,6 +9,10 @@ module JITSupport
@yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT'])
end
+ def yjit_enabled?
+ defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled?
+ end
+
def yjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/)
end
@@ -19,6 +23,10 @@ module JITSupport
@rjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['RJIT_SUPPORT'])
end
+ def rjit_enabled?
+ defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?
+ end
+
def rjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?RJIT_FORCE_ENABLE\b/)
end