summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyoptions.rb
AgeCommit message (Collapse)Author
2025-12-08merge revision(s) 190b017fc6c21ff7b61c2b5ece0294785e4a4ca2: [Backport #21703]Takashi Kokubun
[PATCH] Don't use non blocking pipes for RUBY_CRASH_REPORT [Bug #21703] RUBY_CRASH_REPORT does not work in some cases when shelling out on Linux. For example, given the following shell script dump.sh: #!/usr/bin/env bash cat > /tmp/crash And we see it fails like this: $ RUBY_CRASH_REPORT="|dump.sh" ruby -rfiddle -e "Fiddle::Pointer.new(1, 10)[0]" cat: -: Resource temporarily unavailable
2025-11-06[Backport #21638] Mark ractor-local `$VERBOSE` and `$DEBUG`Nobuyoshi Nakada
https://github.com/sampersand/blog/blob/master/the%20-s%20flag.md#the-segfault
2024-12-12[Feature #20884] Reserve "Ruby" toplevel nameNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12315
2024-12-05Standardize on the name "modular GC"Peter Zhu
We have name fragmentation for this feature, including "shared GC", "modular GC", and "external GC". This commit standardizes the feature name to "modular GC" and the implementation to "GC library". Notes: Merged: https://github.com/ruby/ruby/pull/12261
2024-11-14Include the currently active GC in RUBY_DESCRIPTIONMatt Valentine-House
This will add +MOD_GC to the version string and Ruby description when Ruby is compiled with shared gc support. When shared GC support is compiled in and a GC module has been loaded using RUBY_GC_LIBRARY, the version string will include the name of the currently active GC as reported by the rb_gc_active_gc_name function in the form +MOD_GC[gc_name] [Feature #20794] Notes: Merged: https://github.com/ruby/ruby/pull/11872
2024-11-06macOS 15 is the stable version todayHiroshi SHIBATA
2024-11-06`Warning[:strict_unused_block]`Koichi Sasada
to show unused block warning strictly. ```ruby class C def f = nil end class D def f = yield end [C.new, D.new].each{|obj| obj.f{}} ``` In this case, `D#f` accepts a block. However `C#f` doesn't accept a block. There are some cases passing a block with `obj.f{}` where `obj` is `C` or `D`. To avoid warnings on such cases, "unused block warning" will be warned only if there is not same name which accepts a block. On the above example, `C.new.f{}` doesn't show any warnings because there is a same name `D#f` which accepts a block. We call this default behavior as "relax mode". `strict_unused_block` new warning category changes from "relax mode" to "strict mode", we don't check same name methods and `C.new.f{}` will be warned. [Feature #15554] Notes: Merged: https://github.com/ruby/ruby/pull/12005
2024-11-04Fix Dir.mktmpdir argumentNobuyoshi Nakada
The temporary directory is the second argument.
2024-10-21Show where mutated chilled strings were allocatedÉtienne Barrié
[Feature #20205] The warning now suggests running with --debug-frozen-string-literal: ``` test.rb:3: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information) ``` When using --debug-frozen-string-literal, the location where the string was created is shown: ``` test.rb:3: warning: literal string will be frozen in the future test.rb:1: info: the string was created here ``` When resurrecting strings and debug mode is not enabled, the overhead is a simple FL_TEST_RAW. When mutating chilled strings and deprecation warnings are not enabled, the overhead is a simple warning category enabled check. Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/11893
2024-09-10Add predicates for platformsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11583
2024-08-29[Bug #20704] Win32: Fix chdir to non-ASCII pathNobuyoshi Nakada
On Windows, `chdir` in compilers' runtime libraries uses the active code page, but command line arguments in ruby are always UTF-8, since commit:33ea2646b98adb49ae2e1781753bf22d33729ac0. Notes: Merged: https://github.com/ruby/ruby/pull/11493
2024-08-15[PRISM] test_syntax_check assertion updates for prismKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11386
2024-07-18[PRISM] Refactor parser support into its own moduleKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11201
2024-07-18Refactor RUBY_DESCRIPTION assertions in test_rubyoptionsKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11192
2024-07-12Pend some tests because these are not working with macOS 15 beta and Xcode ↵Hiroshi SHIBATA
16 beta
2024-06-24Fix `--debug-frozen-string-literal` to not apply ↵Jean Boussier
`--disable-frozen-string-literal` [Feature #20205] This was an undesired side effect. Now that this value is a triplet, we can't assume it's disabled by default.
2024-06-07Remove prism compiler warningKevin Newton
2024-05-28Stop marking chilled strings as frozenÉtienne Barrié
They were initially made frozen to avoid false positives for cases such as: str = str.dup if str.frozen? But this may cause bugs and is generally confusing for users. [Feature #20205] Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-04-12[PRISM] Ensure no void warnings in rubyoptions testKevin Newton
2024-04-06[Feature #20329] Separate additional flags from main dump optionsNobuyoshi Nakada
Additional flags are comma separated list preceeded by `-` or `+`. Before: ```sh $ ruby --dump=insns+without_opt ``` After: ```sh $ ruby --dump=insns-opt,-optimize ``` At the same time, `parsetree_with_comment` is split to `parsetree` option and additional `comment` flag. Before: ```sh $ ruby --dump=parsetree_with_comment ``` After: ```sh $ ruby --dump=parsetree,+comment ``` Also flags can be separate `--dump`. ```sh $ ruby --dump=parsetree --dump=+comment --dump=+error_tolerant ``` Ineffective flags are ignored silently. ```sh $ ruby --dump=parsetree --dump=+comment --dump=+error_tolerant ```
2024-03-28Disable ASAN handle_segv in test_rubyoptions.rbKJ Tsanaktsidis
ASAN registers a sigsegv handler and causes extra output to be emitted that these tests are not expecting.
2024-03-14Ensure test suite is compatible with --frozen-string-literalJean Boussier
As preparation for https://bugs.ruby-lang.org/issues/20205 making sure the test suite is compatible with frozen string literals is making things easier.
2024-03-14[Feature #20293] Add `Warning.categories`Nobuyoshi Nakada
2024-03-14Chomp last punctuations from descriptions for `-h`Nobuyoshi Nakada
The following parts will not be shown for `-h` option. And not to reach 80 columns. Some terminal emulators (Windows command prompt at least) wrap the cursor to the next line when reaching the rightmost column, before exceeding.
2024-03-12Check what actually needs to be checkedTakashi Kokubun
RubyVM::YJIT is conditionally defined, depending on --enable-yjit. However, RubyVM::YJIT.enabled? is always defined as long as RubyVM::YJIT is defined, so it seems weird to check RubyVM::YJIT.enabled? instead of RubyVM::YJIT.
2024-03-12Use `assert_crash_report` in `test_crash_report_pipe`Nobuyoshi Nakada
Instead of using `assert_in_out_err` directly.
2024-02-28Fix crash report path test on WindowsNobuyoshi Nakada
2024-02-28Fix to use `assert_crash_report` resultsNobuyoshi Nakada
2024-02-22Cover all warning category optionsNobuyoshi Nakada
2024-02-21Re-enable test now that dump is all ASCIIKevin Newton
2024-02-21skip a test on non-UTF-8 localeKoichi Sasada
`ruby --parser=prism -W:no-experimental --dump=parsetree -e :hi` prints non-ASCII char(s) so the following test with non UTF-8 locale fails. ``` $ LANG=C make test-all TESTS='-n /parser/ ruby/rubyoptions' -o encs -o exts Run options: --seed=32323 "--ruby=./miniruby -I/home/ko1/ruby/src/master/lib -I. -I.ext/common /home/ko1/ruby/src/master/tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=/home/ko1/ruby/src/master/test/.excludes --name=!/memory_leak/ -n /parser/ [1/1] TestRubyOptions#test_parser_flag = 0.04 s 1) Failure: TestRubyOptions#test_parser_flag [/home/ko1/ruby/src/master/test/ruby/test_rubyoptions.rb:300]: pid 135869 exit 0. 1. [1/2] Assertion for "stdout" | invalid byte sequence in US-ASCII. Finished tests in 0.044362s, 22.5416 tests/s, 225.4157 assertions/s. 1 tests, 10 assertions, 1 failures, 0 errors, 0 skips ruby -v: ruby 3.4.0dev (2024-02-20T17:13:36Z master c0e5de9567) [x86_64-linux] make: *** [uncommon.mk:945: yes-test-all] Error 1 ``` Now simply skip the test if the locale is not UTF-8. (I'm not familiar with encodings so please fix it if needed)
2024-02-20Update warning flags before dumpNobuyoshi Nakada
2024-02-16[PRISM] Make prism compiler warning experimentalKevin Newton
2024-02-15Do not include a backtick in error messages and backtracesYusuke Endoh
[Feature #16495]
2024-01-29Fix test/ruby/test_rubyoptions.rb + --parser=prismKevin Newton
2024-01-25Simplified test case for encoding optionHiroshi SHIBATA
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-01-17Fix off-by-one error of argcNobuyoshi Nakada
Fix ruby/ruby#9562
2024-01-09Introduce NODE_SYM to manage symbol literalyui-knk
`:sym` was managed by `NODE_LIT` with `Symbol` object. This commit introduces `NODE_SYM` so that 1. Symbol literal is detectable from AST Node 2. Reduce dependency on ruby object
2024-01-02Introduce NODE_FILEyui-knk
`__FILE__` was managed by `NODE_STR` with `String` object. This commit introduces `NODE_FILE` and `struct rb_parser_string` so that 1. `__FILE__` is detectable from AST Node 2. Reduce dependency ruby object
2024-01-02Add a test case for `__LINE__` assignment in condition warningyui-knk
2023-12-20Correct free_on_exit env var to free_at_exitHParker
2023-12-15Update error message in test_rubyoptionsKevin Newton
2023-12-15Introduce --parser runtime flagHParker
Introduce runtime flag for specifying the parser, ``` ruby --parser=prism ``` also update the description: ``` $ ruby --parser=prism --version ruby 3.3.0dev (2023-12-08T04:47:14Z add-parser-runtime.. 0616384c9f) +PRISM [x86_64-darwin23] ``` [Bug #20044]
2023-12-07Free everything at shutdownAdam Hess
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2023-10-17"+MN" in descriptionKoichi Sasada
If `RUBY_MN_THREADS=1` is given, this patch shows `+MN` in `RUBY_DESCRIPTION` like: ``` $ RUBY_MN_THREADS=1 ./miniruby --yjit -v ruby 3.3.0dev (2023-10-17T04:10:14Z master 908f8fffa2) +YJIT +MN [x86_64-linux] ``` Before this patch, a warning is displayed if `$VERBOSE` is given. However it can make troubles with tests (with `$VERBOSE`), do not show any warning with a MN threads configuration.
2023-09-29Fix to replace only `-e` that is a path name in `assert_crash_report`Nobuyoshi Nakada
2023-09-28Syntax check of `yield` in the parserNobuyoshi Nakada
2023-09-28Jumps are possible in the top-level loopNobuyoshi Nakada
2023-09-28Suppress void context warnings in verbose modeNobuyoshi Nakada
2023-09-28Suppress void context warningsNobuyoshi Nakada