summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-test
AgeCommit message (Collapse)Author
2021-02-14Add `-s` option to `mrbc` for make variable staticKOBAYASHI Shuji
2021-02-07Enlarge tolerance limit for `float32`; close #5329Yukihiro "Matz" Matsumoto
Along with some refactoring on `mruby-math` tests.
2021-01-08Delay test code build until `rake test`KOBAYASHI Shuji
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`.
2020-12-19feat(CI): add a GitHub Action to lint the MarkdownJohn Bampton
Run on pull request only Using https://www.npmjs.com/package/markdownlint-cli Lint Markdown for rules: - MD009/no-trailing-spaces - MD012/no-multiple-blanks - MD022/blanks-around-headings - MD031/blanks-around-fences - MD032/blanks-around-lists
2020-12-15refactor: remove trailing whitespace from C, Header, Ruby and YAML filesJohn Bampton
Lint
2020-11-22Refine build log for generated filesKOBAYASHI Shuji
* Output `GEN` log for generated files * `MRBC` log is outputted one for each `mrbc` execution #### Before this patch: ```console CC src/array.c -> build/host/src/array.o (snip) GEN mrblib/*.rb -> build/host/mrblib/mrblib.c MRBC mrblib/00class.rb MRBC mrblib/10error.rb (snip) CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o MRBC mrbgems/mruby-time/mrblib/time.rb (snip) CC mrbgems/mruby-socket/test/sockettest.c -> build/host/mrbgems/mruby-socket/test/sockettest.o MRBC mrbgems/mruby-socket/test/addrinfo.rb MRBC mrbgems/mruby-socket/test/basicsocket.rb (snip) ``` #### After this patch: ```console GEN build/presym GEN build/presym.inc CC src/array.c -> build/host/src/array.o (snip) GEN mrblib/*.rb -> build/host/mrblib/mrblib.c MRBC mrblib/00class.rb mrblib/10error.rb (snip) CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o GEN build/host/mrbgems/mruby-time/gem_init.c MRBC mrbgems/mruby-time/mrblib/time.rb (snip) CC mrbgems/mruby-socket/test/sockettest.c -> build/host/mrbgems/mruby-socket/test/sockettest.o GEN build/host/mrbgems/mruby-socket/gem_test.c MRBC mrbgems/mruby-socket/test/addrinfo.rb MRBC mrbgems/mruby-socket/test/basicsocket.rb (snip) ```
2020-11-03Use C99 `__func__` instead of `__FUNCTION__`; #5107Yukihiro "Matz" Matsumoto
2020-10-22Prohibit array changes by "a"/"*" specifier of `mrb_get_args()`dearblue
The "a"/"*" specifier of the `mrb_get_args()` function will now return `const mrb_value *`. This is because it is difficult for the caller to check if it is an array object and write-barrier if necessary. And it requires calling `mrb_ary_modify()` on the unmodified array object, which is also difficult (this is similar to #5087).
2020-10-14Avoid using C struct dump for test Ruby code.Yukihiro "Matz" Matsumoto
Files under `test/t` and `mrbgem/*/test` are for tests, not for actual execution. So symbols in those files need not to be pre-allocated. This change slightly reduce the memory consumption.
2020-10-12Use `mrb_int_value()` instead of `mrb_fixnum_value()`.Yukihiro "Matz" Matsumoto
Where fixnum overflow can happen.
2020-10-12Reorganize `Integer` system.Yukihiro "Matz" Matsumoto
- Integrate `Fixnum` and `Integer` - Remove `Integral` - `int / int -> int` - Replace `mrb_fixnum()` to `mrb_int()` - Replace `mrb_fixnum_value()` to `mrb_int_value()`. - Use `mrb_integer_p()` instead of `mrb_fixnum_p()`
2020-10-12Rename float configuration option names.Yukihiro "Matz" Matsumoto
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general.
2020-10-12Generate C struct from `irep` instead of binary dump.Yukihiro "Matz" Matsumoto
2020-07-14Fix `${build_dir}/mrbgems/gem_init.c` generation condition; ref #5010KOBAYASHI Shuji
The `${build_dir}/mrbgems/gem_init.c` generation condition has been changed at #5010, but it is somewhat insufficient, for example, there was a problem with `rake && rake test`, which was also regenerated in `rake test`.
2020-06-09Need `build/XXX/mrbgems/mruby-test` directorydearblue
An error may occur when performing `rake clean all` or `rake clean test`. The directory is needed before writing to `mrbgems/mruby-test/assert.c`.
2020-01-01Fixed wrong usages of `mrb_get_args` in `vformat.c`.Yukihiro "Matz" Matsumoto
2019-12-29Avoid unneeded directory creation during `rake -T`, etc.KOBAYASHI Shuji
2019-12-27Use Rake DSL instead of commands of `FileUtils`KOBAYASHI Shuji
- Respect `--verbose(-v)` and `--dry-run(-n)` options. - Silence warnings to keyword arguments on Ruby 2.7.
2019-12-19Fix mixed declarations in 429f6deYukihiro "Matz" Matsumoto
2019-12-19Reimplement `vformat` tests; close #4868Yukihiro "Matz" Matsumoto
Avoid creating `Data` object that refers `mruby` objects. Also close #4622 ref #4613
2019-12-19Revert "`%C` value need not to be saved in `TestVFormat::Native`; close #4868"Yukihiro "Matz" Matsumoto
This reverts commit f507ff4842b92a60c0c600fa1f29efdf2688c877. It makes AppVeyor tests fail.
2019-12-18`%C` value need not to be saved in `TestVFormat::Native`; close #4868Yukihiro "Matz" Matsumoto
2019-08-07Reorganize `mrb_string_value_cstr` and related functions.Yukihiro "Matz" Matsumoto
`mrb_string_value_cstr` and `mrb_string_value_len`: obsolete `mrb_string_cstr`: new function to retrieve NULL terminated C string `RSTRING_CSTR`: wrapper macro of `mrb_string_cstr`
2019-08-03Change second argument to `%l` of `mrb_vformat()` to `size_t` from `mrb_int`KOBAYASHI Shuji
- `size_t` is more commonly used. - `len` argument of `mrb_str_new()` is `size_t`. NOTE: The test for `%l` is temporarily disabled because adding a new type to `mrbgems/mruby-test/vformat.c` causes an error (memory error?) on Visual Studio 2017 in AppVeyor.
2019-08-03Fix `mrb_vformat("%f")` with `MRB_USE_FLOAT`KOBAYASHI Shuji
It potentially not work when `mrb_float` is `float` because `float` variable in variable length arguments is promoted to `double`. Also I fixed build with `MRB_WITHOUT_FLOAT`.
2019-08-02Change the `mrb_vformat` specifier `%d` for `int`KOBAYASHI Shuji
It potentially breaks, for example, in the case of `mrb_int` is 64-bit and more smaller type is passed by `%d`. In fact, the problem could become apparent when I used `%d` to `backtrace_location::lineno` in `src/backtrace.c:mrb_unpack_backtrace()` on AppVeyor. Therefore, change `%d` for `int` (not `mrb_int`) so that it can be used mostly without casting.
2019-08-01Add new specifiers/modifiers to format string of `mrb_vfromat()`KOBAYASHI Shuji
Format sequence syntax: %[modifier]specifier Modifiers: ----------+------------------------------------------------------------ Modifier | Meaning ----------+------------------------------------------------------------ ! | Convert to string by corresponding `inspect` instead of | corresponding `to_s`. ----------+------------------------------------------------------------ Specifiers: ----------+----------------+-------------------------------------------- Specifier | Argument Type | Note ----------+----------------+-------------------------------------------- c | char | d,i | mrb_int | f | mrb_float | l | char*, mrb_int | Arguments are string and length. n | mrb_sym | s | char* | Argument is NUL terminated string. t | mrb_value | Convert to type (class) of object. v,S | mrb_value | C | struct RClass* | T | mrb_value | Convert to real type (class) of object. Y | mrb_value | Same as `!v` if argument is `true`, `false` | | or `nil`, otherwise same as `T`. % | - | Convert to percent sign itself (no argument | | taken). ----------+----------------+-------------------------------------------- This change will increase the binary size, but replacing all format strings with new specifiers/modifiers will decrease the size because it reduces inline expansion of `mrb_obj_value()`, etc. at the caller.
2019-07-29Resolved conflicts in #4320Yukihiro "Matz" Matsumoto
2019-04-22Merge pull request #4356 from shuujii/add-assert_match-and-assert_not_matchYukihiro "Matz" Matsumoto
Add `assert_match` and `assert_not_match`
2019-04-14Add `assert_match` and `assert_not_match`KOBAYASHI Shuji
2019-04-10Fixed old style declaration; ref #4365Yukihiro "Matz" Matsumoto
2019-03-23Refactor `t_print` for testKOBAYASHI Shuji
2019-03-13Do not raise an exception when bintest failKOBAYASHI Shuji
- An exception do not raise when mrbtest fail. - There are no useful informations in exception message and backtrace.
2019-03-07Add a missing file for #4314KOBAYASHI Shuji
2019-02-22Integrate `init_mrbtest.c` to `driver.c` in `mruby-test` mrbgemKOBAYASHI Shuji
- `mrbgemtest_init()` is needed if `DISABLE_GEMS` is enabled because core tests are run as part of `mruby-test` mrbgem (moreover, `DISABLE_GEMS` is disabled when `enable_test` is used in build config). - For the same reason `mrb_open_core()` etc for core tests is unneeded.
2019-01-16Remove special treatments for `MRB_WITHOUT_FLOAT` in build scriptsKOBAYASHI Shuji
2018-10-29Merge pull request #4148 from take-cheeze/rename_libmruby_stuffYukihiro "Matz" Matsumoto
Rename `MRuby::Build#libmruby` stuff to avoid confusion
2018-10-29Rename libmruby stuff to avoid confusiontake-cheeze
2018-10-29Add missing dependency of source code generatortake-cheeze
2018-07-08Fix task name is not necessarily a valid pathSebastián Katzer
Errno::ENOENT: No such file or directory @ dir_s_mkdir - mruby:Z:/Documents
2018-06-20Make codacy happy.take-cheeze
2018-06-20Fix dependencies.take-cheeze
2018-06-20Comment out unused variable.take-cheeze
2018-06-20Fix forgotten argument passing.take-cheeze
2018-06-20Fix dependencies.take-cheeze
2018-06-13Fix unnecessary rebuild of tests.take-cheeze
2018-03-05Close `mrb_state` before exit.Takeshi Watanabe
2018-03-05Close on exception too.Takeshi Watanabe
2017-11-04Merge branch 'master' of github.com:mruby/mrubyYAMAMOTO Masaya
2017-10-28Flush stdout after every print from testsYukihiro "Matz" Matsumoto