Commit graph

155 commits

Author SHA1 Message Date
Sorah Fukumori
47988e63d6 test_readline#test_without_tty: Use EnvUtil.rubybin
`ruby` is not always available in certain build environments and
configure options. Choose appropriate command line using EnvUtil.
2022-12-21 09:40:09 +09:00
aycabta
20dae14ba9 Increase wait time 2021-12-25 00:20:53 +09:00
aycabta
a88169bbe9 Wait for output results to test correctly 2021-12-25 00:20:53 +09:00
aycabta
0aca70e559 Output log after loading class to test 2021-12-24 22:29:06 +09:00
aycabta
0fbf1f193a Add logging about timeout 2021-12-24 20:55:59 +09:00
aycabta
5138ef3875 Kill process before assertion fails 2021-12-24 20:44:02 +09:00
Nobuyoshi Nakada
517964d57b
Move embedded lines outside the here document
So that the actually run test code corresponds to the source file
line-by-line.
2021-12-24 17:33:45 +09:00
aycabta
f8a0ef30b2 Set time limit for waiting for terminating process within a test 2021-12-24 17:12:01 +09:00
Yusuke Endoh
6cf7c0a48f test/readline/test_readline.rb: skip a test on i686-linux
... because readline library (or libtinfo) seems to cause SEGV
internally even with Readline 8.1.

This SEGV is caught as SystemStackError, which leads to a test failure.
20211109T030008Z.fail.html.gz
```
  1) Failure:
TestReadline#test_interrupt_in_other_thread [/home/chkbuild/chkbuild/tmp/build/20211109T030008Z/ruby/test/readline/test_readline.rb:568]:
Unknown failure with exit status pid 13097 exit 1
Log: ** START **Readline::VERSION is 8.1.
/home/chkbuild/chkbuild/tmp/build/20211109T030008Z/tmp/interrupt_in_other_thread20211109-6272-kcfqxo:13:in `readline': stack level too deep (SystemStackError)
	from /home/chkbuild/chkbuild/tmp/build/20211109T030008Z/tmp/interrupt_in_other_thread20211109-6272-kcfqxo:13:in `block in <main>'
/home/chkbuild/chkbuild/tmp/build/20211109T030008Z/tmp/interrupt_in_other_thread20211109-6272-kcfqxo:13:in `readline': stack level too deep (SystemStackError)
	from /home/chkbuild/chkbuild/tmp/build/20211109T030008Z/tmp/interrupt_in_other_thread20211109-6272-kcfqxo:13:in `block in <main>'
```
2021-11-09 14:52:48 +09:00
Yusuke Endoh
905b6aaa7c test/readline/test_readline.rb: Use TERM=vt100 to run the tests
Readline seems to emit an escape sequence `"\e[?1034h` at an
unpredictable timing when `TERM=xterm` or something.
This leads to a noisy random test failure.

20211102T063005Z.fail.html.gz
```
  1) Failure:
TestReadline#test_modify_text_in_pre_input_hook [/home/chkbuild/chkbuild/tmp/build/20211102T063005Z/ruby/test/readline/test_readline.rb:404]:
<"> hello world\n"> expected but was
<"\e[?1034h> hello world\n">.
```

