Skip to content

Commit

Permalink
Simplify setup by updating mspec, using a mrbgem and a MSpec config file
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Sep 16, 2016
1 parent 2553f66 commit dddb83a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
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
.PHONY: build

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
Expand Down
3 changes: 2 additions & 1 deletion build_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions mruby-mspec-support/mrbgem.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MRuby::Gem::Specification.new('mruby-mspec-support') do |spec|
spec.license = 'MIT'
spec.author = 'mruby-spec developers'
end
14 changes: 3 additions & 11 deletions todo/rbconfig.rb → ...pec-support/mrblib/mruby-mspec-support.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
13 changes: 13 additions & 0 deletions mruby.mspec
Original file line number Diff line number Diff line change
@@ -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
Empty file removed todo/iconv.rb
Empty file.
Empty file removed todo/pp.rb
Empty file.

0 comments on commit dddb83a

Please sign in to comment.