Commit graph

512 commits

Author SHA1 Message Date
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
Jeremy Evans
c5c05460ac Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02: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
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
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
Nobuyoshi Nakada
601f1fb456
Catch syntax error even if fatal 2019-10-23 02:05:28 +09:00
Nobuyoshi Nakada
ed3333f873
make-snapshot: Regexp#match raises on nil now 2019-10-22 21:05:52 +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
Nobuyoshi Nakada
b7ae26e2ee
vcs.rb: fix to export git-svn version
* Use the given branch name instead of implicit 'HEAD".
* Format like as git-svn when `from` or `to` is SVN revision
  number.
2019-10-03 19:07:48 +09:00
Hiroshi SHIBATA
c14755e9ca
[ruby/fileutils] improve the compatibility of minitest
f16f5a0dd6
2019-10-03 18:32:21 +09:00
卜部昌平
84fc1de512 use bind_call for test-all --gc-stress
This one allocation of Method object is worth avoiding.  We don't
want to test UnboundMethod#bind right here.  GC need not run.
2019-10-03 15:24:09 +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
Koichi Sasada
945560008f Revert "introduce debug check."
This reverts commit c3b84f2de8.
Backtrace shows it is before running tests and debug check was
nonsense.
2019-09-30 17:59:10 +09:00
Koichi Sasada
c3b84f2de8 introduce debug check.
There are random failures:

> lib/rubygems/core_ext/kernel_require.rb:61:in `require':
> wrong number of arguments (given 1, expected 0) (ArgumentError)
http://ci.rvm.jp/results/trunk-jemalloc@silicon-docker/2275159

To check this failure, I added a small check code.
2019-09-30 17:23:36 +09:00
Koichi Sasada
bf8d7d9c1d show RUBY_ISEQ_DUMP_DEBUG envval if given. 2019-09-30 15:35:22 +09:00
Nobuyoshi Nakada
03284fb911
assert_in_out_err should use FailDesc too 2019-09-27 21:07:53 +09:00
Nobuyoshi Nakada
6cad064424
Try to fetch commits notes to the source tree automatically
[Bug #16167]
2019-09-15 16:23:33 +09:00
Nobuyoshi Nakada
585b15d75d
make-snapshot: no merge commits in ChangeLog
Parents commit hashs in logs of merge commits are abbreviated to
necessary length depending on the repositories.  Exclude merge
commits from ChangeLog to make it stable.
2019-09-15 11:22:32 +09:00
Nobuyoshi Nakada
df4a4bd88c
make-snapshot: export ChangeLog from srcdir 2019-09-15 11:22:32 +09:00