Commit graph

383 commits

Author SHA1 Message Date
Kazuhiro NISHIYAMA
22b1e824d7
Check encodings of STDIN,STDOUT,STDERR too 2020-05-08 00:12:48 +09:00
Nobuyoshi Nakada
545d2ab7d2
leakchecker.rb: try lsof 2020-05-07 02:58:28 +09:00
Nobuyoshi Nakada
de3f725978
Makes nil-safe 2020-05-06 14:09:03 +09:00
Nobuyoshi Nakada
b247ac086e
Ignore FDs kept by system library
`getaddrinfo` on macOS seems keeping FDs to query host names
internally.
2020-05-06 13:47:09 +09:00
Nobuyoshi Nakada
039a8ef786
leakchecker.rb: search /dev/fd too
It is more popular than /proc/self/fd.
2020-05-06 10:09:29 +09:00
Nobuyoshi Nakada
f0b5629c8c
envutil.rb: Also alias to #name 2020-05-05 13:53:44 +09:00
Nobuyoshi Nakada
d1f50b9872
Initialize the class variable for Minitest::Unit.current_repeat_count 2020-04-23 10:44:27 +09:00
Nobuyoshi Nakada
2e87488d13
Expand retrying test file names to realpath
As well as worker processes do in Test::Unit::Worker#run.
2020-04-23 10:25:09 +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
Nobuyoshi Nakada
e231f8e8a8 envutil.rb: not try to close pipes twice 2020-04-17 00:52:29 +09:00
Hiroshi SHIBATA
e5db3da9d3
Migrate {assert,refute}_patch_exits for compatibility with Minitest5 2020-03-30 21:32:26 +09:00
Nobuyoshi Nakada
2b7409a2f2
Specify explicit separator not to be affected by $; 2020-03-08 17:38:37 +09:00
卜部昌平
f7048f9d55 tool/lib/test/unit: support TESTS='-- -ext-' again
There is a test directory named test/-ext-.  Because this directry
starts with a hyphen, we have to cheat test/unit in order for it to
run the tests underneath.  TESTS='-- -ext' worked for a long time.
Let's not break that maneuver.
2020-03-04 12:30:42 +09:00
Koichi Sasada
cf52f37cae Narrow the check target.
Call GC.verify_internal_consistency only for Gem related test
on i386-solaris.
2020-03-04 11:25:43 +09:00
Yusuke Endoh
43ed4eb6d1 Limit the debug code conditon so that it runs only under i386-solaris 2020-03-03 21:00:03 +09:00
Koichi Sasada
1ad9364440 add debug code for Solaris
Check heap consistency after each test to debug.
20200303T012406Z.fail.html.gz
2020-03-03 15:53:46 +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
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
116c632095 don't ignore --seed option
`--seed N` option is just ignored so respect this option.
[Feature #16655]

Also making "Run options" display pretty.
2020-02-27 02:26:14 +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
Nobuyoshi Nakada
b68fc08092
Indent ChangeLog contents [ci skip]
Separate each entries more obviously as `page-delimiter' works
fine.
2020-02-01 23:26:53 +09:00
Nobuyoshi Nakada
ab35876444
Explicitly set the encoding of ChangeLog file to UTF-8 [ci skip] 2020-02-01 23:10:18 +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
Nobuyoshi Nakada
b34f39e860
vcs.rb: Allow to empty a part in commit log 2020-01-12 19:43:59 +09:00
Nobuyoshi Nakada
d254d5563e
vcs.rb: Get rid of Kernel#open 2020-01-09 10:04:22 +09:00
Kazuhiro NISHIYAMA
729b7ce270
Add check_warning_flags to leakchecker 2019-12-27 13:06:31 +09:00
Nobuyoshi Nakada
80d5d220b9
Fix typo in commit logs by log-fix notes 2019-12-23 09:29:05 +09:00
Nobuyoshi Nakada
db16629008
Fixed misspellings
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-12-20 09:32:42 +09:00
卜部昌平
12de92a368 implement make test-all TESTS=--gc-compact
79eb5e1aca implemented
RUBY_TEST_GC_COMPACT=1 so why not make it also possible via the command
line argument.
2019-12-12 11:13:42 +09:00
Koichi Sasada
27ac034f19 support gc_compact_checker on parallel test. 2019-12-12 04:27:06 +09:00
Koichi Sasada
79eb5e1aca call GC.compact after each test.
RUBY_TEST_GC_COMPACT=1 enables GC.compact checker which calls
GC.compact after each test.
2019-12-12 03:32:12 +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