Results for errexit-oil.test.sh

statusoshosh_.pyosh_.cc
pass 30245
FAIL 0625
total303030
caseoshosh_.pyosh_.ccdescription
0pass pass FAIL command sub: errexit is NOT inherited and outer shell keeps going
details
1pass pass FAIL command sub with inherit_errexit only
details
2pass pass pass strict_errexit and assignment builtins (local, export, readonly ...)
3pass FAIL FAIL strict_errexit and command sub in export / readonly
detailsdetails
4pass pass FAIL strict_errexit allows pipeline because you can set -o pipefail
details
5pass pass FAIL strict_errexit does NOT affect inside of function
details
6pass FAIL FAIL strict_errexit does NOT affect inside of proc
detailsdetails
7pass pass FAIL command sub with command_sub_errexit only
details
8pass pass FAIL command sub with inherit_errexit and command_sub_errexit
details
9pass pass FAIL command sub: last command fails but keeps going and exit code is 0
details
10pass pass FAIL global assignment with command sub: middle command fails
details
11pass pass FAIL global assignment with command sub: last command fails and it aborts
details
12pass pass FAIL local: middle command fails and keeps going
details
13pass pass FAIL local: last command fails and also keeps going
details
14pass pass FAIL local and inherit_errexit / command_sub_errexit
details
15pass pass FAIL global assignment when last status is failure
details
16pass FAIL FAIL strict_errexit prevents errexit from being disabled in function
detailsdetails
17pass pass pass strict_errexit prevents errexit from being disabled in brace group
18pass pass pass strict_errexit prevents errexit from being disabled in subshell
19pass FAIL FAIL strict_errexit and ! && || if while until
detailsdetails
20pass FAIL FAIL if pipeline doesn't fail fatally
detailsdetails
21pass pass FAIL errexit is silent (verbose_errexit for Oil)
details
22pass pass FAIL command sub errexit preserves exit code
details
23pass pass pass strict_errexit without errexit
24pass pass pass What's in strict:all?
25pass pass FAIL command_sub_errexit causes local d=$(date %x) to fail
details
26pass pass FAIL command_sub_errexit and command sub in array
details
27pass pass FAIL OLD: command sub in conditional, with inherit_errexit
details
28pass pass FAIL OLD: command sub in redirect in conditional
details
29pass FAIL FAIL Regression
detailsdetails
59 passed, 0 OK, 0 not implemented, 0 BUG, 31 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh_.cc0 command sub: errexit is NOT inherited and outer shell keeps going

[osh_.cc stdout] Expected 'one two\nparent status=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc1 command sub with inherit_errexit only

[osh_.cc stdout] Expected 'zero\none\nparent status=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.py3 strict_errexit and command sub in export / readonly

[osh_.py stdout] Expected 'a\nstatus=1\na\nstatus=1\na\nb\nstatus=0\n', got 'status=127\nstatus=127\nstatus=127\n'

stdout:
status=127
status=127
status=127
stderr:
  $SH -o errexit -O strict_errexit -c 'echo a; export x=$(might-fail); echo b'
      ^~
[ stdin ]:2: '-o' not found
  $SH -o errexit -O strict_errexit -c 'echo a; readonly x=$(might-fail); echo b'
      ^~
[ stdin ]:4: '-o' not found
  $SH -o errexit -O strict_errexit -c 'echo a; x=$(true); echo b'
      ^~
[ stdin ]:6: '-o' not found
osh_.cc3 strict_errexit and command sub in export / readonly

[osh_.cc stdout] Expected 'a\nstatus=1\na\nstatus=1\na\nb\nstatus=0\n', got 'status=127\nstatus=127\nstatus=127\n'

stdout:
status=127
status=127
status=127
stderr:
  $SH -o errexit -O strict_errexit -c 'echo a; export x=$(might-fail); echo b'
      ^~
[ stdin ]:2: '-o' not found
  $SH -o errexit -O strict_errexit -c 'echo a; readonly x=$(might-fail); echo b'
      ^~
