Results for sh-options.test.sh

statusoshosh-cpp
pass 4442
ok 22
N-I 22
FAIL 24
total5050
caseoshosh-cppdescription
0pass pass $- with -c
1pass pass $- with pipefail
2pass pass $- and more options
3pass FAIL $- with interactive shell
details
4pass pass pass short options like sh -e
5pass pass pass long options like sh -o errexit
6pass pass pass shopt options like sh -O nullglob
7pass pass can continue after unknown option
8pass pass set with both options and argv
9pass pass set -o vi/emacs
10pass pass vi and emacs are mutually exclusive
11pass FAIL interactive shell starts with emacs mode on
details
12pass pass nounset
13pass pass -u is nounset
14pass pass nounset with "$@"
15pass pass set -u -- clears argv
16pass pass set -u -- x y z
17pass pass reset option with long flag
18pass pass reset option with short flag
19pass pass set -eu (flag parsing)
20FAIL FAIL -n for no execution (useful with --ast-output)
detailsdetails
21pass pass pipefail
22pass pass shopt -p -o prints 'set' options
23pass pass shopt -o prints 'set' options
24pass pass shopt -p prints 'shopt' options
25pass pass shopt with no flags prints options
26pass pass noclobber off
27pass pass noclobber on
28pass pass noclobber on <>
29pass pass SHELLOPTS is updated when options are changed
30ok ok SHELLOPTS is readonly
detailsdetails
31FAIL FAIL SHELLOPTS and BASHOPTS are set
detailsdetails
32ok ok set - -
detailsdetails
33pass pass set -o lists options
34pass pass set without args lists variables
35pass pass 'set' and 'eval' round trip
36N-I N-I set without args and array variables (not in OSH)
detailsdetails
37N-I N-I set without args and assoc array variables (not in OSH)
detailsdetails
38pass pass shopt -q
39pass pass shopt -q invalid
40pass pass shopt -s strict:all
41pass pass shopt allows for backward compatibility like bash
42pass pass shopt -p validates option names
43pass pass shopt -p -o validates option names
44pass pass stubbed out bash options
45pass pass shopt -s nounset works in YSH, not in bash
46pass pass Unimplemented options - print, query, set, unset
47pass pass Unimplemented options - OSH shopt -s ignore_shopt_not_impl
48pass pass shopt -p exit code (regression)
49pass pass no-ops not shown by shopt -p
86 passed, 4 OK, 4 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh-cpp3 $- with interactive shell

[osh-cpp stdout] Expected 'FALSE\nTRUE\n', got 'FALSE\n'
[osh-cpp status] Expected 0, got 1

stdout:
FALSE
stderr:
AddressSanitizer:DEADLYSIGNAL
=================================================================
==21018==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000001c (pc 0x559f2b847fd3 bp 0x7fff0049a370 sp 0x7fff0049a350 T0)
==21018==The signal is caused by a READ memory access.
==21018==Hint: address points to the zero page.
    #0 0x559f2b847fd2 in iolib::SignalSafe::PollSigWinch() (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x13afd2)
    #1 0x559f2b8fb948 in comp_ui::_IDisplay::_GetTerminalWidth() _gen/bin/oils_for_unix.mycpp.cc:21086
    #2 0x559f2b8fb896 in comp_ui::_IDisplay::_IDisplay(comp_ui::State*, comp_ui::PromptState*, int, mylib::Writer*, util::_DebugFile*, iolib::SignalSafe*) _gen/bin/oils_for_unix.mycpp.cc:21081
    #3 0x559f2b8fbf88 in comp_ui::MinimalDisplay::MinimalDisplay(comp_ui::State*, comp_ui::PromptState*, util::_DebugFile*, iolib::SignalSafe*) _gen/bin/oils_for_unix.mycpp.cc:21128
    #4 0x559f2bc0bb2f in comp_ui::MinimalDisplay* Alloc<comp_ui::MinimalDisplay, comp_ui::State*&, comp_ui::PromptState*&, util::_DebugFile*&, iolib::SignalSafe*&>(comp_ui::State*&, comp_ui::PromptState*&, util::_DebugFile*&, iolib::SignalSafe*&) (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x4feb2f)
    #5 0x559f2baf7b76 in shell::Main(BigStr*, args::Reader*, Dict<BigStr*, BigStr*>*, bool, pyutil::_ResourceLoader*, py_readline::Readline*) _gen/bin/oils_for_unix.mycpp.cc:59043
    #6 0x559f2b867899 in oils_for_unix::AppBundleMain(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:10735
    #7 0x559f2b867de5 in oils_for_unix::main(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:10767
    #8 0x559f2bafb1d8 in main _gen/bin/oils_for_unix.mycpp.cc:59180
    #9 0x7f4e455c309a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #10 0x559f2b845fd9 in _start (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x138fd9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x13afd2) in iolib::SignalSafe::PollSigWinch()
