summaryrefslogtreecommitdiffhomepage
path: root/run_test.rb
diff options
context:
space:
mode:
authorAkira Yumiyama <[email protected]>2013-04-01 09:12:01 +0900
committerAkira Yumiyama <[email protected]>2013-04-01 09:12:01 +0900
commite8ca5e516983fe720ec46887744f0d21b8f16ce1 (patch)
treee2c5dc2aab35cab78365f45918f140d82dcb45dd /run_test.rb
downloadmruby-e8ca5e516983fe720ec46887744f0d21b8f16ce1.tar.gz
mruby-e8ca5e516983fe720ec46887744f0d21b8f16ce1.zip
initial commit
Diffstat (limited to 'run_test.rb')
-rw-r--r--run_test.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/run_test.rb b/run_test.rb
new file mode 100644
index 000000000..e83b504be
--- /dev/null
+++ b/run_test.rb
@@ -0,0 +1,33 @@
+#!/usr/bin/env ruby
+#
+# mrbgems test runner
+#
+
+gemname = File.basename(File.dirname(File.expand_path __FILE__))
+
+if __FILE__ == $0
+ repository, dir = 'https://github.com/mruby/mruby.git', 'tmp/mruby'
+ build_args = ARGV
+ build_args = ['all', 'test'] if build_args.nil? or build_args.empty?
+
+ Dir.mkdir 'tmp' unless File.exist?('tmp')
+ unless File.exist?(dir)
+ system "git clone #{repository} #{dir}"
+ end
+
+ exit system(%Q[cd #{dir}; MRUBY_CONFIG=#{File.expand_path __FILE__} ruby minirake #{build_args.join(' ')}])
+end
+
+MRuby::Build.new do |conf|
+ toolchain :gcc
+ conf.gems.clear
+
+ conf.gem "#{root}/mrbgems/mruby-sprintf"
+ conf.gem "#{root}/mrbgems/mruby-print"
+
+ Dir.glob("#{root}/mrbgems/mruby-*") do |x|
+ conf.gem x unless x =~ /\/mruby-(print|sprintf)$/
+ end
+
+ conf.gem File.expand_path(File.dirname(__FILE__))
+end