[ stdin ]:4: '-o' not found
  $SH -o errexit -O strict_errexit -c 'echo a; x=$(true); echo b'
      ^~
[ stdin ]:6: '-o' not found
osh_.cc4 strict_errexit allows pipeline because you can set -o pipefail

[osh_.cc stdout] Expected '1\none\n5\nstatus 5 0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc5 strict_errexit does NOT affect inside of function

[osh_.cc stdout] Expected 'before\nx=\nok\nbefore\n', got ''
[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.py6 strict_errexit does NOT affect inside of proc

[osh_.py stdout] Expected 'before\nx=\nok\nbefore\n', got ''
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 74, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 42, in main
    None)
  File "/home/andy/git/oilshell/oil/core/shell_native.py", line 476, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 309, in Batch
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2216, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2078, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2008, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1951, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1841, in ParseCommand
    return self.ParseOilProc()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1738, in ParseOilProc
    self.w_parser.ParseProc(node)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 1095, in ParseProc
    last_token = self.parse_ctx.ParseProc(self.lexer, node)
  File "/home/andy/git/oilshell/oil/frontend/parse_lib.py", line 396, in ParseProc
    pnode, last_token = self.e_parser.Parse(lexer, grammar_nt.oil_proc)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_parse.py", line 311, in Parse
    self.push_parser.setup(start_symbol)
  File "/home/andy/git/oilshell/oil/pgen2/parse.py", line 111, in setup
    self.stack = [_StackItem(self.grammar.dfas[start], 0, newnode)]
AttributeError: 'NoneType' object has no attribute 'dfas'
osh_.cc6 strict_errexit does NOT affect inside of proc