==21018==ABORTING
osh-cpp11 interactive shell starts with emacs mode on

[osh-cpp stdout] Expected 'non-interactive\n1\n1\ninteractive\n0\n1\n', got 'non-interactive\n1\n1\ninteractive\n'
[osh-cpp status] Expected 0, got 1

stdout:
non-interactive
1
1
interactive
stderr:
osh warning: --rcfile ignored in non-interactive shell
AddressSanitizer:DEADLYSIGNAL
=================================================================
==21238==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000001c (pc 0x564cd7a0ffd3 bp 0x7ffdf4270f50 sp 0x7ffdf4270f30 T0)
==21238==The signal is caused by a READ memory access.
==21238==Hint: address points to the zero page.
    #0 0x564cd7a0ffd2 in iolib::SignalSafe::PollSigWinch() (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x13afd2)
    #1 0x564cd7ac3948 in comp_ui::_IDisplay::_GetTerminalWidth() _gen/bin/oils_for_unix.mycpp.cc:21086
    #2 0x564cd7ac3896 in comp_ui::_IDisplay::_IDisplay(comp_ui::State*, comp_ui::PromptState*, int, mylib::Writer*, util::_DebugFile*, iolib::SignalSafe*) _gen/bin/oils_for_unix.mycpp.cc:21081
    #3 0x564cd7ac3f88 in comp_ui::MinimalDisplay::MinimalDisplay(comp_ui::State*, comp_ui::PromptState*, util::_DebugFile*, iolib::SignalSafe*) _gen/bin/oils_for_unix.mycpp.cc:21128
    #4 0x564cd7dd3b2f in comp_ui::MinimalDisplay* Alloc<comp_ui::MinimalDisplay, comp_ui::State*&, comp_ui::PromptState*&, util::_DebugFile*&, iolib::SignalSafe*&>(comp_ui::State*&, comp_ui::PromptState*&, util::_DebugFile*&, iolib::SignalSafe*&) (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x4feb2f)
    #5 0x564cd7cbfb76 in shell::Main(BigStr*, args::Reader*, Dict<BigStr*, BigStr*>*, bool, pyutil::_ResourceLoader*, py_readline::Readline*) _gen/bin/oils_for_unix.mycpp.cc:59043
    #6 0x564cd7a2f899 in oils_for_unix::AppBundleMain(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:10735
    #7 0x564cd7a2fde5 in oils_for_unix::main(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:10767
    #8 0x564cd7cc31d8 in main _gen/bin/oils_for_unix.mycpp.cc:59180
    #9 0x7fed0803809a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #10 0x564cd7a0dfd9 in _start (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x138fd9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x13afd2) in iolib::SignalSafe::PollSigWinch()
==21238==ABORTING
osh20 -n for no execution (useful with --ast-output)

[osh stdout] Expected '1\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
osh-cpp20 -n for no execution (useful with --ast-output)

[osh-cpp stdout] Expected '1\n', got '1\n2\n3\n'

stdout:
1
2
3
stderr:
osh30 SHELLOPTS is readonly

stdout:
stderr: 
  SHELLOPTS=x
  ^~~~~~~~~~
[ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS'
osh-cpp30 SHELLOPTS is readonly

stdout:
stderr: 
  SHELLOPTS=x
  ^~~~~~~~~~
[ stdin ]:1: fatal: Can't assign to readonly value 'SHELLOPTS'
osh31 SHELLOPTS and BASHOPTS are set

[osh status] Expected 0, got 1

stdout:
stderr: 
  echo shellopts ${SHELLOPTS:?} > /dev/null
                   ^~~~~~~~~
[ stdin ]:1: fatal: Var SHELLOPTS is empty
osh-cpp31 SHELLOPTS and BASHOPTS are set

[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo shellopts ${SHELLOPTS:?} > /dev/null
                   ^~~~~~~~~
[ stdin ]:1: fatal: Var SHELLOPTS is empty
osh32 set - -

stdout:
a b
- a b
a b
- -
- +
+ -
--
stderr:
osh-cpp32 set - -

stdout:
a b
- a b
a b
- -
- +
+ -
--
stderr:
osh36 set without args and array variables (not in OSH)

stdout:
stderr: 
osh-cpp36 set without args and array variables (not in OSH)

stdout:
stderr: 
osh37 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
  __assoc[a]=b
  ^~~~~~~~
[ stdin ]:3: fatal: Assoc array keys must be strings: $x 'x' "$x" etc. (OILS-ERR-101)
osh-cpp37 set without args and assoc array variables (not in OSH)

stdout:
stderr: 
  __assoc[a]=b
  ^~~~~~~~
[ stdin ]:3: fatal: Assoc array keys must be strings: $x 'x' "$x" etc. (OILS-ERR-101)