Граф коммитов

340 Коммитов

Автор SHA1 Сообщение Дата
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.

https://github.com/ruby/fileutils/commit/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>.
```

https://github.com/ruby/fileutils/commit/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
https://github.com/ruby/fileutils/commit/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
Nobuyoshi Nakada e9c7fc7ca9
Continue to export even if no notes/commits
Just exporting may not imply exporting ChangeLog which needs
notes/commits.  [Bug #16167]
2019-09-14 23:50:45 +09:00
Nobuyoshi Nakada 5a6954ba74
Suppress detached head warning 2019-09-08 00:22:24 +09:00
Nobuyoshi Nakada 3fafc549ba
Fix error when checking file modified with git-svn 2019-09-07 11:38:39 +09:00
Nobuyoshi Nakada 5118aa2d58
Use `git describe --contains` for tags 2019-09-07 11:38:38 +09:00
Nobuyoshi Nakada 3890c9eeee
Added more debug outputs from VCS::GIT 2019-09-07 11:38:38 +09:00
Nobuyoshi Nakada 799de9122e
Separated VCS.define_options for common VCS options 2019-09-07 11:38:38 +09:00
Nobuyoshi Nakada 055b441093
VCS::GIT no longer accepts remote repository 2019-09-06 22:15:36 +09:00
Yusuke Endoh 41b7c335d3 Revert "Add a temporal stack dumper for debugging on trunk-mjit"
This reverts commit 433c9c00d9.

Successfully captured some traces, and
3b60e5e6bc seems to fix the issue.
2019-09-06 13:04:36 +09:00
Yusuke Endoh 433c9c00d9 Add a temporal stack dumper for debugging on trunk-mjit
This must be definitely removed after we collect the stack traces :-)
http://ci.rvm.jp/results/trunk-mjit@silicon-docker/2245710
2019-09-05 22:16:21 +09:00
Nobuyoshi Nakada 9f59d30daa
Separate VCS::DEBUG_OUT 2019-09-05 00:33:49 +09:00
Nobuyoshi Nakada 542a1ade80
--date=iso-local does not work with old git 2019-09-03 11:33:29 +09:00
Nobuyoshi Nakada d83ade1db5
Use -z option for git-log 2019-09-03 00:33:02 +09:00
Nobuyoshi Nakada 6a9c5ef186
Extract git commit log as raw format like git-svn for ChangeLog 2019-09-02 23:28:21 +09:00
Nobuyoshi Nakada fd4aad6d41
Support packaging different branch/tag 2019-09-01 23:22:50 +09:00
Nobuyoshi Nakada d8260bc872
Fetch commit notes 2019-09-01 23:22:49 +09:00
Nobuyoshi Nakada ff7c95dfd9
Support git tags 2019-09-01 23:22:49 +09:00
Nobuyoshi Nakada d7aa1260b6
Remove files/directories for git/github which are committed [ci skip] 2019-08-31 14:45:57 +09:00
Nobuyoshi Nakada e593d5b31a
Suppress uninitialized instance variable warnings [ci skip] 2019-08-30 11:23:21 +09:00
Nobuyoshi Nakada 55f496c89b
Support revision in git-svn log 2019-08-30 11:23:21 +09:00
Nobuyoshi Nakada 1191049436
Updated comment of VCS#get_revisions [ci skip] 2019-08-30 11:23:21 +09:00
Nobuyoshi Nakada c9dc569a94
Ensure the last and changed revisions as Integers 2019-08-28 12:32:43 +09:00
Nobuyoshi Nakada 2cd68a38d9
Short revision of SVN should be an Integer 2019-08-27 23:43:41 +09:00
Nobuyoshi Nakada 48f1a38f23
Limit ChangeLog entries
Since the previous release date, when the starting message is not
found.
2019-08-26 18:27:17 +09:00
Nobuyoshi Nakada c775ab5e28
`local_path?` is a class method [ci skip] 2019-08-25 18:27:57 +09:00
Yusuke Endoh cc6fe15241 tool/lib/vcs.rb: explicitly fail when notes/commits is not available 2019-08-25 16:59:45 +09:00
Kazuhiro NISHIYAMA 1b03d2d76b
Revert workaround 2019-08-25 13:58:30 +09:00
Nobuyoshi Nakada b341e98b04
Simplified f13a00f5b4 [ci skip] 2019-08-25 11:38:15 +09:00
Nobuyoshi Nakada f13a00f5b4
Export all commits as ChangeLog when no starting commit is found [ci skip] 2019-08-25 11:24:53 +09:00
Kazuhiro NISHIYAMA 03ee12a3b8
Add workaround (2nd try)
https://rubyci.org/logs/rubyci.s3.amazonaws.com/gentoo/ruby-master/log/20190824T153002Z.fail.html.gz
```
/home/gentoo/chkbuild/tmp/build/20190824T153002Z/ruby/tool/lib/vcs.rb:577:in `export_changelog': cannot find the beginning revision of the branch (RuntimeError)
    from ./tool/make-snapshot:353:in `block in package'
    from ./tool/make-snapshot:351:in `chdir'
    from ./tool/make-snapshot:351:in `package'
    from ./tool/make-snapshot:523:in `block in <main>'
    from ./tool/make-snapshot:523:in `collect'
    from ./tool/make-snapshot:523:in `<main>'
```
2019-08-25 00:50:34 +09:00
Kazuhiro NISHIYAMA df348310dc
Add workaround for some CIs
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian8/ruby-master/log/20190824T093005Z.fail.html.gz
```
branches:
* trunk
  remotes/origin/trunk
```
and
```
fatal: Remote branch master not found in upstream origin
```
2019-08-24 23:17:12 +09:00
Kazuhiro NISHIYAMA 97ad7862d5
Add debug print
matser branch not found on some CIs
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian9/ruby-master/log/20190824T063005Z.fail.html.gz
```
fatal: Remote branch master not found in upstream origin
```
2019-08-24 16:22:37 +09:00
Hiroshi SHIBATA 3ecb5125c6
Gem::ConfigMap is deprecated now 2019-08-18 13:25:31 +09:00
SHIBATA Hiroshi 216d230080
Move some assertions to CoreAssertions. (#2354)
They are used by default gems like forwardable.

    * assert_raise_with_message
    * assert_warning
    * assert_warn
2019-08-14 07:44:26 +09:00
Nobuyoshi Nakada 75d9fa8b07
Detect VCS from the current directory by default [ci skip] 2019-08-13 12:24:55 +09:00
Nobuyoshi Nakada 0d1af9f942
Push commits notes too [ci skip] 2019-08-13 12:24:40 +09:00
Nobuyoshi Nakada 066a3498c6
Include commits notes in ChangeLog 2019-08-12 19:02:55 +09:00
Kazuhiro NISHIYAMA f731cc0984
Use `end_with?` instead of Regexp with missing escape 2019-08-11 10:15:05 +09:00
Koichi Sasada 3cbd56d574 complement `test_` prefix.
`make test-all TESTS=name` can specify running test files by name.
name can be dirname ('dir/') or a file ('.../test_foo.rb'). This
patch complement `test_` prefix for a test. So we only need to
specify `TESTS=ruby/hash` which means `TESTS=ruby/test_hash.rb`.
2019-08-09 16:08:15 +09:00
Hiroshi SHIBATA b39efb163d
Aliases capture_output to capture_io for test-unit compatiblity. 2019-08-08 17:19:23 +09:00
Nobuyoshi Nakada 29092d35d3
Moved FailDesc to EnvUtil.failure_description
So EnvUtil does not depends on test/unit.
2019-08-05 10:48:49 +09:00
Hiroshi SHIBATA d569d721f9
Move assert_ruby_status and assert_throw to CoreAssertions for default gems. 2019-08-03 22:17:45 +09:00
Nobuyoshi Nakada 6623cde731
Added more attributes [ci skip] 2019-08-03 14:56:07 +09:00
Hiroshi SHIBATA eb638b75b3
It can be share to use CoreAssertions for default gems.
ref. https://github.com/ruby/logger/pull/35
2019-08-02 21:09:43 +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
Nobuyoshi Nakada 47144f91a1
Separate VCS::GIT#upstream 2019-07-30 16:44:29 +09:00
Nobuyoshi Nakada 46771abfe5
Use libraries in the base directory if given 2019-07-25 16:57:37 +09:00
Nobuyoshi Nakada 4c1db84d17
Added --base-directory option 2019-07-25 16:57:37 +09:00
Nobuyoshi Nakada f5ea054810
Moved NoMemoryError hook
Moved NoMemoryError hook from AutoRunner.run to Runner#run, so
it will work even in non-autorunning mode.
2019-07-25 16:57:37 +09:00
Nobuyoshi Nakada a850be68a5
Moved NoMemoryError hook to Test::Unit::AutoRunner 2019-07-25 08:42:16 +09:00
Nobuyoshi Nakada dc954cbb75
@@project_dir in Gem::TestCase is no longer used 2019-07-24 20:08:40 +09:00
Yusuke Endoh 24712eeec3 tool/test/runner.rb: support --test-target-dir option
tool/test/runner.rb had been copied from test/runner.rb.
test/runner.rb was for `make test-all`, and tool/test/runner.rb was for
`make test-testframework` and `make test-tool`.
But I want to avoid the code clones.

This change makes tool/test/runner.rb support --test-target-dir option
which allows tool/test/runner.rb to run `make test-all`.
Now we can remove test/runner.rb.
2019-07-21 19:19:08 +09:00
Hiroshi SHIBATA badfbdf32c
Move vpath.rb into tool library direcotry. 2019-07-15 13:16:16 +09:00
Hiroshi SHIBATA 41c5f9a166
Put jisx0208.rb to under the library directory. 2019-07-15 11:16:29 +09:00
Hiroshi SHIBATA 08b340d2f6
Separate the assertions of ruby core tests from test/unit/assertions. 2019-07-15 09:40:22 +09:00
Hiroshi SHIBATA e8ddbc0239
Put colorize to library directory.
Same as 66299e7ca83d379d13abaa5411f3e0419334cabb
2019-07-15 09:40:22 +09:00
Hiroshi SHIBATA 0a711b0edf
Put vcs .rb to under the lib direcotory.
Because it's the common library for tool files.
2019-07-15 09:40:22 +09:00
Koichi Sasada 47e571c951 complement '.rb' on `test-all TESTS=test_xxx`
for test-all rule, we can specify a file with TESTS option like
`TESTS=test_xxx.rb`. However, we can eliminate last '.rb' suffix
so this patch try with '.rb' suffix if the given path is not available.
2019-07-14 17:52:19 +09:00
Hiroshi SHIBATA 9f275f7971
Restore support library for only test files that are digest and csv. 2019-07-09 21:16:49 +09:00
Hiroshi SHIBATA f9a2440866
Restore support library for only test files. 2019-07-09 21:04:07 +09:00
Hiroshi SHIBATA c3c0e3f5c9 Move to tool/lib from test/lib. 2019-07-02 07:59:54 +09:00