| Age | Commit message (Collapse) | Author |
|
|
|
Because if the configuration file didn't contain any `conf.enable_test`, `rake test` would report an exception and exit.
```console
% cat my_config.rb
MRuby::Build.new { toolchain }
% rake MRUBY_CONFIG=my_config.rb test
...SNIP...
rake aborted!
NoMethodError: undefined method `invoke' for nil:NilClass
/var/tmp/mruby/tasks/test.rake:24:in `block (3 levels) in <top (required)>'
Tasks: TOP => test => test:build => test:build:lib
(See full trace by running task with --trace)
```
|
|
The cause is that `mrbgem.rake` of` mruby-test` gem is loaded when test
code is requested to be built, but when `mrbgem.rake` is loaded,
`MRuby::Gem.current` is updated, which is not thread safe.
Address this by not loading `mrbgem.rake` in parallel.
|
|
|
|
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`.
|