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

603 Коммитов

Автор SHA1 Сообщение Дата
Koichi Sasada 5e91b4bdb3 fix typo [ci skip] 2020-09-27 09:49:16 +09:00
Koichi Sasada 0096d2b895 freeze all Range objects.
Matz want to try to freeze all Range objects.
[Feature #15504]
2020-09-25 22:16:55 +09:00
Koichi Sasada caaa36b4e6 prohibi method call by defined_method in other racotrs
We can not call a non-isolated Proc in multiple ractors.
2020-09-25 20:37:38 +09:00
Koichi Sasada 25cfb0c040 Range is based on Struct.
Range can be shareable because it is implemented by Struct.
2020-09-25 16:00:13 +09:00
Koichi Sasada 96739c4222 Frozen Struct can be shareable.
A frozen Struct object which refers to shareable objects should be
shareable.
2020-09-25 16:00:13 +09:00
Koichi Sasada 6081ba4a87 refactoring a test code.
make a test more clear.
2020-09-25 13:07:07 +09:00
Koichi Sasada d247dedade Ractor.yield should raise if out-port is closed
Ractor.yield should raise Ractor::ClosedError if current Ractor's
outgoing-port is closed.
2020-09-25 12:53:58 +09:00
Koichi Sasada 5286526346 frozen T_OBJECT can be shareable.
If an T_OBJECT object is frozen and all ivars are shareable,
the object should be shareable.
2020-09-25 12:52:53 +09:00
Koichi Sasada 7ad3aff48d Ractor#close_outgoping cancel Ractor.yield
Ractor#close_outgoing should cancel waiting Ractor.yield. However,
yield a value by the Ractor's block should not cancel (to recognize
terminating Ractor, introduce rb_ractor_t::yield_atexit flag).
2020-09-25 00:25:38 +09:00
Michael Lindley e06f4a3b1f Remove test for putiseq insn
putiseq was removed from instruction set in 2b5bb8a0
2020-09-24 09:56:12 +09:00
Quang-Minh Nguyen be2efb118f Fulfill missing tests and stabilize tests 2020-09-20 23:10:44 +09:00
Quang-Minh Nguyen 398da71175 Validate name during initialization 2020-09-20 23:10:44 +09:00
Quang-Minh Nguyen d5fa66156a Add status to Ractor#inspect 2020-09-20 23:10:44 +09:00
Benoit Daloze 9b535f3ff7 Interpolated strings are no longer frozen with frozen-string-literal: true
* Remove freezestring instruction since this was the only usage for it.
* [Feature #17104]
2020-09-15 21:32:35 +02:00
Koichi Sasada e81d7189a0 sync fstring pool
fstring pool should be sync with other Ractors.
2020-09-15 00:04:59 +09:00
Kazuhiro NISHIYAMA 3bdf8efd81
Fix typos [ci skip] 2020-09-13 12:35:06 +09:00
Koichi Sasada 3f922f3b77 don't use toplevel return
Toplevel return is supported after Ruby 2.4, so don't use it
for older BASERUBY.
2020-09-04 04:07:34 +09:00
Koichi Sasada b52513e2a1 skip Ractor tests on Compiler tests
This implementation has memory corruption errors so and
it causes BUG on rare occasions. This commit skips
suspect tests on Github actions Compiler tests.
2020-09-03 21:11:06 +09:00
Koichi Sasada 79df14c04b Introduce Ractor mechanism for parallel execution
This commit introduces Ractor mechanism to run Ruby program in
parallel. See doc/ractor.md for more details about Ractor.
See ticket [Feature #17100] to see the implementation details
and discussions.

[Feature #17100]

This commit does not complete the implementation. You can find
many bugs on using Ractor. Also the specification will be changed
so that this feature is experimental. You will see a warning when
you make the first Ractor with `Ractor.new`.

I hope this feature can help programmers from thread-safety issues.
2020-09-03 21:11:06 +09:00
Koichi Sasada ed22bf47cc display stderr output even if core dump files
On btest, stderr messages are not displayed if core files are
generated. There is no reason to skip it, so this patch display
stderr and check core files.
2020-07-29 18:45:39 +09:00
Takashi Kokubun e544a3a23c
Remove obsoleted opt_call_c_function insn (#3232)
* Remove obsoleted opt_call_c_function insn

* Keep opt_call_c_function with DEFINE_INSN_IF
2020-06-17 09:16:01 -07:00
Jeremy Evans f3e927b0cc Make proc/Proc.new without block an error instead of warning
The warning for these was added in 2.7.
2020-06-10 17:49:54 -07:00
Nobuyoshi Nakada 6009790e40
Moved already resolved test
Couldn't figure out failed/fixed versions.
2020-04-27 10:39:07 +09:00
Nobuyoshi Nakada c180c58fc1
Removed already resolved test [ci skip]
That bug has been fixed by ec0c394b9e, and the test has been
added by 181ffea5e0.
2020-04-27 10:39:07 +09:00
Nobuyoshi Nakada a9567cc2bf Added test for `debug_level:` option of `RubyVM::InstructionSequence.compile` 2020-04-15 16:06:48 +09:00
Jeremy Evans 900e83b501 Turn class variable warnings into exceptions
This changes the following warnings:

* warning: class variable access from toplevel
* warning: class variable @foo of D is overtaken by C

into RuntimeErrors.  Handle defined?(@@foo) at toplevel
by returning nil instead of raising an exception (the previous
behavior warned before returning nil when defined? was used).

Refactor the specs to avoid the warnings even in older versions.
The specs were checking for the warnings, but the purpose of
the related specs as evidenced from their description is to
test for behavior, not for warnings.

Fixes [Bug #14541]
2020-04-10 00:29:05 -07:00
Koichi Sasada fd0222caed should check pending interrupts correctly.
rb_uninterruptible() disables any interrupts using handle_interrupt
feature (This function is used by `p`).
After this function, pending interrupts should be checked correctly,
however there is no chance to setup interrupt flag of working
threads, it means that nobody checks pending interrupts.
For example, it ignores terminate signal delivered at the end
of main thread and program can't stop.

This patch set interrupt flag if there are pending interrupts.
2020-04-09 12:51:51 +09:00
Koichi Sasada 21d8e69248 disable to show the maximum number of threads.
On Deiban 9 environment, the thread tests failed and
this maximum threads information can finish up the machine
resources. To check it, I turned-off showing this information.
2020-03-23 11:32:20 +09:00
Jeremy Evans 7a288df7b8 Make yield in singleton class definitions in methods a SyntaxError
This behavior was deprecated in 2.7 and scheduled to be removed
in 3.0.

Calling yield in a class definition outside a method is now a
SyntaxError instead of a LocalJumpError, as well.
2020-02-11 12:44:23 -08:00
Jeremy Evans e91c39f1c0 Remove special handling of $SAFE and related C-APIs
These were all deprecated in Ruby 2.7.
2020-01-22 09:09:47 -08:00
Nobuyoshi Nakada 93b27c69cc
Show the failed message too 2019-12-12 23:26:35 +09:00
Nobuyoshi Nakada 0afee4d803
Show the failed message 2019-12-11 14:27:21 +09:00
John Hawthorn b99833baec
Use a monotonically increasing number for object_id
This changes object_id from being based on the objects location in
memory (or a nearby memory location in the case of a conflict) to be
based on an always increasing number.

This number is a Ruby Integer which allows it to overflow the size of a
pointer without issue (very unlikely to happen in real programs
especially on 64-bit, but a nice guarantee).

This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby
objects to Ruby objects (previously they were Ruby object to C integer)
which simplifies updating them after compaction as we can run them
through gc_update_table_refs.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2019-11-07 09:31:07 -08:00
Aaron Patterson e58814d150
Revert "Use a monotonically increasing number for object_id"
This reverts commit bd2b314a05.
2019-11-06 15:12:28 -08:00
John Hawthorn bd2b314a05 Use a monotonically increasing number for object_id
This changes object_id from being based on the objects location in
memory (or a nearby memory location in the case of a conflict) to be
based on an always increasing number.

This number is a Ruby Integer which allows it to overflow the size of a
pointer without issue (very unlikely to happen in real programs
especially on 64-bit, but a nice guarantee).

This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby
objects to Ruby objects (previously they were Ruby object to C integer)
which simplifies updating them after compaction as we can run them
through gc_update_table_refs.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2019-11-06 14:59:53 -08:00
Nobuyoshi Nakada 801a11d0ab
Relaxed tests for CPDEBUG mode 2019-10-23 01:05:52 +09:00
卜部昌平 9b919885a0 fix memory corruption in old GCC
This typo introduced memory corruption when __builtin_add_overflow
is not available but uint128_t is.  GCC before 5 are one of such
situatins.

See also https://rubyci.org/logs/rubyci.s3.amazonaws.com/opensuseleap/ruby-master/log/20191009T120004Z.log.html.gz
2019-10-10 00:13:30 +09:00
Nobuyoshi Nakada ea68bb914a Changed numbered parameter prefix 2019-09-24 21:57:54 +09:00
卜部昌平 436099ee04 add tests
Some coverage improvements.
2019-09-05 15:02:44 +09:00
Takashi Kokubun fb67d4fc77
Move an unstable bootstraptest to pending
This has been unstable on AppVeyor mswin since the introduction
3fd83cb6fc.
https://ci.appveyor.com/project/ruby/ruby/builds/27103307/job/j7xwjmsos2k22cck

Let's have it in pending.rb to be fixed.
2019-09-03 21:49:52 +09:00
Takashi Kokubun 1a5a01e9ce
Add insn tests for newarraykwsplat 2019-09-03 01:39:00 +09:00
Takashi Kokubun c69545ae32
Fix opt_regexpmatch1 references 2019-09-02 14:33:37 +09:00
Jeremy Evans 856bb3c35d Fix remaining warning issues in the tests due to keyword argument separation 2019-08-30 12:39:31 -07:00
Nobuyoshi Nakada 8827697ec4
Compare actual result 2019-08-14 00:23:19 +09:00
Kazuhiro NISHIYAMA 2eec526053
bootstraptest/test_insns.rb: test opt_nil_p 2019-08-01 20:34:31 +09:00
Nobuyoshi Nakada c2428b8bf6
Erase only on tty 2019-07-29 23:05:41 +09:00
Samuel Williams 012e954b47
Improved fiber benchmarks. Increase number of iterations. 2019-07-12 11:56:51 +12:00
Nobuyoshi Nakada f47254d216
colors file has been moved from test to tool 2019-07-02 09:19:38 +09:00
Nobuyoshi Nakada 7f4f40ab31
bootstraptest/runner.rb (show_limit): defer messages unless verbose and a tty 2019-07-01 17:09:08 +09:00
Nobuyoshi Nakada fe03bbaf34
bootstraptest/runner.rb (show_limit): show dots only when printing to a tty 2019-07-01 10:16:47 +09:00
git cbe06cd350 * remove trailing spaces, expand tabs. 2019-06-19 17:39:58 +09:00
Samuel Williams 69195fd9b2 Show thread and fiber limits as part of bootstrap tests. 2019-06-19 20:39:10 +12:00
Samuel Williams 3fd83cb6fc Improve benchmarks and tests for threads. 2019-06-19 20:39:10 +12:00
nobu 12acc751e3 Numbered parameters [Feature #4475]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 05:21:18 +00:00
shyouhei 232f31ca12 on-smash canary detection
In addition to detect dead canary, we try to detect the very moment
when we smash the stack top.  Requested by k0kubun:
https://twitter.com/k0kubun/status/1085180749899194368


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-01 07:26:39 +00:00
nobu 62ec5eb018 parse.y: more token names
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-21 10:24:56 +00:00
naruse e90d826de7 Indented here document (<<~) is Ruby 2.3 feature
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-19 07:49:47 +00:00
ko1 b4ab9c0e32 support older BASERUBY for btest.
* bootstraptest/test_insns.rb: check RbConfig::LIMITS to support
  older BASERUBY.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-18 02:04:41 +00:00
ko1 07298ea209 support btest on older ruby.
* bootstraptest/runner.rb (assert_normal_exit): check MJIT first
  to support btest with ruby ~2.5. btest (bootstraptest) should be
  enable to run with stable ruby interpreter because modified ruby
  may not able to run runner.rb and we need to know why (this is why
  we introduce btest).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-17 01:36:21 +00:00
mame ab2547d786 st.c (rb_hash_bulk_insert_into_st_table): avoid out-of-bounds write
"hash_bulk_insert" first expands the table, but the target size was
wrong: it was calculated by "num_entries + (size to buld insert)", but
it was wrong when "num_entries < entries_bound", i.e., it has a deleted
entry.  "hash_bulk_insert" adds the given entries from entries_bound,
which led to out-of-bounds write access.  [Bug #15536]

As a simple fix, this commit changes the calculation to "entries_bound +
size".  I'm afraid if this might be inefficient, but I think it is safe
anyway.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-15 14:19:19 +00:00
shyouhei bc64df876e delete emacs mode lines [ci skip]
These settings are now covered by .dir-locals.el.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-27 06:12:09 +00:00
k0kubun 03bf85f28d bootstraptest/runner.rb: increase timeout for --jit-wait
because test_io.rb:33 randomly fails
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/1519055

checking MJIT.enabled? on driver might not make sense for target, but as
long as the CI is -DMJIT_FORCE_ENABLE, I believe it works for now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 00:38:49 +00:00
usa 34f3f916e6 Simply treat IO::WaitReadable just like Errno::EAGAIN
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20 05:18:28 +00:00
k0kubun 59676f6d03 revert r65820 and retry assert_finish
From: MSP-Greg <greg.mpls@gmail.com>

5187ea768f

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20 02:16:30 +00:00
k0kubun 5187ea768f test_thread.rb: skip test_thread.rb broken for Windows
msys2.

https://ci.appveyor.com/project/ruby/ruby/builds/20419607/job/fuvrfcmrhxr1r1cr
https://ci.appveyor.com/project/ruby/ruby/builds/20395349/job/2nqewb06b5eanwea
https://ci.appveyor.com/project/ruby/ruby/builds/20382452/job/658pvl1cqolyrixm

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20 01:28:43 +00:00
kazu 4365e64005 bootstraptest/test_insns.rb: test newhashfromarray
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-27 08:17:01 +00:00
nobu 7f0d337be7 fallback env encoding to ASCII-8BIT
* hash.c (env_enc_str_new): as no locale/filesystem encoding is
  available in miniruby on Windows, fallback the encoding to
  ASCII-8BIT so it is valid encoding when the conversion failed.
  [ruby-core:89177] [Bug #15164]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-26 17:24:00 +00:00
nobu fb7a569077 bootstraptest update test_io.rb [Bug #15060] [Fix GH-1495]
From: MSP-Greg <greg.mpls@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-04 05:28:38 +00:00
normal ebfc448529 bootstraptest/runner.rb: speed up assert_finish with IO.select (take #2)
Resurrect r63754 in a 1.8-compatible way.  While we're at it,
add a note to maintain 1.8 compatibility (cf. r63757).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-30 08:05:22 +00:00
mame 727ceb2a95 Fix a bug of peephole optimization
```
  if   L1
L0:
  jump L2
L1:
  ...
L2:
```

was wrongly optimized to:

```
  unless L2
L0:
L1:
  ...
L2:
```

To make it conservative, this optimization is now disabled when there is
any label between `if` and `jump` instructions.
Fixes [Bug #14897].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06 04:52:33 +00:00
shyouhei d3ae13571f improve C0 coverage of insns.def
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-29 04:56:07 +00:00
nobu 7b1372b0ac rethrow the caught exception as-is
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-29 03:28:26 +00:00
normal 6c74c73f95 tests: increase timeouts and speedup some slow tests
I'm still using the computer from 2005, so enabling MJIT makes
some tests take longer.  For test_deadlock_by_signal_at_forking
I got it down to 135s to 89s by disabling RubyGems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27 18:27:58 +00:00
mame e3e22c551d Revert "bootstraptest/runner: speed up assert_finish by avoiding sleep"
This reverts commit r63754.
Many CI servers still use old ruby as base ruby which does not support
read_nonblock.

https://rubyci.org/logs/www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20180627T013100Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27 02:37:26 +00:00
normal a1ba5b6a64 bootstraptest/runner: speed up assert_finish by avoiding sleep
We may use IO.select to watch for process exit.  This speeds up
"make test" by 2 seconds for me.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-26 23:44:00 +00:00
nobu 55515ef463 error.c: bypass Exception.new
* error.c (rb_exc_new, rb_exc_new_str): instantiate exception
  object directly without Exception.new method call.

Redefinition of class method `new` is an outdated style, and
internal exceptions should not be affected by it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-20 10:08:27 +00:00
mame 60bb4fcdf6 bootstraptest/test_fork.rb: Stop too restrict NPROC test temporarily
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09 08:05:40 +00:00
ko1 c39bdb798d `$SAFE` as a process global state. [Feature #14250]
* vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to
  `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state.

* vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc`
  objects don't need to keep `$SAFE` at the creation.
  Also make `is_from_method` and `is_lambda` as 1 bit fields.

* cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation.

* eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access
  `vm->safe_level_` directly.

* eval_jump.c: End procs `END{}` doesn't keep `$SAFE`.

* proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c.

* safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes.

* safe.c (safe_setter): use `rb_set_safe_level()`.

* thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`.
  It should be obsolete.

* transcode.c (load_transcoder_entry): `rb_safe_level()` only returns
  0 or 1 so that this check is not needed.

* vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc.

* vm.c (rb_proc_create): renamed to `proc_create`.

* vm.c (rb_proc_dup): moved from proc.c.

* vm.c (vm_invoke_proc): do not need to set and restore `$SAFE`
  for `Proc#call`.

* vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer
  meaning.

* lib/drb/drb.rb: restore `$SAFE`.

* lib/erb.rb: restore `$SAFE`, too.

* test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests.

* test/rubygems/test_gem.rb: do not set `$SAFE = 1`.

* bootstraptest/test_proc.rb: catch up this change.

* spec/ruby/optional/capi/string_spec.rb: ditto.

* test/bigdecimal/test_bigdecimal.rb: ditto.

* test/fiddle/test_func.rb: ditto.

* test/fiddle/test_handle.rb: ditto.

* test/net/imap/test_imap_response_parser.rb: ditto.

* test/pathname/test_pathname.rb: ditto.

* test/readline/test_readline.rb: ditto.

* test/ruby/test_file.rb: ditto.

* test/ruby/test_optimization.rb: ditto.

* test/ruby/test_proc.rb: ditto.

* test/ruby/test_require.rb: ditto.

* test/ruby/test_thread.rb: ditto.

* test/rubygems/test_gem_specification.rb: ditto.

* test/test_tempfile.rb: ditto.

* test/test_tmpdir.rb: ditto.

* test/win32ole/test_win32ole.rb: ditto.

* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-28 20:09:24 +00:00
ko1 5845bd6a71 show the location at intterrupted
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-06 07:35:37 +00:00
hsbt 0e2d2e6a79 Drop to support NaCl platform.
Because NaCl and PNaCl are already sunset status.
  see https://bugs.chromium.org/p/chromium/issues/detail?id=239656#c160

  configure.ac: Patch for this file was provided by @nobu.

  [Feature #14041][ruby-core:83497][fix GH-1726]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 05:56:25 +00:00
nobu 477d115924 bootstraptest/runner.rb: keyword argument
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-21 01:34:33 +00:00
k0kubun 1d9030a107 bootstraptest/test_insns.rb: Fix typo
on test message. "torexp" insn does not exist.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 13:54:09 +00:00
nobu 489776e284 Rename RbConfig::Limits as RbConfig::LIMITS
* template/limits.c.tmpl (Init_limits): rename RbConfig::Limits as
  RbConfig::LIMITS, constants other than class or module are all
  uppercase with underscores by convention.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-06 02:10:40 +00:00
kazu f19fac1dd2 fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-28 13:47:45 +00:00
kazu 3439cc85ea Update assertion message [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-28 13:47:43 +00:00
normal 568f8adfc8 compile.c: apply opt_str_freeze to String#-@ (uminus)
The same optimization used for "literal string".freeze
can easily apply to uminus without introducing any
compatibility problems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-10 20:09:06 +00:00
shyouhei 8ad7429644 make FIXNUM_MAX visible from Ruby
Because our tests now have several places where FIXNUM_MAX is needed,
we decided to provide it along with several other constants.

	* template/limits.c.tmpl: new file, defining RbConfig::Limits

	* ext/rbconfig/sizeof/depend (limits.c): rule to generate limits.c

	* test/-ext-/num2int/test_num2int.rb: use RbConfig::Limits

	* bootstraptest/test_insns.rb: ditto.

	* .gitignore: ignore new generated file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-30 10:12:18 +00:00
shyouhei 80040c166e improve C0 coverage of insns.def from 65.9% to 96.1%
While I was developing my private topic branch I found that the VM
itself is not tested very much in `make test` tests.  Of course
`make test-all` covers vast majority of the VM but running that task
is not an immediately possible thing when we are touching the VM.  In
order to boost development in a rapid cycle I decided to add some
tests to the bootstraptest.  Here it is.

	* test_insns.rb: new test that covers insns.def.

	* runner.rb (#assert_equal): pass extra options to the target
	  so that we can test frozen_string_literal: true situation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23 02:47:16 +00:00
kazu ed7b88e285 `\s` includes `\t`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-11 16:36:14 +00:00
nobu 269977b918 bootstraptest/runner.rb: first line in the source
* bootstraptest/runner.rb (pretty): remove empty line at the
  beginning only.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-11 13:21:30 +00:00
nobu 4b298ad77a Use qualified names
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30 06:22:30 +00:00
nobu f306bb0fed suppress warnings
* basictest/runner.rb, bootstraptest/runner.rb: disable warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-07 10:34:11 +00:00
nobu cafeeb4bec bootstraptest/runner.rb may run on older ruby
* bootstraptest/runner.rb: do not use safe navigation operator.
  this runner may run on older ruby.  partially revert r53110
  (GH-1142 patched by @mlarraz).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-28 13:29:38 +00:00
akr 449fbfd4d4 Use Integer instead of Fixnum and Bignum.
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c,
  lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb,
  lib/rubygems/specification.rb, lib/uri/generic.rb,
  bootstraptest/test_eval.rb, basictest/test.rb,
  test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb,
  test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb,
  test/csv/test_data_converters.rb, test/date/test_date.rb,
  test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb,
  test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb,
  test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb,
  test/ruby/test_bignum.rb, test/ruby/test_case.rb,
  test/ruby/test_class.rb, test/ruby/test_complex.rb,
  test/ruby/test_enum.rb, test/ruby/test_eval.rb,
  test/ruby/test_iseq.rb, test/ruby/test_literal.rb,
  test/ruby/test_math.rb, test/ruby/test_module.rb,
  test/ruby/test_numeric.rb, test/ruby/test_range.rb,
  test/ruby/test_rational.rb, test/ruby/test_refinement.rb,
  test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb,
  test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb,
  test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 13:15:57 +00:00
kazu 3118d1e46a fix alignment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 12:57:49 +00:00
akr f9727c12cc [Feature #12005] Unify Fixnum and Bignum into Integer
* [Feature #12005] Unify Fixnum and Bignum into Integer

* include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums.

* insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from
  FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG.

* vm_core.h: Ditto.

* vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead
  of FIXNUM_REDEFINED_OP_FLAG.

* vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of
  rb_cFixnum and rb_cBignum.
  (C): Use Integer instead of Fixnum and Bignum.

* numeric.c (fix_succ): Removed.
  (Init_Numeric): Define Fixnum as Integer.

* bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum.
  (rb_int_coerce): replaced from rb_big_coerce and return fixnums
  as-is.
  (Init_Bignum): Define Bignum as Integer.
  Don't define ===.

* error.c (builtin_class_name): Return "Integer" for fixnums.

* sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum.

* ext/-test-/testutil: New directory to test.
  Currently it provides utilities for fixnum and bignum.

* ext/json/generator/generator.c: Define mInteger_to_json.

* lib/mathn.rb (Fixnum#/): Redefinition removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 06:53:48 +00:00
nobu 373a7006dd btest: resource limit
* bootstraptest/test_thread.rb: rescue resource limitation errors.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-06 07:59:37 +00:00
hsbt 6cf568f4b5 * bootstraptest/runner.rb: use safe navigation operator.
[fix GH-1142] Patch by @mlarraz
* test/openssl/test_pair.rb: ditto.
* test/ruby/test_econv.rb: ditto.
* test/ruby/test_settracefunc.rb: ditto.
* test/thread/test_queue.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 08:04:28 +00:00
ngoto b935a13ba5 * bootstraptest/test_fork.rb ([ruby-dev:37934]): :NPROC (RLIMIT_NPROC)
is not supported on some platforms (e.g. Solaris 10).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-10 08:50:06 +00:00
nobu e0ed0012cb relax error message format
* bootstraptest/test_method.rb: relax error message format.
* test/ruby/test_arity.rb (err_mess): ditto.
  [Feature #9025], [ruby-core:71178] [Bug #11617]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-24 06:42:22 +00:00