diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-01-08 21:14:19 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-08 21:14:19 +0900 |
| commit | 6587269af8800831f2175ae04ca738328b9b1308 (patch) | |
| tree | 3388c53575e1e772ac142d0c746464763ed71963 /tasks/test.rake | |
| parent | a0c1e075e35c358d21934c28ff1bec4153502409 (diff) | |
| parent | 3a8d7bdf82dddb8d5e54330503d9ed11b4f68ad0 (diff) | |
| download | mruby-6587269af8800831f2175ae04ca738328b9b1308.tar.gz mruby-6587269af8800831f2175ae04ca738328b9b1308.zip | |
Merge pull request #5267 from shuujii/delay-test-code-build-until-rake-test
Delay test code build until `rake test`
Diffstat (limited to 'tasks/test.rake')
| -rw-r--r-- | tasks/test.rake | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tasks/test.rake b/tasks/test.rake new file mode 100644 index 000000000..80f7670af --- /dev/null +++ b/tasks/test.rake @@ -0,0 +1,64 @@ +desc "build and run all mruby tests" +task :test => "test:build" do + Rake::Task["test:run"].invoke +end + +namespace :test do |test_ns| + desc "build and run library tests" + task :lib => "build:lib" do + test_ns["run:lib"].invoke + end + + desc "build and run command binaries tests" + task :bin => :all do + test_ns["run:bin"].invoke + end + + desc "build all mruby tests" + task :build => "build:lib" + + namespace :build do + desc "build library tests" + task :lib + end + + desc "run all mruby tests" + task :run + + namespace :run do + desc "run library tests" + task :lib + + desc "run command binaries tests" + task :bin + end +end + +MRuby.each_target do |build| + if build.test_enabled? + t = task "test:build:lib:#{build.name}" => :all do + gem = build.gem(core: 'mruby-test') + gem.setup + gem.setup_compilers + Rake::Task[build.define_installer_if_needed("mrbtest")].invoke + end + task "test:build:lib" => t + + t = task "test:run:lib:#{build.name}" do + build.run_test + end + task "test:run" => t + task "test:run:lib" => t + end + if build.bintest_enabled? + t = task "test:run:bin:#{build.name}" do + build.run_bintest + end + task "test:run" => t + task "test:run:bin" => t + end +end + +task :clean do + rm_f "#{MRuby::Build.install_dir}/mrbtest" +end |
