diff options
| author | Akira Yumiyama <[email protected]> | 2013-01-30 15:20:41 +0900 |
|---|---|---|
| committer | Akira Yumiyama <[email protected]> | 2013-01-30 15:20:41 +0900 |
| commit | aadcbb1690f372f2a97f561e93e29c0e2d09dd54 (patch) | |
| tree | f0a776c6395177697944107484253dbeeeab11d4 /run_test.rb | |
| parent | 0786e37ed6626e0c6cf98af247211c9888510ade (diff) | |
| download | mruby-aadcbb1690f372f2a97f561e93e29c0e2d09dd54.tar.gz mruby-aadcbb1690f372f2a97f561e93e29c0e2d09dd54.zip | |
add mrbgem test runner
Diffstat (limited to 'run_test.rb')
| -rw-r--r-- | run_test.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/run_test.rb b/run_test.rb new file mode 100644 index 000000000..7be23b4d3 --- /dev/null +++ b/run_test.rb @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +# +# mrbgems test runner +# + +DEPEND_GEMS = [] +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 + if ARGV.first && ARGV.first.include?('iij') + repository, dir = 'https://github.com/iij/mruby.git', 'tmp/iij-mruby' + build_args = ARGV[1, ARGV.size] + end + 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 File.expand_path(File.dirname(__FILE__)) + DEPEND_GEMS.each do |g| + conf.gem g + end +end |
