From 3a8d7bdf82dddb8d5e54330503d9ed11b4f68ad0 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Fri, 8 Jan 2021 20:32:08 +0900 Subject: Delay test code build until `rake test` With this change, the test code will not be built unless `rake test` is run, so there will be almost no side effects even if `enable_test` is always set (but, gems specified by `add_test_dependency` are included in `libmruby.a`). Also added are `test: build` task, which only builds the test code (including the main code), and `test: run` task, which only runs tests independent of build. Therefore, the idiom for building in parallel and not running tests in parallel is `rake -m test:build && rake test:run`. --- Rakefile | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 813486bf6..731977aa8 100644 --- a/Rakefile +++ b/Rakefile @@ -29,6 +29,7 @@ load "#{MRUBY_ROOT}/tasks/mrbgems.rake" load "#{MRUBY_ROOT}/tasks/libmruby.rake" load "#{MRUBY_ROOT}/tasks/bin.rake" load "#{MRUBY_ROOT}/tasks/presym.rake" +load "#{MRUBY_ROOT}/tasks/test.rake" load "#{MRUBY_ROOT}/tasks/benchmark.rake" load "#{MRUBY_ROOT}/tasks/gitlab.rake" load "#{MRUBY_ROOT}/tasks/doc.rake" @@ -51,37 +52,17 @@ end task :build => MRuby.targets.flat_map{|_, build| build.products} -desc "run all mruby tests" -task :test -MRuby.each_target do - if test_enabled? - t = :"test_#{self.name}" - task t => ["all"] do - run_test - end - task :test => t - end - - if bintest_enabled? - t = :"bintest_#{self.name}" - task t => ["all"] do - run_bintest - end - task :test => t - end -end - desc "clean all built and in-repo installed artifacts" task :clean do MRuby.each_target do |build| - rm_rf build.products rm_rf build.build_dir + rm_f build.products end puts "Cleaned up target build folder" end desc "clean everything!" -task :deep_clean => ["clean", "clean_doc"] do +task :deep_clean => %w[clean doc:clean] do MRuby.each_target do |build| rm_rf build.gem_clone_dir end -- cgit v1.2.3