From dddb83ab4cf3f8a74ddf3d81a598fa15a01bc917 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 16 Sep 2016 13:13:10 +0200 Subject: [PATCH] Simplify setup by updating mspec, using a mrbgem and a MSpec config file --- Makefile | 6 +----- build_config.rb | 3 ++- mruby-mspec-support/mrbgem.rake | 4 ++++ .../mrblib/mruby-mspec-support.rb | 14 +++----------- mruby.mspec | 13 +++++++++++++ todo/iconv.rb | 0 todo/pp.rb | 0 7 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 mruby-mspec-support/mrbgem.rake rename todo/rbconfig.rb => mruby-mspec-support/mrblib/mruby-mspec-support.rb (71%) create mode 100644 mruby.mspec delete mode 100644 todo/iconv.rb delete mode 100644 todo/pp.rb diff --git a/Makefile b/Makefile index 1943970..11d21b8 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,5 @@ run: compile - cp todo/rbconfig.rb mruby/build/host/lib - cp todo/iconv.rb mruby/build/host/lib - cp todo/pp.rb mruby/build/host/lib - mruby/bin/mruby mspec/bin/mspec-run spec/$(TESTS) + mruby/bin/mruby mspec/bin/mspec -B mruby.mspec $(TESTS) .PHONY: run build: mruby spec mspec @@ -10,7 +7,6 @@ build: mruby spec mspec mruby: git clone --depth 1 https://github.com/mruby/mruby.git - sed -i -e 's|//#define MRB_INT64|#define MRB_INT64|' mruby/include/mrbconf.h spec: git clone --depth 1 https://github.com/ruby/spec.git diff --git a/build_config.rb b/build_config.rb index 284eb7a..136c44d 100644 --- a/build_config.rb +++ b/build_config.rb @@ -22,7 +22,8 @@ conf.gem :mgem => "mruby-onig-regexp" conf.gem :mgem => "mruby-method" conf.gem :mgem => "mruby-catch-throw" - conf.gem :github => "kou/mruby-pp" + conf.gem :github => 'haconiwa/mruby-exec' + conf.gem 'mruby-mspec-support' # You can add gem what you want to testing # conf.gem :mgem => "your-gem" conf.gem :github => "ksss/mruby-require", :branch => "mspec" diff --git a/mruby-mspec-support/mrbgem.rake b/mruby-mspec-support/mrbgem.rake new file mode 100644 index 0000000..5a78a0e --- /dev/null +++ b/mruby-mspec-support/mrbgem.rake @@ -0,0 +1,4 @@ +MRuby::Gem::Specification.new('mruby-mspec-support') do |spec| + spec.license = 'MIT' + spec.author = 'mruby-spec developers' +end diff --git a/todo/rbconfig.rb b/mruby-mspec-support/mrblib/mruby-mspec-support.rb similarity index 71% rename from todo/rbconfig.rb rename to mruby-mspec-support/mrblib/mruby-mspec-support.rb index 6aa04c9..e650a86 100644 --- a/todo/rbconfig.rb +++ b/mruby-mspec-support/mrblib/mruby-mspec-support.rb @@ -1,11 +1,6 @@ -# This file is missing collection by mruby +# Define functionality needed by mspec and missing from MRuby -module RbConfig - CONFIG = { - "RUBY_INSTALL_NAME" => "mruby", - "bindir" => "mruby/bin", - } -end +RUBY_PLATFORM = "mruby" class File Separator = SEPARATOR @@ -43,16 +38,13 @@ class << self class SystemExit < Exception end -RUBY_PLATFORM = "" -RUBY_PATCHLEVEL = 0 -$: << File.dirname(File.dirname(File.dirname(File.dirname(File.dirname(__FILE__))))) - module Kernel def abort(message) $stderr.puts message raise SystemExit end end + class Module alias private_instance_methods instance_methods end diff --git a/mruby.mspec b/mruby.mspec new file mode 100644 index 0000000..f2d30fc --- /dev/null +++ b/mruby.mspec @@ -0,0 +1,13 @@ +class MSpecScript + set :target, File.expand_path("mruby/bin/mruby", File.dirname(__FILE__)) + + set :prefix, 'spec' + + # Features + MSpec.disable_feature :fiber + MSpec.disable_feature :fiber_library + MSpec.disable_feature :continuation_library + MSpec.disable_feature :fork + MSpec.disable_feature :encoding + MSpec.disable_feature :readline +end diff --git a/todo/iconv.rb b/todo/iconv.rb deleted file mode 100644 index e69de29..0000000 diff --git a/todo/pp.rb b/todo/pp.rb deleted file mode 100644 index e69de29..0000000