| 1 |
desc "build and run all mruby tests" |
| 2 |
task :test => "test:build" do |
| 3 |
Rake::Task["test:run"].invoke |
| 4 |
end |
| 5 |
|
| 6 |
namespace :test do |test_ns| |
| 7 |
desc "build and run library tests" |
| 8 |
task :lib => "build:lib" do |
| 9 |
test_ns["run:lib"].invoke |
| 10 |
end |
| 11 |
|
| 12 |
desc "build and run command binaries tests" |
| 13 |
task :bin => "rake:all" do |
| 14 |
test_ns["run:bin"].invoke |
| 15 |
end |
| 16 |
|
| 17 |
desc "build all mruby tests" |
| 18 |
task :build => "build:lib" |
| 19 |
|
| 20 |
namespace :build do |test_build_ns| |
| 21 |
desc "build library tests" |
| 22 |
task :lib => "rake:all" do |
| 23 |
MRuby.each_target{|build| build.gem(core: 'mruby-test')} |
| 24 |
test = test_build_ns["lib_without_loading_gem"] |
| 25 |
test.invoke if test |
| 26 |
end |
| 27 |
end |
| 28 |
|
| 29 |
desc "run all mruby tests" |
| 30 |
task :run |
| 31 |
|
| 32 |
namespace :run do |
| 33 |
desc "run library tests" |
| 34 |
task :lib |
| 35 |
|
| 36 |
desc "run command binaries tests" |
| 37 |
task :bin |
| 38 |
end |
| 39 |
end |
| 40 |
|
| 41 |
MRuby.each_target do |build| |
| 42 |
if build.test_enabled? |
| 43 |
t = task "test:build:lib_without_loading_gem:#{build.name}" do |
| 44 |
gem = build.gems["mruby-test"] |
| 45 |
gem.setup |
| 46 |
gem.setup_compilers |
| 47 |
Rake::Task[build.define_installer_if_needed("mrbtest")].invoke |
| 48 |
end |
| 49 |
task "test:build:lib_without_loading_gem" => t |
| 50 |
|
| 51 |
t = task "test:run:lib:#{build.name}" do |
| 52 |
build.run_test |
| 53 |
end |
| 54 |
task "test:run" => t |
| 55 |
task "test:run:lib" => t |
| 56 |
end |
| 57 |
if build.bintest_enabled? |
| 58 |
t = task "test:run:bin:#{build.name}" do |
| 59 |
build.run_bintest |
| 60 |
end |
| 61 |
task "test:run" => t |
| 62 |
task "test:run:bin" => t |
| 63 |
end |
| 64 |
end |
| 65 |
|
| 66 |
task :clean do |
| 67 |
host = MRuby.targets["host"] |
| 68 |
rm_f host.exefile("#{host.class.install_dir}/mrbtest") if host && host.test_enabled? |
| 69 |
end |