[osh_.cc stdout] Expected 'before\nx=\nok\nbefore\n', got ''
[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/pgen2_parse.cc:8: void parse::Parser::setup(int): Assertion `0' failed.
osh_.cc7 command sub with command_sub_errexit only

[osh_.cc stdout] Expected 'zero\none two\nparent status=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc8 command sub with inherit_errexit and command_sub_errexit

[osh_.cc stdout] Expected 'zero\n', got ''
[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc9 command sub: last command fails but keeps going and exit code is 0

[osh_.cc stdout] Expected 'one\nstatus=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc10 global assignment with command sub: middle command fails

[osh_.cc stdout] Expected 'one\ntwo\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc11 global assignment with command sub: last command fails and it aborts

[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc12 local: middle command fails and keeps going

[osh_.cc stdout] Expected 'good\nstatus=0\none two\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc13 local: last command fails and also keeps going

[osh_.cc stdout] Expected 'good\nstatus=0\none\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc14 local and inherit_errexit / command_sub_errexit

[osh_.cc stdout] Expected 'good\n', got ''
[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc15 global assignment when last status is failure

[osh_.cc stdout] Expected 'status=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.py16 strict_errexit prevents errexit from being disabled in function

[osh_.py stdout] Expected 'fun\nbuiltin ok\nexternal ok\n', got 'fun\nbuiltin ok\n'

stdout:
fun
builtin ok
stderr:
  env echo 'external ok' || true
  ^~~
[ stdin ]:6: 'env' not found
  fun || true  # this fails
      ^~
[ stdin ]:7: errexit was disabled for this construct

  fun || true  # this fails
  ^~~
[ stdin ]:7: fatal: Can't run a proc while errexit is disabled. Use 'try' or wrap it in a process with $0 myproc
osh_.cc16 strict_errexit prevents errexit from being disabled in function

[osh_.cc stdout] Expected 'fun\nbuiltin ok\nexternal ok\n', got 'fun\nbuiltin ok\n'

stdout:
fun
builtin ok
stderr:
  env echo 'external ok' || true
  ^~~
[ stdin ]:6: 'env' not found
  fun || true  # this fails
      ^~
[ stdin ]:7: errexit was disabled for this construct

  fun || true  # this fails
  ^~~
[ stdin ]:7: fatal: Can't run a proc while errexit is disabled. Use 'try' or wrap it in a process with $0 myproc
osh_.py19 strict_errexit and ! && || if while until

[osh_.py stdout] Expected 'bang=1\n--\nor=1\n--\nand=1\n--\nif=1\n--\nwhile=1\n--\nuntil=1\n--\n', got 'bang=127\n--\nor=127\n--\nand=127\n--\nif=127\n--\nwhile=127\n--\nuntil=127\n--\n'

stdout:
bang=127
--
or=127
--
and=127
--
if=127
--
while=127
--
until=127
--
stderr:
  $SH -c "$prelude; ! fun; echo 'should not get here'"
      ^~
[ stdin ]:4: '-c' not found
  $SH -c "$prelude; fun || true"
      ^~
[ stdin ]:7: '-c' not found
  $SH -c "$prelude; fun && true"
      ^~
[ stdin ]:10: '-c' not found
  $SH -c "$prelude; if fun; then true; fi"
      ^~
[ stdin ]:13: '-c' not found
  $SH -c "$prelude; while fun; do echo while; exit; done"
      ^~
[ stdin ]:16: '-c' not found
  $SH -c "$prelude; until fun; do echo until; exit; done"
      ^~
[ stdin ]:19: '-c' not found
osh_.cc19 strict_errexit and ! && || if while until

[osh_.cc stdout] Expected 'bang=1\n--\nor=1\n--\nand=1\n--\nif=1\n--\nwhile=1\n--\nuntil=1\n--\n', got 'bang=127\n--\nor=127\n--\nand=127\n--\nif=127\n--\nwhile=127\n--\nuntil=127\n--\n'

stdout:
bang=127
--
or=127
--
and=127
--
if=127
--
while=127
--
until=127
--
stderr:
  $SH -c "$prelude; ! fun; echo 'should not get here'"
      ^~
[ stdin ]:4: '-c' not found
  $SH -c "$prelude; fun || true"
      ^~
[ stdin ]:7: '-c' not found
  $SH -c "$prelude; fun && true"
      ^~
[ stdin ]:10: '-c' not found
  $SH -c "$prelude; if fun; then true; fi"
      ^~
[ stdin ]:13: '-c' not found
  $SH -c "$prelude; while fun; do echo while; exit; done"
      ^~
[ stdin ]:16: '-c' not found
  $SH -c "$prelude; until fun; do echo until; exit; done"
      ^~
[ stdin ]:19: '-c' not found
osh_.py20 if pipeline doesn't fail fatally

[osh_.py stdout] Expected 'done\n', got ''
[osh_.py status] Expected 0, got 1

stdout:
stderr: 
rmdir: failed to remove '/_tmp': No such file or directory
rm: cannot remove '/bin': Is a directory
rm: cannot remove '/boot': Is a directory
rm: cannot remove '/cdrom': Is a directory
rm: cannot remove '/dev': Is a directory
rm: cannot remove '/etc': Is a directory
rm: cannot remove '/home': Is a directory
rm: cannot remove '/initrd.img': Permission denied
rm: cannot remove '/initrd.img.old': Permission denied
rm: cannot remove '/lib': Is a directory
rm: cannot remove '/lib64': Is a directory
rm: cannot remove '/lost+found': Is a directory
rm: cannot remove '/media': Is a directory
rm: cannot remove '/mnt': Is a directory
rm: cannot remove '/opt': Is a directory
rm: cannot remove '/proc': Is a directory
rm: cannot remove '/root': Is a directory
rm: cannot remove '/run': Is a directory
rm: cannot remove '/sbin': Is a directory
rm: cannot remove '/snap': Is a directory
rm: cannot remove '/srv': Is a directory
rm: cannot remove '/swapfile': Permission denied
rm: cannot remove '/sys': Is a directory
rm: cannot remove '/tmp': Is a directory
rm: cannot remove '/usr': Is a directory
rm: cannot remove '/var': Is a directory
rm: cannot remove '/vmlinuz': Permission denied
rm: cannot remove '/vmlinuz.old': Permission denied
  rm -f $TMP/*
  ^~
[ stdin ]:11: fatal: Exiting with status 1 (command in PID 4699)
osh_.cc20 if pipeline doesn't fail fatally

[osh_.cc stdout] Expected 'done\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
rmdir: failed to remove '/_tmp': No such file or directory
rm: cannot remove '/bin': Is a directory
rm: cannot remove '/boot': Is a directory
rm: cannot remove '/cdrom': Is a directory
rm: cannot remove '/dev': Is a directory
rm: cannot remove '/etc': Is a directory
rm: cannot remove '/home': Is a directory
rm: cannot remove '/initrd.img': Permission denied
rm: cannot remove '/initrd.img.old': Permission denied
rm: cannot remove '/lib': Is a directory
rm: cannot remove '/lib64': Is a directory
rm: cannot remove '/lost+found': Is a directory
rm: cannot remove '/media': Is a directory
rm: cannot remove '/mnt': Is a directory
rm: cannot remove '/opt': Is a directory
rm: cannot remove '/proc': Is a directory
rm: cannot remove '/root': Is a directory
rm: cannot remove '/run': Is a directory
rm: cannot remove '/sbin': Is a directory
rm: cannot remove '/snap': Is a directory
rm: cannot remove '/srv': Is a directory
rm: cannot remove '/swapfile': Permission denied
rm: cannot remove '/sys': Is a directory
rm: cannot remove '/tmp': Is a directory
rm: cannot remove '/usr': Is a directory
rm: cannot remove '/var': Is a directory
rm: cannot remove '/vmlinuz': Permission denied
rm: cannot remove '/vmlinuz.old': Permission denied
  rm -f $TMP/*
  ^~
[ stdin ]:11: fatal: Exiting with status 1 (command in PID 4730)
osh_.cc21 errexit is silent (verbose_errexit for Oil)

[osh_.cc stderr] Expected u'', got "osh_eval.dbg: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.\n"
[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.
osh_.cc22 command sub errexit preserves exit code

[osh_.cc stdout] Expected 'before\n', got ''
[osh_.cc status] Expected 42, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc25 command_sub_errexit causes local d=$(date %x) to fail

[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc26 command_sub_errexit and command sub in array

[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc27 OLD: command sub in conditional, with inherit_errexit

[osh_.cc stdout] Expected '1 2\nA\ndone\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc28 OLD: command sub in redirect in conditional

[osh_.cc stdout] Expected '2\ntmp_contents\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.py29 Regression

[osh_.py stdout] Expected 'hi\np\n', got 'hi\n'
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
hi
stderr:
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 74, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 42, in main
    None)
  File "/home/andy/git/oilshell/oil/core/shell_native.py", line 476, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 309, in Batch
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2216, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2078, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2008, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1951, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1841, in ParseCommand
    return self.ParseOilProc()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1738, in ParseOilProc
    self.w_parser.ParseProc(node)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 1095, in ParseProc
    last_token = self.parse_ctx.ParseProc(self.lexer, node)
  File "/home/andy/git/oilshell/oil/frontend/parse_lib.py", line 396, in ParseProc
    pnode, last_token = self.e_parser.Parse(lexer, grammar_nt.oil_proc)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_parse.py", line 311, in Parse
    self.push_parser.setup(start_symbol)
  File "/home/andy/git/oilshell/oil/pgen2/parse.py", line 111, in setup
    self.stack = [_StackItem(self.grammar.dfas[start], 0, newnode)]
AttributeError: 'NoneType' object has no attribute 'dfas'
osh_.cc29 Regression

[osh_.cc stdout] Expected 'hi\np\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/pgen2_parse.cc:8: void parse::Parser::setup(int): Assertion `0' failed.