diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-02-10 09:50:32 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-02-10 09:50:32 +0900 |
| commit | d7960bf2a92bf27cfce3d8871e44eb87d7ce55b3 (patch) | |
| tree | 1781c0e7624aae34ddf3609e94dc2e48eea30d8e | |
| parent | 5519bd69bcd8b5c91b546d397371a42db796bf27 (diff) | |
| parent | 05fb139d28c2814b2b19a65d0f83c72bc1644777 (diff) | |
| download | mruby-d7960bf2a92bf27cfce3d8871e44eb87d7ce55b3.tar.gz mruby-d7960bf2a92bf27cfce3d8871e44eb87d7ce55b3.zip | |
resolve conflict in travis_config.rb
| -rw-r--r-- | build_config.rb | 3 | ||||
| -rw-r--r-- | mrbgems/mruby-bin-mirb/bintest/mirb.rb | 12 | ||||
| -rw-r--r-- | mrbgems/mruby-bin-mruby/bintest/mruby.rb | 13 | ||||
| -rw-r--r-- | tasks/mruby_build.rake | 9 | ||||
| -rw-r--r-- | test/assert.rb | 5 | ||||
| -rw-r--r-- | test/bintest.rb | 8 | ||||
| -rw-r--r-- | travis_config.rb | 3 |
7 files changed, 48 insertions, 5 deletions
diff --git a/build_config.rb b/build_config.rb index 85d94df14..e8d07769d 100644 --- a/build_config.rb +++ b/build_config.rb @@ -78,6 +78,9 @@ MRuby::Build.new do |conf| # file separetor # conf.file_separator = '/' + + # bintest + # conf.enable_bintest = true end # Define cross build settings diff --git a/mrbgems/mruby-bin-mirb/bintest/mirb.rb b/mrbgems/mruby-bin-mirb/bintest/mirb.rb new file mode 100644 index 000000000..ed53321bd --- /dev/null +++ b/mrbgems/mruby-bin-mirb/bintest/mirb.rb @@ -0,0 +1,12 @@ +require 'open3' + +assert('mirb normal operations') do + o, s = Open3.capture2('bin/mirb', :stdin_data => "a=1\nb=2\na+b\n") + assert_true o.include?('=> 3') + assert_true o.include?('=> 2') +end + +assert('regression for #1563') do + o, s = Open3.capture2('bin/mirb', :stdin_data => "a=1;b=2;c=3\nb\nc") + assert_true o.include?('=> 3') +end diff --git a/mrbgems/mruby-bin-mruby/bintest/mruby.rb b/mrbgems/mruby-bin-mruby/bintest/mruby.rb new file mode 100644 index 000000000..2eb41d758 --- /dev/null +++ b/mrbgems/mruby-bin-mruby/bintest/mruby.rb @@ -0,0 +1,13 @@ +assert('regression for #1564') do + o = `bin/mruby -e '<<' 2>&1` + assert_equal o, "-e:1:2: syntax error, unexpected tLSHFT\n" + o = `bin/mruby -e '<<-' 2>&1` + assert_equal o, "-e:1:3: syntax error, unexpected tLSHFT\n" +end + +assert('regression for #1572') do + system "echo 'p \"ok\"' > /tmp/1572.rb" + system "bin/mrbc -g -o /tmp/1572.mrb /tmp/1572.rb" + o = `bin/mruby -b /tmp/1572.mrb`.strip + assert_equal o, '"ok"' +end diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index 8f5881f3b..c92400cf9 100644 --- a/tasks/mruby_build.rake +++ b/tasks/mruby_build.rake @@ -43,7 +43,7 @@ module MRuby end include Rake::DSL include LoadGems - attr_accessor :name, :bins, :exts, :file_separator, :build_dir, :gem_clone_dir + attr_accessor :name, :bins, :exts, :file_separator, :build_dir, :gem_clone_dir, :enable_bintest attr_reader :libmruby, :gems COMPILERS = %w(cc cxx objc asm) @@ -175,7 +175,12 @@ module MRuby puts ">>> Test #{name} <<<" mrbtest = exefile("#{build_dir}/test/mrbtest") sh "#{filename mrbtest.relative_path}#{$verbose ? ' -v' : ''}" - puts + puts + run_bintest if @enable_bintest + end + + def run_bintest + sh "ruby test/bintest.rb" end def print_build_summary diff --git a/test/assert.rb b/test/assert.rb index 3d35fc267..d2d865649 100644 --- a/test/assert.rb +++ b/test/assert.rb @@ -9,10 +9,11 @@ def t_print(*args) i = 0 len = args.size while i < len + str = args[i].to_s begin - __printstr__ args[i].to_s + __printstr__ str rescue NoMethodError - __t_printstr__ args[i].to_s + __t_printstr__ str rescue print str end i += 1 end diff --git a/test/bintest.rb b/test/bintest.rb new file mode 100644 index 000000000..e9dbb285e --- /dev/null +++ b/test/bintest.rb @@ -0,0 +1,8 @@ +$:.unshift File.dirname(File.dirname(File.expand_path(__FILE__))) +require 'test/assert.rb' + +Dir['mrbgems/**/bintest/*.rb'].each do |file| + load file +end + +load 'test/report.rb' diff --git a/travis_config.rb b/travis_config.rb index 4fad04797..6f406ae37 100644 --- a/travis_config.rb +++ b/travis_config.rb @@ -12,5 +12,6 @@ MRuby::Build.new do |conf| # include all core GEMs conf.gembox 'full-core' - conf.cc.defines += %w(MRB_GC_FIXED_ARENA) + conf.cc.defines = %w(MRB_DEBUG MRB_GC_FIXED_ARENA) + conf.enable_bintest = true end |
