summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-28 16:29:04 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-28 16:29:04 +0000
commit0f9fa1ddab7674ec5b1d0549edca34c928ebe3e6 (patch)
treecdd642939f953e0f8488a4e9ab0b624c9afcbab3 /spec
parent1245a4a4fb0717f564112ab211e21f47dbe7abec (diff)
Revert r58939 and r58942
This reverts following commits because it breaks mswinci * Update to ruby/spec@2a047c8 * Update to ruby/spec@ca32ae2 see also the result: http://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20170528T140014Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r--spec/rubyspec/optional/capi/ext/jruby.h10
-rw-r--r--spec/rubyspec/optional/capi/ext/rubinius.h8
-rw-r--r--spec/rubyspec/optional/capi/ext/rubyspec.h15
-rw-r--r--spec/rubyspec/optional/capi/ext/truffleruby.h6
-rw-r--r--spec/rubyspec/optional/capi/spec_helper.rb11
5 files changed, 46 insertions, 4 deletions
diff --git a/spec/rubyspec/optional/capi/ext/jruby.h b/spec/rubyspec/optional/capi/ext/jruby.h
new file mode 100644
index 0000000000..00a9789f14
--- /dev/null
+++ b/spec/rubyspec/optional/capi/ext/jruby.h
@@ -0,0 +1,10 @@
+#ifndef RUBYSPEC_CAPI_JRUBY_H
+#define RUBYSPEC_CAPI_JRUBY_H
+
+/* #undef any HAVE_ defines that JRuby does not have. */
+#undef HAVE_RB_DEFINE_HOOKED_VARIABLE
+#undef HAVE_RB_DEFINE_VARIABLE
+
+#undef HAVE_RB_EXEC_RECURSIVE
+
+#endif
diff --git a/spec/rubyspec/optional/capi/ext/rubinius.h b/spec/rubyspec/optional/capi/ext/rubinius.h
new file mode 100644
index 0000000000..7ddf73790d
--- /dev/null
+++ b/spec/rubyspec/optional/capi/ext/rubinius.h
@@ -0,0 +1,8 @@
+#ifndef RUBYSPEC_CAPI_RUBINIUS_H
+#define RUBYSPEC_CAPI_RUBINIUS_H
+
+/* #undef any HAVE_ defines that Rubinius does not have. */
+#undef HAVE_RB_DEFINE_HOOKED_VARIABLE
+#undef HAVE_RB_DEFINE_VARIABLE
+
+#endif
diff --git a/spec/rubyspec/optional/capi/ext/rubyspec.h b/spec/rubyspec/optional/capi/ext/rubyspec.h
index 9cba34b888..aa0f4def19 100644
--- a/spec/rubyspec/optional/capi/ext/rubyspec.h
+++ b/spec/rubyspec/optional/capi/ext/rubyspec.h
@@ -595,4 +595,19 @@
/* Util */
#define HAVE_RB_SCAN_ARGS 1
+/* Now, create the differential set. The format of the preprocessor directives
+ * is significant. The alternative implementations should define RUBY because
+ * some extensions depend on that. But only one alternative implementation
+ * macro should be defined at a time. The conditional is structured so that if
+ * no alternative implementation is defined then MRI is assumed.
+ */
+
+#if defined(RUBINIUS)
+#include "rubinius.h"
+#elif defined(JRUBY)
+#include "jruby.h"
+#elif defined(TRUFFLERUBY)
+#include "truffleruby.h"
+#endif
+
#endif
diff --git a/spec/rubyspec/optional/capi/ext/truffleruby.h b/spec/rubyspec/optional/capi/ext/truffleruby.h
new file mode 100644
index 0000000000..99976a18a4
--- /dev/null
+++ b/spec/rubyspec/optional/capi/ext/truffleruby.h
@@ -0,0 +1,6 @@
+#ifndef RUBYSPEC_CAPI_TRUFFLERUBY_H
+#undef RUBYSPEC_CAPI_TRUFFLERUBY_H
+
+// All features are available
+
+#endif
diff --git a/spec/rubyspec/optional/capi/spec_helper.rb b/spec/rubyspec/optional/capi/spec_helper.rb
index 7242a134e7..7e043f80b5 100644
--- a/spec/rubyspec/optional/capi/spec_helper.rb
+++ b/spec/rubyspec/optional/capi/spec_helper.rb
@@ -22,20 +22,21 @@ def compile_extension(name)
end
ext = "#{name}_spec"
+ source = "#{extension_path}/#{ext}.c"
lib = "#{object_path}/#{ext}.#{RbConfig::CONFIG['DLEXT']}"
ruby_header = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h"
return lib if File.exist?(lib) and
- File.mtime(lib) > File.mtime("#{extension_path}/rubyspec.h") and
- File.mtime(lib) > File.mtime("#{extension_path}/#{ext}.c") and
+ File.mtime(lib) > File.mtime(source) and
File.mtime(lib) > File.mtime(ruby_header) and
+ File.mtime(lib) > File.mtime("#{extension_path}/rubyspec.h") and
true # sentinel
# Copy needed source files to tmpdir
tmpdir = tmp("cext_#{name}")
Dir.mkdir(tmpdir)
begin
- ["rubyspec.h", "#{ext}.c"].each do |file|
+ ["jruby.h", "rubinius.h", "truffleruby.h", "rubyspec.h", "#{ext}.c"].each do |file|
cp "#{extension_path}/#{file}", "#{tmpdir}/#{file}"
end
@@ -57,7 +58,9 @@ def compile_extension(name)
raise "make failed:\n#{output}" unless $?.success?
$stderr.puts output if debug
- cp File.basename(lib), lib
+ Dir.glob("*.#{RbConfig::CONFIG['DLEXT']}") do |file|
+ cp file, "#{object_path}/#{file}"
+ end
end
ensure
rm_r tmpdir