Results for errexit.test.sh

statusoshosh_.pyosh_.cc
pass 313019
FAIL 0112
total313131
caseoshosh_.pyosh_.ccdescription
0pass pass pass errexit aborts early
1pass pass FAIL errexit for nonexistent command
details
2pass pass FAIL errexit aborts early on pipeline
details
3pass pass pass errexit with { }
4pass pass pass errexit with if and { }
5pass pass FAIL errexit with ||
details
6pass pass FAIL errexit with &&
details
7pass pass pass errexit test && -- from gen-module-init
8pass pass pass errexit test && and fail
9pass pass pass errexit and loop
10pass pass pass errexit and brace group { }
11pass pass FAIL errexit and time { }
details
12pass pass pass errexit with !
13pass pass pass errexit with ! and ;
14pass pass pass errexit with while/until
15pass pass pass errexit with (( ))
16pass pass pass errexit with subshell
17pass pass pass set -o errexit while it's being ignored (moot with strict_errexit)
18pass pass pass set +o errexit while it's being ignored (moot with strict_errexit)
19pass pass pass set +o errexit with 2 levels of ignored
20pass pass FAIL setting errexit in a subshell works but doesn't affect parent shell
details
21pass pass FAIL set errexit while it's ignored in a subshell (moot with strict_errexit)
details
22pass pass pass shopt -s strict:all || true while errexit is on
23pass pass pass errexit double guard
24pass FAIL FAIL background processes respect errexit
detailsdetails
25pass pass FAIL pipeline process respects errexit
details
26pass pass FAIL compound command
details
27pass pass FAIL while loop
details
28pass pass pass set -e enabled in function (regression)
29pass pass pass set -e in function #2
30pass pass FAIL Command sub exit code is lost
details
80 passed, 0 OK, 0 not implemented, 0 BUG, 13 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh_.cc1 errexit for nonexistent command

[osh_.cc status] Expected 127, got 1

stdout:
stderr: 
  nonexistent__ZZ
  ^~~~~~~~~~~~~~~
[ stdin ]:2: 'nonexistent__ZZ' not found
  nonexistent__ZZ
  ^~~~~~~~~~~~~~~
[ stdin ]:2: fatal: Exiting with status 127 (command in PID 30703)

dumb_alloc:
	gNumNew = 1969
	gNumDelete = 140
	gMemPos = 68336

	gNumMalloc = 141
	gNumFree = 0
	gMemPos2 = 10848
osh_.cc2 errexit aborts early on pipeline

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc5 errexit with ||

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc6 errexit with &&

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc11 errexit and time { }

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

stdout:
stderr: 
osh_eval.opt: cpp/core_pyos.h:36: Tuple3<double, double, double> pyos::Time(): Assertion `0' failed.
osh_.cc20 setting errexit in a subshell works but doesn't affect parent shell

[osh_.cc stdout] Expected '1\n2\n3\n5\n6\n', got '5\n6\n1\n2\n3\n'

stdout:
5
6
1
2
3
stderr:
dumb_alloc:
	gNumNew = 2087
	gNumDelete = 168
	gMemPos = 69856

	gNumMalloc = 125
	gNumFree = 0
	gMemPos2 = 10576
  ( echo 1; false; echo 2; set -o errexit; echo 3; false; echo 4; )
                                                   ^~~~~
[ stdin ]:1: fatal: Exiting with status 1 (command in PID 2908)
osh_.cc21 set errexit while it's ignored in a subshell (moot with strict_errexit)

[osh_.cc stdout] Expected '1\n2\n3\n4\n5\n6\n', got '6\n1\n2\n3\n4\n'

stdout:
6
1
2
3
4
stderr:
  false 
  ^~~~~
[ stdin ]:6: fatal: Exiting with status 1 (command in PID 3085)

dumb_alloc:
	gNumNew = 2255
	gNumDelete = 201
	gMemPos = 76032

	gNumMalloc = 164
	gNumFree = 0
	gMemPos2 = 11200
osh_.py24 background processes respect errexit

[osh_.py stderr] Found 'Traceback (most recent'

stdout:
one
stderr:
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 68, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 36, 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 324, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1498, in ExecuteAndCatch
  { echo one; false; echo two; exit 42; } &
              ^~~~~
[ stdin ]:2: fatal: Exiting with status 1 (command in PID 3623)
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1345, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 623, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 477, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/core/executor.py", line 224, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/andy/git/oilshell/oil/core/executor.py", line 123, in RunBuiltin
    builtin_func = self.builtins[builtin_id]
KeyError: 33
osh_.cc24 background processes respect errexit

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

stdout:
one
stderr:
osh_eval.opt: mycpp/mylib.h:674: V Dict<K, V>::index(K) [with K = int; V = vm::_Builtin*]: Assertion `0' failed.
  { echo one; false; echo two; exit 42; } &
              ^~~~~
[ stdin ]:2: fatal: Exiting with status 1 (command in PID 3641)
osh_.cc25 pipeline process respects errexit

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc26 compound command

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:111: void posix::dup2(int, int): Assertion `0' failed.
osh_.cc27 while loop

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:111: void posix::dup2(int, int): Assertion `0' failed.
osh_.cc30 Command sub exit code is lost

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.