Commit graph

108 commits

Author SHA1 Message Date
Hiroshi SHIBATA
93c44c4ed2 Move constants under the TestCase 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
54d2d70629 Migrate MiniTest::Unit::TestCase class under the Test::Unit 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
1bec4f251d Move MiniTest::Assertions to Test::Unit::Assertions 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
ecfbf1df33
Use Test::Unit::PendedError instead of MiniTest::Skip for test-unit migration 2021-09-06 19:33:56 +09:00
Hiroshi SHIBATA
544e37f184
Simplify conditions for CoreAssertion initialization 2021-09-06 19:31:24 +09:00
Koichi Sasada
228b3e43be check GC.enable'd status
Check GC.enable'd status before and after test execution.

Write this checker in gc_checker.rb, it was renamed from
gc_compact_checker.rb.
2021-08-05 17:11:50 +09:00
Nobuyoshi Nakada
690385014a
Move core_assertions.rb from test/unit
This file contains extended assertions for ruby core which do not
belong to test/unit.
2021-07-11 19:56:53 +09:00
Hiroshi SHIBATA
6e7e9a80ad
Expose assert_all? for ruby/csv repo 2021-06-01 19:38:05 +09:00
Nobuyoshi Nakada
0d29c3179c [ruby/stringio] Include all modules included into Test::Unit::TestCase
Some methods are separated into modules in test-unit now.

d289848994
2021-03-08 09:35:46 +09:00
Nobuyoshi Nakada
21e255913c [ruby/stringio] Pass IOs as separate list for ruby 2.x
74e39858eb
2021-03-08 09:35:25 +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
Nobuyoshi Nakada
fb54574393
Pass keyword options in assert_syntax_error 2020-12-24 01:24:30 +09:00
Hiroshi SHIBATA
61bd28b836
[ruby/date] Workaround for non-ruby repository like ruby/date, flori/json
1ff7fa2d80
2020-12-23 13:53:40 +09:00
Marc-Andre Lafortune
1ecac8e4d0 Add require_relative option to assert_ractor 2020-12-20 22:00:05 -05:00
Marc-Andre Lafortune
b1b6dbfdc3 assert_ractor tweak. Thanks Nobu 2020-12-19 22:37:27 -05:00
Marc-Andre Lafortune
70f20234b2 Add assert_ractor [Feature #17367] 2020-12-19 17:13:08 -05:00
Jeremy Evans
05313c914b Use category: :deprecated in warnings that are related to deprecation
Also document that both :deprecated and :experimental are supported
:category option values.

The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.

Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).

Add assert_deprecated_warn to test assertions.  Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
2020-12-18 09:54:11 -08:00
Nobuyoshi Nakada
9908177857
test/ruby: Check warning messages at a finer granularity
Instead of suppressing all warnings wholly in each test scripts by
setting `$VERBOSE` to `nil` in `setup` methods.
2020-12-17 20:06:18 +09: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
533bca57e0
Expose assert, assert_respond_to and assert_not_respond_to for default gems. 2020-10-08 16:40:46 +09:00
Nobuyoshi Nakada
9fbbbadc96
Added just working Test::Unit::CoreAssertions#diff
This is not "diff", but show expected and actual results both,
just to get rid of `NoMethodError` when an assertion failed.
2020-09-14 18:19:40 +09:00
Hiroshi SHIBATA
59ded36c60
Expose assert_pattern_list for drb test with test-unit gem. 2020-07-02 20:53:42 +09:00
Nobuyoshi Nakada
3152977b31
Rescue EPIPE in _report
Instead of letting callers rescue the error always.
2020-04-17 14:25:20 +09:00
Nobuyoshi Nakada
3cca0d1958 core_assertions.rb: fixed fd leak at timeout 2020-04-17 00:52:29 +09:00
Koichi Sasada
413c98003b show backtrace.
assert_nothing_raised doesn't show the backtrace if an exception
is thrown in a block. This patch shows this backtrace.
2020-03-01 03:02:05 +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
Hiroshi SHIBATA
9b2e671944 Expose assert_no_memory_leak for weakref 2020-02-11 13:29:23 +09:00
Hiroshi SHIBATA
a5d7b8e13d Expose assert_normal_exit for weakref 2020-02-11 13:29:23 +09:00
Nobuyoshi Nakada
a3fb97465d
Stop auto runner
Auto runner should not run in forked processes in separated tests.
2020-02-07 13:43:50 +09:00
Nobuyoshi Nakada
3d21a75c72
No crafted backtrace for SystemExit
As SystemExit is ignored, it is just useless.
2020-02-07 11:09:19 +09:00
Nobuyoshi Nakada
5fac54a594
Fixed the output from separated test in parallel test
Redirect the output of separated child process to
`MiniTest::Unit.output`.
2020-02-06 20:53:11 +09:00
Nobuyoshi Nakada
f1c230f18b
Add separated assertion count 2020-02-06 20:52:25 +09:00
Nobuyoshi Nakada
0226d72e95
Fixed the output from separated test in parallel test
To output to the STDOUT of the parent process according to the
parallel test protocol, should send to the `MiniTest::Unit.output`
instead of each own STDOUT.
2020-02-05 09:39:14 +09:00
Nobuyoshi Nakada
6fe44576b9
Fixed FD leaks 2020-02-05 09:30:12 +09:00
Nobuyoshi Nakada
c6cd4206df
Get rid of nested string interpolations to be editor-friendly 2020-02-05 08:53:21 +09:00
NARUSE, Yui
390a9d3b72 just use STDOUT 2020-02-04 21:51:57 +09:00
NARUSE, Yui
9b9a621ae3 On Windows it cannot receive fd except 0..2 2020-02-04 20:54:48 +09:00
NARUSE, Yui
0529fead36 assert_separately uses their own pipe instead of stdout 2020-02-04 19:30:11 +09:00
Koichi Sasada
27ac034f19 support gc_compact_checker on parallel test. 2019-12-12 04:27:06 +09:00
Yusuke Endoh
409e4ab740 tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io
`(ulimit -n 30; make test-tool)` fails with unexplicit message:
"undefined method `write' for nil:NilClass" due to lack of stdout.