This test is for Ruby's readline extension, not for readline library
itself. So here this change force to use "TERM=vt100" to run the tests.
2021-11-02 17:28:23 +09:00
aycabta
b4efa37d98 [ruby/readline-ext] Omit Editline on without tty test
a2835ce957
2021-09-03 03:34:09 +09:00
aycabta
67eaa222cf Add a test for Readline.readline without tty 2021-09-01 17:29:01 +09:00
aycabta
9f88135f78 [ruby/readline-ext] Give up Editline
d924cfc1e6
2021-08-14 22:13:56 +09:00
aycabta
5196b171d9 Revert "Try to run test_interrupt_in_other_thread with Editline"
This reverts commit c66b27efbb.
2021-08-12 19:47:41 +09:00
aycabta
c66b27efbb Try to run test_interrupt_in_other_thread with Editline 2021-08-12 15:35:05 +09:00
aycabta
e5f6cd7045 Outer block is required to rescue Timeout::Error 2021-08-12 07:52:39 +09:00
aycabta
c06b39d1d1 Add TODO comment to #test_interrupt_in_other_thread 2021-08-11 17:45:31 +09:00
aycabta
c59da370a5 Add comments about testing steps 2021-08-11 14:08:45 +09:00
aycabta
4f324514aa Put the result of the process into a variable once
To make the meaning of assertion easier to understand,
2021-08-11 14:08:45 +09:00
aycabta
01e49af81d Stop exiting to show "SUCCESS" 2021-08-11 14:08:45 +09:00
aycabta
2217b82af1 Add logging about Errno::EPIPE 2021-08-11 14:08:45 +09:00
aycabta
7d84251500 Write log to stdout immediately 2021-08-11 14:08:45 +09:00
aycabta
67e06102a3 Stop checking char from "read"
Because it's sometimes nil due to race condition.
2021-08-11 14:08:45 +09:00
aycabta
7b10f55354 Break immediately if assertions finished 2021-08-11 14:08:45 +09:00
aycabta
7319b1fa2c Add "START" log 2021-08-11 14:08:45 +09:00
aycabta
cc1d88daba Add comment about I/O that is not tty 2021-08-10 02:52:56 +09:00
aycabta
5e633fb99e Omit on Readline 7.0 because it's wrong behaviour for not TTY env 2021-08-09 18:17:07 +09:00
Samuel Williams
6f6a84f2f3 Extended logging for debugging readline failures. 2021-08-09 17:03:33 +12:00
Samuel Williams
48c43f7783 Rework the readline test to be more robust.
- Capture that the child is started by initial log line.
- More robust handling of child status reaping.
- Direct exit without sucess mesage if `#readline` receives input.
2021-08-09 11:40:56 +12:00
aycabta
ca2dd6d35a Use #full_message instead of #backtrace_locations 2021-08-08 15:43:03 +09:00
aycabta
40ccb87a49 Show backtrace locations when I/O timed out 2021-08-08 09:25:12 +09:00
aycabta
e687b6f4da Show Readline::VERSION for debugging 2021-08-06 03:55:58 +09:00
aycabta
9b56668bf8 Omit test_interrupt_in_other_thread with Editline 2021-08-06 03:50:02 +09:00
aycabta
6414334d3c Fix reversal of assertion result 2021-08-06 03:17:51 +09:00
aycabta
cd57b39f79 Fix control structure to preperly catch Timeout::Error 2021-08-06 03:15:58 +09:00
aycabta
1cb5a669d3 Show log when timed out 2021-08-05 19:39:22 +09:00
aycabta
042d4c8133 Remove an unused variable 2021-08-04 23:35:08 +09:00
aycabta
6e55facdb3 Run interrupt test except on Windows 2021-08-04 18:29:42 +09:00
aycabta
aba10ea61e Add a load path to require 'helper' 2021-08-04 18:29:42 +09:00
aycabta
335c12826a Show the log of test_interrupt_in_other_thread when failed 2021-08-04 18:29:42 +09:00
aycabta
17ef7a98ef Check the existence of the test classes 2021-08-04 18:29:42 +09:00
aycabta
5ca0a51ffd Add a test for handling SIGINT in other thread 2021-08-04 18:29:42 +09:00
aycabta
06d52249de Call super method by teardown of tests of Reline as Readline 2021-06-21 22:29:04 +09:00
aycabta
215fd1bf2c Call Reline-specific method in helper file 2021-06-21 22:26:11 +09:00
aycabta
574c8ee9f1 Call Reline.test_reset in teardown of tests for readline definitely 2021-06-21 22:12:14 +09:00
aycabta
e11800e114 Use test encoding for TestRelineAsReadline and TestRelineAsReadlineHistory 2021-06-21 22:12:14 +09:00
Nobuyoshi Nakada
9110021fd2 [ruby/readline-ext] Use omit
f6dff0a9f6
2021-02-18 21:17:42 +09:00
Nobuyoshi Nakada
d84dd66da0
Fixed a typo in an error class name 2020-12-21 18:17:45 +09:00
Nobuyoshi Nakada
9f60ceec54 Suppress bell during the test 2020-07-18 19:33:11 +09:00
aycabta
4a620aff8d Restore class variable setting for tests 2020-05-14 12:27:33 +09:00