Commit graph

115 commits

Author SHA1 Message Date
Hiroshi SHIBATA
6bd5a51ab5 Removed Solaris conditions from test files
We no longer execute those files with Solaris platforms.
2025-04-02 16:24:47 +09:00
Naoto Ono
db4ea95219
[Bug #20682] Add sleep 0.1 to stabilize flaky failures on macOS (#12829)
[Bug #20682] Add `sleep 0.1` to stabilize flaky failures on macOS
2025-02-28 09:32:36 +00:00
Nobuyoshi Nakada
8ec58a91f7 [ruby/io-console] Add IO#ttyname that returns the tty name or nil
fdad351501
2024-12-02 08:03:30 +00:00
Nobuyoshi Nakada
13f04e5beb [ruby/io-console] Load the built extension library in noctty tests
74c78afc24
2024-04-10 09:10:50 +00:00
Nobuyoshi Nakada
86547fd69d
[ruby/io-console] Move the condition to omit to command line option
32583460e1
2024-01-30 19:19:23 +09:00
Nobuyoshi Nakada
c2cb5b4463
[ruby/io-console] Move the condition to omit outside the method
8b9b5b611a
2024-01-30 19:19:23 +09:00
Nobuyoshi Nakada
818ba30ee9 [ruby/io-console] Avoid the influence of special variable $/
5f71354332
2023-08-18 03:55:04 +00:00
Nobuyoshi Nakada
540cf43205 [ruby/io-console] Enable getpass methods always
57f9649df4
2023-08-18 03:55:02 +00:00
Nobuyoshi Nakada
21ed929e15 [ruby/io-console] Omit on JRuby
9122c181eb
2022-12-02 10:33:36 +00:00
Nobuyoshi Nakada
678bcfcaa6 [ruby/io-console] Check rawmode option names strictly
aa8fc7e947
2022-12-02 10:33:35 +00:00
Alan Wu
7f269a3c2d Fix io/console test for --with-static-linked-ext
The tests looks for the .so file, which doesn't exist when the extension
is statically linked. In that situation it passes -I to ruby with
nothing after it which ate the -rio/console argument.
2022-11-18 18:50:34 -05:00
Hiroshi SHIBATA
892fe9bbba
omit all assertions at TestIO_Console#test_intr when running with FreeBSD 2022-08-23 12:49:46 +09:00
Hiroshi SHIBATA
d448ecc7b1
Fix the missing brackets 2022-07-28 19:25:52 +09:00
Hiroshi SHIBATA
202ce7de01
test_io_console.rbL399 is also randomly failing same as bfc697f1e2 2022-07-28 19:14:01 +09:00
Yusuke Endoh
bfc697f1e2 test/io/console/test_io_console.rb: parens needed 2022-03-08 17:40:02 +09:00
Yusuke Endoh
17e09f033c Skip three tests on FreeBSD 13
Some tests that use signals frequently fail randomly on FreeBSD 13.
Maybe something around signals has changed in FreeBSD 13.
This change skips them tentatively.
2022-03-08 16:06:37 +09:00
Kazuhiro NISHIYAMA
d5836db1b3
Fix Leaked file descriptor: TestIO_Console#test_console_kw
```
Leaked file descriptor: TestIO_Console#test_console_kw: 10 : #<File:/dev/tty>
```
2022-01-05 09:05:52 +09:00
Samuel Williams
f27eb8148f
Sync io-console gem. 2021-12-29 13:27:40 +13:00
Koichi Sasada
38c555a315 show encoding for each path 2021-11-14 02:41:30 +09:00
Yusuke Endoh
4d8d8c9d49 test/io/console/test_io_console.rb: dump debug output to stderr
make test-all in parallel mode seems to hide stdout
2021-11-14 02:35:03 +09:00
Yusuke Endoh
3aa62b455c test/io/console/test_io_console.rb: add debug code
to debug the following failure

http://ci.rvm.jp/results/trunk-test@ruby-sky1/3708240
```
/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `===': incompatible encoding regexp match (US-ASCII regexp with UTF-16BE string) (Encoding::CompatibilityError)
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `each'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `grep'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `<class:TestIO_Console>'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:9:in `<top (required)>'
	<internal:/tmp/ruby/v3/src/trunk-test/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
	<internal:/tmp/ruby/v3/src/trunk-test/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
	/tmp/ruby/v3/src/trunk-test/tool/lib/test/unit/parallel.rb:122:in `run'
	/tmp/ruby/v3/src/trunk-test/tool/lib/test/unit/parallel.rb:211:in `<main>'
running file: /tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb
```
2021-11-12 16:23:00 +09:00
Nobuyoshi Nakada
b9f7286fe9
[ruby/io-console] Skip Interrupt test on Solaris too
48db3616da
2021-10-11 11:33:15 +09:00
Charles Oliver Nutter
abf71864a5
[ruby/io-console] Mark all tests that use run_pty as pend on JRuby
JRuby's PTY.spawn does not produce a process with its own
controlling terminal, which is necessary for testing these raw
escape sequences. This commit marks those tests as pending.

The functionality tested appears to work at a command line, but
due to this PTY bug in JRuby we cannot test it this way.

See https://github.com/jruby/jruby/issues/6552

a486b72e5e
b5c8e7bfd8
2021-02-05 12:29:33 +09:00
Charles Oliver Nutter
a1cc044ea1
[ruby/io-console] Use omit instead of skip
This test runs with test/unit now, which defines omit instead of
skip.

bd731d0b8d
2021-02-05 12:01:38 +09:00
Charles Oliver Nutter
2a764fe764
[ruby/io-console] Skip test on JRuby
The subprocess script here works fine at a command line, but when
run as a pty subprocess during the tests the master side hangs
waiting for output.

4a21610ece
2021-02-05 12:01:38 +09:00
Charles Oliver Nutter
8960d6b5bd
[ruby/io-console] Add console.rb to search for paths
74567376c4
2021-02-05 12:01:38 +09:00
Nobuyoshi Nakada
9ef7780b09
[ruby/io-console] Run subprocesses without test libraries
Now io/console is loaded from test-unit indirectly, test-unit
requires power_assert which requires io/console.

8817d07951
639cce89de
2021-02-05 11:45:04 +09:00
Nobuyoshi Nakada
ead8d89bd7 [ruby/io-console] Ignore chomp! result and return the modified string
09e5ccc729
2021-01-05 21:26:11 +09:00
Nobuyoshi Nakada
a79966743c [ruby/io-console] Fix timeout type error (#18)
Fixed TypeError when IO#getch timed out

`rb_io_wait` returns a bit-flags Integer representing available
events, or Qfalse if timed out.  Also the result of `NUM2INT` is
not a `VALUE`.

```
$ ./bin/ruby -v -rio/console -e "p IO.console.getch(intr: true, time: 0.1)"
ruby 3.0.0dev (2020-10-09T20:27:30Z master 5ea2ea74cc) [x64-mingw32]
-e:1:in `getch': no implicit conversion of false into Integer (TypeError)
        from -e:1:in `<main>'
```

3bdfaf62df
2020-10-11 02:00:24 +09:00
Leam Hall
f4b9e94317
[ruby/io-console] Bug 17128: In test_set_winsize_console, wrapped re-size in a begin-rescue-else.
a22333c33a
2020-08-27 23:46:02 +09:00
Nobuyoshi Nakada
883214f8e9
Use %w instead of %i not to create unused IDs 2020-05-09 20:13:30 +09:00
Yusuke Endoh
595e74ae4b test/io/console/test_io_console.rb: Rescue Errno::ENXIO for Solaris
20200509T100003Z.fail.html.gz
```
  1) Failure:
TestIO_Console#test_failed_path [/export/home/users/chkbuild/cb-gcc/tmp/build/20200509T100003Z/ruby/test/io/console/test_io_console.rb:40]:
[Errno::ENODEV, Errno::ENOTTY, Errno::EBADF] exception expected, not #<Errno::ENXIO: No such device or address - /dev/null>.
```
2020-05-09 20:07:38 +09:00
Nobuyoshi Nakada
581763d14c [ruby/io-console] Fails with EBADF on mingw
530cec574c
2020-05-09 14:51:43 +09:00
Nobuyoshi Nakada
d7a59e2ffe
[ruby/io-console] Expanded expected errors
May fail with ENOTTY instead of ENODEV.

fe117b89e0
2020-05-09 14:46:08 +09:00
Nobuyoshi Nakada
cc9bc14530 [ruby/io-console] Added test for failed path
06a540f9b4
2020-05-09 13:57:04 +09:00
Charles Oliver Nutter
569f56e0f7 [ruby/io-console] Filter Ruby engine name rather than just /ruby/
This breaks tests using this path on JRuby because the `jruby`
executable turns into `jjruby` after the sub.

e5951aa34c
2020-01-18 00:15:00 +09:00
Nobuyoshi Nakada
31e2f03512 [ruby/io-console] Enable only interrupt bits on intr: true
baaf929041
2019-12-29 16:26:22 +09:00
Nobuyoshi Nakada
c147eeff7c [ruby/io-console] Skip Interrupt test on Linux
Hangs up only in ruby/ruby on Travis-CI.

de39aa6dd6
2019-12-18 13:30:52 +09:00
Nobuyoshi Nakada
77e3078ede [ruby/io-console] Set raw mode strictly same as cfmakeraw
* Default VMIN and VTIME to minimum input.
* Disable parity check bits explicitly.
* Disable all bits for flow control on input.

Co-Authored-By: NARUSE, Yui <naruse@airemix.jp>

5ce201a686
2019-12-18 10:33:05 +09:00
Nobuyoshi Nakada
07ed8f2f91 [ruby/io-console] Skip interrupt
8ed5a2bcc3
2019-12-18 00:08:04 +09:00
Nobuyoshi Nakada
905a926ea8 [ruby/io-console] Timeout in the child process
b8411689a5
2019-12-17 23:55:24 +09:00
Nobuyoshi Nakada
4b7d27ca0d [ruby/io-console] Use IO.console instead of STDIN
9e3ec5b936
2019-12-17 23:55:22 +09:00
Nobuyoshi Nakada
81eb2d16ef
[ruby/io-console] Disable implementation-defined special control characters
In raw mode with interrupt enabled.

e9e8e3ff17
2019-12-17 13:55:04 +09:00
Nobuyoshi Nakada
ec89a0f803
[ruby/io-console] Added the test for intr option
4f01db102d
2019-12-17 13:55:04 +09:00
Yusuke Endoh
0bca34ddaa test/io/console/test_io_console.rb: add a memo for the mysterious hack 2019-12-05 16:56:08 +09:00
Yusuke Endoh
b40bb27e35 test/io/console/test_io_console.rb: Try the hack for Solaris
I'm not entirely sure why, but test_set_winsize_console gets stuck on
Solaris (and if I recall, macOS).  I found a hack for FreeBSD, so I want
to give it a try on Solaris too.
2019-12-05 15:53:29 +09:00
Nobuyoshi Nakada
b1c92363a7
Wait for the main thread to start reading by Queue
Otherwise, the written data to pty before the reading started may
be just lost.
2019-12-02 13:17:05 +09:00
Kazuhiro NISHIYAMA
c99fb0f41e
Revert "[ruby/io-console] Skip cursor position test on Solaris"
This reverts commit 5294ded681.
2019-09-25 09:48:44 +09:00
Nobuyoshi Nakada
c60451d9cd [ruby/io-console] Unique paths to be added
a3ad851b6c
2019-09-25 09:43:31 +09:00
Nobuyoshi Nakada
fc9eb5b9c1 [ruby/io-console] Load the current libraries
ab7653c543
2019-09-25 09:43:29 +09:00