This change makes it explicit.  [Bug #5577]
2019-12-03 17:26:12 +09:00
David Rodríguez
a2fc6a51dd [ruby/fileutils] Fix test failure under ruby 2.4
`Exception#full_message` is only defined on ruby 2.5.0 and above.

a8968f41ed
2019-12-01 08:23:05 +09:00
David Rodríguez
fa0f3eff22 [ruby/fileutils] Fix error printing test failure
`exception_details` is not defined anywhere.

This commit fixes the following test crash in ruby 2.4

```
Error: test_assert_output_lines(TestFileUtils): NoMethodError: undefined method `exception_details' for #<TestFileUtils:0x00005556ef699178>
```

And replaces it with an actual test failure:

```
[Test::Unit::CoreAssertions::MiniTest::Assertion] exception expected, not #<NoMethodError: undefined method `full_message' for #<RuntimeError: ok>
Did you mean?  message>.
```

2f38ba6e82
2019-12-01 08:22:37 +09:00
Kazuhiro NISHIYAMA
50bc7e7e9f
Add debug print
http://ci.rvm.jp/results/trunk-mjit@silicon-docker/2380788
```
test_all             #<Thread:0x000055b6c8e9fca8@/tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:42 run> terminated with exception (report_on_exception is true):
<internal:pack>:134:in `pack': no implicit conversion of false into String (TypeError)
	from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:160:in `_report'
	from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:45:in `block in _run_suite'
```
2019-11-09 15:20:52 +09:00
Hiroshi SHIBATA
1c03026ea3 Try to run assert_output_unchanged with racc tests 2019-10-31 08:39:48 +09:00
Nobuyoshi Nakada
601f1fb456
Catch syntax error even if fatal 2019-10-23 02:05:28 +09:00
Nobuyoshi Nakada
f8fb51c976
Revert "alias assert_raise_message for compatibility with test-unit"
This reverts commit 43015275b9.

`assert_raise_message` in test-unit is different from
`assert_raise_with_message`.  It checks the exception message
only, but not the exception class,
2019-10-16 21:00:36 +09:00
Nobuyoshi Nakada
43015275b9
alias assert_raise_message for compatibility with test-unit 2019-10-16 17:44:51 +09:00
Hiroshi SHIBATA
c14755e9ca
[ruby/fileutils] improve the compatibility of minitest
f16f5a0dd6
2019-10-03 18:32:21 +09:00
Koichi Sasada
84cbce3d88 Enable checkers on parallel test.
parallel test (`make test-all TESTS=-j8`) runs tests on specified
number of processes. However, some test checkers written in
`runner.rb` are not loaded. This fix enable these checkers on
parallel tests.

See also: https://github.com/ruby/ruby/pull/2508
2019-10-02 16:23:00 +09:00
Hiroshi SHIBATA
15606963de expose assert_raise and assert_join_threads 2019-10-01 22:19:18 +09:00