From fcbf63e62c627deae76c1b8cb8c0876c536ed811 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 16 Mar 2020 18:49:26 +0900 Subject: Fresh start --- jni/ruby/spec/README | 31 +++++++++++++++++++++++++++++++ jni/ruby/spec/default.mspec | 21 +++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 jni/ruby/spec/README create mode 100644 jni/ruby/spec/default.mspec (limited to 'jni/ruby/spec') diff --git a/jni/ruby/spec/README b/jni/ruby/spec/README new file mode 100644 index 0000000..9821404 --- /dev/null +++ b/jni/ruby/spec/README @@ -0,0 +1,31 @@ += RubySpec + +RubySpec (http://rubyspec.org) provides the annotation of the Ruby +implementation in an executable format. The make task +`update-rubyspec' retrieves the specification and puts it into this +directory. + +== Directory structure + spec + +-- mspec driver library for executing the specification. + +-- rubyspec + +-- core specification for core libraries + | +-- array + | +-- bignum + | +-- ... + | + +-- fixtures example classes for writing specs + +-- language specification for Ruby language itself + +-- library specification for standard libraries + +-- addrev + +-- ... + +== How to run +:make target + verifies all specs. + $ make test-rubyspec +:mspec command + verifies the specified spec. + $ mspec {language|core|library} + or + $ mspec spec/path/to/some_spec.rb diff --git a/jni/ruby/spec/default.mspec b/jni/ruby/spec/default.mspec new file mode 100644 index 0000000..47f5dd1 --- /dev/null +++ b/jni/ruby/spec/default.mspec @@ -0,0 +1,21 @@ +load File.dirname(__FILE__) + '/rubyspec/default.mspec' +class MSpecScript + builddir = Dir.pwd + srcdir = ENV['SRCDIR'] + if !srcdir and File.exist?("#{builddir}/Makefile") then + File.open("#{builddir}/Makefile", "r:US-ASCII") {|f| + f.read[/^\s*srcdir\s*=\s*(.+)/i] and srcdir = $1 + } + end + config = proc{|name| `#{builddir}/miniruby -I#{srcdir} -r#{builddir}/rbconfig -e 'print RbConfig::CONFIG["#{name}"]'`} + + # The default implementation to run the specs. + set :target, File.join(builddir, "miniruby#{config['exeext']}") + set :prefix, File.expand_path('rubyspec', File.dirname(__FILE__)) + set :flags, %W[ + -I#{File.expand_path srcdir}/lib + -I#{File.expand_path srcdir}/#{config['EXTOUT']}/common + -I#{File.expand_path srcdir}/- + #{File.expand_path srcdir}/tool/runruby.rb --archdir=#{Dir.pwd} --extout=#{config['EXTOUT']} + ] +end -- cgit v1.2.3