Commit graph

33 commits

Author SHA1 Message Date
Nobuyoshi Nakada
3839a8fe79
Narrow the tracing of object allocations to during each test 2021-06-27 21:13:51 +09:00
Nobuyoshi Nakada
fb978fab6d
Tests for MiniTest define anonymous test cases 2021-06-24 20:39:52 +09:00
Hiroshi SHIBATA
adcbae8d49
Removed minitest/mock 2021-05-19 14:24:01 +09:00
Hiroshi SHIBATA
9bd79c2cef
Removed minitest/benchmark 2021-05-18 17:31:43 +09:00
Hiroshi SHIBATA
5a0b89de32
Removed minitest/autorun 2021-05-18 17:31:42 +09:00
Yusuke Endoh
5f8bca3257 tool/lib/minitest/mock.rb: define Object#stub only when not defined
Recently, lib/rubygems/test_case.rb also defines the method.
2021-05-14 18:10:07 +09:00
Hiroshi SHIBATA
010bb0883e
Workaround for make test-tool 2021-05-11 20:08:03 +09:00
Yusuke Endoh
bb8a759f6b Fix a typo of c6a11b865e
It failed to define `refute_path_not_exist`
2021-05-11 19:46:15 +09:00
Hiroshi SHIBATA
c6a11b865e
Alias assert/refute_path_exists for test-unit gem.
It's required at https://github.com/rubygems/rubygems/pull/3141
2021-05-11 19:32:35 +09:00
Takashi Kokubun
e1fee7f949
Rename RubyVM::MJIT to RubyVM::JIT
because the name "MJIT" is an internal code name, it's inconsistent with
--jit while they are related to each other, and I want to discourage future
JIT implementation-specific (e.g. MJIT-specific) APIs by this rename.

[Feature #17490]
2021-01-13 22:46:51 -08:00
Koichi Sasada
e79f1941b2 tune parallel test
This patch contains the fowllowing hacks:

(1) Add "--timetable-data=FILE" option for test-all
    This option enables to dump timeline event
    contains worker, suite, and start/end time.
(2) remove TestJIT in test_jit_debug.rb on parallel test.
    it is duplicated test.
(3) move test_jit.rb and test_jit_debug.rb at first
    because these two tests are bottleneck of parallel tests.

On my environment, `make test-all TESTS=-j12` reduced the total time
190 seconds -> 140 seconds.
2020-12-01 09:39:09 +09:00
Hiroshi SHIBATA
b194973dcd
Revert the related commits about Tempfile.open change.
Start with fa21985a7a
  to d7492a0be8
2020-09-09 21:10:48 +09:00
Benoit Daloze
e8c3872555 Simplify Tempfile.open calls with a block as they now unlink the file automatically 2020-08-29 12:23:23 +02:00
Kazuhiro NISHIYAMA
946cd6c534
Use https instead of http 2020-07-28 19:51:54 +09:00
Nobuyoshi Nakada
2a20c17982
Prefer String#each_byte when using a block 2020-06-15 16:20:56 +09:00
Yusuke Endoh
8f99bfa26d tool/lib/minitest/unit.rb: Reproducible shuffle of test suites
... based on CRC32 of names of the test suites.

Formerly, `make test-all` randomized the order of the test suites by
using `Array#shuffle`.  It also shows `--seed N` to reproduce the order,
but it was not reproducible when a suite set is different.

This change sorts the suites by CRC32 hash of the suite names with a
salt generated by the seed.
2020-06-15 13:56:01 +09:00
Nobuyoshi Nakada
968d6df49f
Added --test-order=nosort option
Run tests in the order given in the command line.
2020-05-17 16:34:06 +09:00
Hiroshi SHIBATA
1fe2b7f41c Workaround for Minitest5 2020-05-08 07:38:50 +09:00
Nobuyoshi Nakada
d1f50b9872
Initialize the class variable for Minitest::Unit.current_repeat_count 2020-04-23 10:44:27 +09:00
Hiroshi SHIBATA
e5db3da9d3
Migrate {assert,refute}_patch_exits for compatibility with Minitest5 2020-03-30 21:32:26 +09:00
Koichi Sasada
28399e4e0f respect --test-order=random
Now --test-order=random is simply ignored. This patch respect
this option.
2020-02-28 17:44:23 +09:00
Koichi Sasada
6b30638bdb MiniTest::Unit.options has default :seed
MiniTest::Unit (superclass of Test::Unit::Runner) does not has
default seed parameter, but assigned after initializing.
However some tests use MiniTest::Unit without setup of seed option
and it cases unexpected test failures. To solve this issue, add
default seed parameter 42.
2020-02-27 04:06:28 +09:00
Koichi Sasada
14f1790807 srand($seed) at the beginning of each test
To avoid `srand(0)` effect in the other tests, call `srand($seed)`
at the beginning of each test (setup).
[Feature #16655]
2020-02-27 03:47:41 +09:00
Koichi Sasada
f9d314245b Revert "srand($seed) at the beginning of each test"
This reverts commit 7c1553e91d.
It breaks some tests.
2020-02-27 02:45:09 +09:00
Koichi Sasada
7c1553e91d srand($seed) at the beginning of each test
To avoid `srand(0)` effect in the other tests, call `srand($seed)`
at the beginning of each test (setup).
[Feature #16655]
2020-02-27 02:29:57 +09:00
Koichi Sasada
20c1c24014 Minitest::Unit.current_repeat_count
This method returns loop counter for multi-run (0 start).
2020-01-28 18:13:58 +09:00
Yusuke Endoh
c02de30efb tool/lib/leakchecker.rb: show the code location that allocated leaked fd
by using ObjectSpace.trace_object_allocations.

`make test-all LEAK_CHECKER_TRACE_OBJECT_ALLOCATION=true` will print not
only leaked fds but also where it was created.
2019-11-12 01:47:18 +09:00
Yusuke Endoh
1820aeeeb2 tool/lib/minitest/unit.rb: add "omit" as an alias to "skip"
According to rdoc, test-unit provides omit instead of skip.
This is a compatibility layer to make it work with both test-unit and
tool/lib/minitest.
2019-10-29 13:15:09 +09:00
Hiroshi SHIBATA
b39efb163d
Aliases capture_output to capture_io for test-unit compatiblity. 2019-08-08 17:19:23 +09:00
Koichi Sasada
cac44def0b backtrace can be nil.
Surprisingly, on SystemStackError#backtrace can return nil.
2019-07-31 15:14:50 +09:00
Koichi Sasada
efac0a2384 Revert "add debug code"
This reverts commit e83ec207cd.
2019-07-31 15:14:50 +09:00
Koichi Sasada
e83ec207cd add debug code 2019-07-31 12:46:34 +09:00
Hiroshi SHIBATA
c3c0e3f5c9 Move to tool/lib from test/lib. 2019-07-02 07:59:54 +09:00