Results for introspect.test.sh

statusoshosh_.pyosh_.cc
pass 1021
FAIL 089
total101010
caseoshosh_.pyosh_.ccdescription
0pass FAIL FAIL ${FUNCNAME[@]} array
detailsdetails
1pass FAIL FAIL FUNCNAME with source (scalar or array)
detailsdetails
2pass FAIL FAIL BASH_SOURCE and BASH_LINENO scalar or array (e.g. for virtualenv)
detailsdetails
3pass FAIL FAIL ${FUNCNAME} with prefix/suffix operators
detailsdetails
4pass FAIL FAIL operators on FUNCNAME not allowed by default
detailsdetails
5pass pass FAIL ${FUNCNAME} and "set -u" (OSH regression)
details
6pass pass pass $((BASH_LINENO)) (scalar form in arith)
7pass FAIL FAIL ${BASH_SOURCE[@]} with source and function name
detailsdetails
8pass FAIL FAIL ${BASH_SOURCE[@]} with line numbers
detailsdetails
9pass FAIL FAIL ${BASH_LINENO[@]} is a stack of line numbers for function calls
detailsdetails
13 passed, 0 OK, 0 not implemented, 0 BUG, 17 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh_.py0 ${FUNCNAME[@]} array

[osh_.py stdout] Expected "['f']\n['g', 'f']\n['f']\n", got '(cmd_value.Argv argv:[argv.py f] arg_spids:[27 29])\n(cmd_value.Argv argv:[argv.py g f] arg_spids:[7 9 9])\n(cmd_value.Argv argv:[argv.py f] arg_spids:[42 44])\n'

stdout:
(cmd_value.Argv argv:[argv.py f] arg_spids:[27 29])
(cmd_value.Argv argv:[argv.py g f] arg_spids:[7 9 9])
(cmd_value.Argv argv:[argv.py f] arg_spids:[42 44])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc0 ${FUNCNAME[@]} array

[osh_.cc stdout] Expected "['f']\n['g', 'f']\n['f']\n", got '(cmd_value.Argv argv:[argv.py f] arg_spids:[27 29])\n(cmd_value.Argv argv:[argv.py g f] arg_spids:[7 9 9])\n(cmd_value.Argv argv:[argv.py g f] arg_spids:[42 44 44])\n'

stdout:
(cmd_value.Argv argv:[argv.py f] arg_spids:[27 29])
(cmd_value.Argv argv:[argv.py g f] arg_spids:[7 9 9])
(cmd_value.Argv argv:[argv.py g f] arg_spids:[42 44 44])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.py1 FUNCNAME with source (scalar or array)

[osh_.py stdout] Expected "[' @', 'source', 'f', 'g']\n[' 0', 'source']\n['${}', 'source']\n[' $', 'source']\n-----\n[' @', 'source']\n[' 0', 'source']\n['${}', 'source']\n[' $', 'source']\n-----\n[]\n", got ''
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
stderr: 
[??? no location ???] $HOME isn't defined
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 71, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 35, in main
    status = pure.Main('osh', arg_r, environ, login_shell, loader, None)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 446, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, 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 1464, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1344, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 581, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 489, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 508, in RunSimpleCommand
    status = self.cmd_ev.RunProc(func_node, argv[1:])
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1549, in RunProc
    status = self._Execute(func_node.body)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1344, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 971, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1367, in _ExecuteList
    status = self._Execute(child)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1344, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 581, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 489, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 508, in RunSimpleCommand
    status = self.cmd_ev.RunProc(func_node, argv[1:])
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1549, in RunProc
    status = self._Execute(func_node.body)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1344, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 971, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1367, in _ExecuteList
    status = self._Execute(child)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1344, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 581, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 489, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 495, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 476, in RunBuiltin
    builtin_func = self.builtins[builtin_id]
KeyError: 2
osh_.cc1 FUNCNAME with source (scalar or array)

[osh_.cc stdout] Expected "[' @', 'source', 'f', 'g']\n[' 0', 'source']\n['${}', 'source']\n[' $', 'source']\n-----\n[' @', 'source']\n[' 0', 'source']\n['${}', 'source']\n[' $', 'source']\n-----\n[]\n", got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
[??? no location ???] $HOME isn't defined
osh_eval.dbg: mycpp/mylib.h:596: V Dict<int, vm::_Builtin *>::index(K) [K = int, V = vm::_Builtin *]: Assertion `0' failed.
osh_.py2 BASH_SOURCE and BASH_LINENO scalar or array (e.g. for virtualenv)

[osh_.py stdout] Expected "['']\n['']\n['']\n['']\n['']\n['']\n__\n['spec/testdata/bash-source-string.sh']\n['spec/testdata/bash-source-string.sh']\n['9']\n['9']\n____\n['spec/testdata/bash-source-string2.sh']\n['spec/testdata/bash-source-string2.sh']\n['11']\n['11']\n", got "(cmd_value.Argv argv:[argv.py ''] arg_spids:[4 6])\n(cmd_value.Argv argv:[argv.py ''] arg_spids:[13 15])\n(cmd_value.Argv argv:[argv.py ''] arg_spids:[24 26])\n(cmd_value.Argv argv:[argv.py ''] arg_spids:[33 35])\n(cmd_value.Argv argv:[argv.py ''] arg_spids:[44 46])\n(cmd_value.Argv argv:[argv.py ''] arg_spids:[53 55])\n__\n"
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
(cmd_value.Argv argv:[argv.py ''] arg_spids:[4 6])
(cmd_value.Argv argv:[argv.py ''] arg_spids:[13 15])
(cmd_value.Argv argv:[argv.py ''] arg_spids:[24 26])
(cmd_value.Argv argv:[argv.py ''] arg_spids:[33 35])
(cmd_value.Argv argv:[argv.py ''] arg_spids:[44 46])
(cmd_value.Argv argv:[argv.py ''] arg_spids:[53 55])
__
stderr:
[??? no location ???] $HOME isn't defined
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 71, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 35, in main
    status = pure.Main('osh', arg_r, environ, login_shell, loader, None)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 446, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, 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 1464, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1344, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 581, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 489, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 513, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 476, in RunBuiltin
    builtin_func = self.builtins[builtin_id]
KeyError: 30
osh_.cc2 BASH_SOURCE and BASH_LINENO scalar or array (e.g. for virtualenv)

[osh_.cc stdout] Expected "['']\n['']\n['']\n['']\n['']\n['']\n__\n['spec/testdata/bash-source-string.sh']\n['spec/testdata/bash-source-string.sh']\n['9']\n['9']\n____\n['spec/testdata/bash-source-string2.sh']\n['spec/testdata/bash-source-string2.sh']\n['11']\n['11']\n", got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
[??? no location ???] $HOME isn't defined
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
osh_.py3 ${FUNCNAME} with prefix/suffix operators

[osh_.py stdout] Expected "['5']\n['c']\n['heck']\n", got '(cmd_value.Argv argv:[argv.py 5] arg_spids:[13 15])\n(cmd_value.Argv argv:[argv.py c] arg_spids:[23 25])\n(cmd_value.Argv argv:[argv.py heck] arg_spids:[35 37])\n'

stdout:
(cmd_value.Argv argv:[argv.py 5] arg_spids:[13 15])
(cmd_value.Argv argv:[argv.py c] arg_spids:[23 25])
(cmd_value.Argv argv:[argv.py heck] arg_spids:[35 37])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc3 ${FUNCNAME} with prefix/suffix operators

[osh_.cc stdout] Expected "['5']\n['c']\n['heck']\n", got '(cmd_value.Argv argv:[argv.py 5] arg_spids:[13 15])\n(cmd_value.Argv argv:[argv.py check] arg_spids:[23 25])\n(cmd_value.Argv argv:[argv.py check] arg_spids:[35 37])\n'

stdout:
(cmd_value.Argv argv:[argv.py 5] arg_spids:[13 15])
(cmd_value.Argv argv:[argv.py check] arg_spids:[23 25])
(cmd_value.Argv argv:[argv.py check] arg_spids:[35 37])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.py4 operators on FUNCNAME not allowed by default

[osh_.py stdout] Expected "['check']\n", got '(cmd_value.Argv argv:[argv.py check] arg_spids:[7 9])\n'

stdout:
(cmd_value.Argv argv:[argv.py check] arg_spids:[7 9])
stderr:
Unhandled SimpleCommand
    argv.py "${#FUNCNAME}"
             ^~
[ stdin ]:3: fatal: Array 'FUNCNAME' can't be referred to as a scalar (without @ or *)
osh_.cc4 operators on FUNCNAME not allowed by default

[osh_.cc stdout] Expected "['check']\n", got '(cmd_value.Argv argv:[argv.py check] arg_spids:[7 9])\n'

stdout:
(cmd_value.Argv argv:[argv.py check] arg_spids:[7 9])
stderr:
Unhandled SimpleCommand
    argv.py "${#FUNCNAME}"
    ^~~~~~~
[ stdin ]:3: fatal: Array 'FUNCNAME' can't be referred to as a scalar (without @ or *)
osh_.cc5 ${FUNCNAME} and "set -u" (OSH regression)

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

stdout:
stderr: 
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
osh_.py7 ${BASH_SOURCE[@]} with source and function name

[osh_.py stdout] Expected "[]\n['spec/testdata/bash-source-simple.sh']\n['spec/testdata/bash-source-simple.sh']\n", got '(cmd_value.Argv argv:[argv.py] arg_spids:[4])\n'
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
(cmd_value.Argv argv:[argv.py] arg_spids:[4])
stderr:
[??? no location ???] $HOME isn't defined
Unhandled SimpleCommand
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 71, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 35, in main
    status = pure.Main('osh', arg_r, environ, login_shell, loader, None)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 446, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, 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 1464, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1344, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 581, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 489, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, do_fork)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 513, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/andy/git/oilshell/oil/core/pure.py", line 476, in RunBuiltin
    builtin_func = self.builtins[builtin_id]
KeyError: 30
osh_.cc7 ${BASH_SOURCE[@]} with source and function name

[osh_.cc stdout] Expected "[]\n['spec/testdata/bash-source-simple.sh']\n['spec/testdata/bash-source-simple.sh']\n", got '(cmd_value.Argv argv:[argv.py] arg_spids:[4])\n'
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[argv.py] arg_spids:[4])
stderr:
[??? no location ???] $HOME isn't defined
Unhandled SimpleCommand
osh_eval.dbg: mycpp/mylib.h:596: V Dict<int, vm::_Builtin *>::index(K) [K = int, V = vm::_Builtin *]: Assertion `0' failed.
osh_.py8 ${BASH_SOURCE[@]} with line numbers

[osh_.py stdout] Expected "['begin F funcs', 'f', 'main']\n['begin F files', 'spec/testdata/bash-source.sh', 'spec/testdata/bash-source.sh']\n['begin F lines', '21', '0']\n['G funcs', 'g', 'f', 'main']\n['G files', 'spec/testdata/bash-source-2.sh', 'spec/testdata/bash-source.sh', 'spec/testdata/bash-source.sh']\n['G lines', '15', '21', '0']\n['end F funcs', 'f', 'main']\n['end F', 'spec/testdata/bash-source.sh', 'spec/testdata/bash-source.sh']\n['end F lines', '21', '0']\n", got "(cmd_value.Argv argv:['spec/testdata/bash-source.sh'] arg_spids:[6])\n"

stdout:
(cmd_value.Argv argv:['spec/testdata/bash-source.sh'] arg_spids:[6])
stderr:
[??? no location ???] $HOME isn't defined
Unhandled SimpleCommand
osh_.cc8 ${BASH_SOURCE[@]} with line numbers

[osh_.cc stdout] Expected "['begin F funcs', 'f', 'main']\n['begin F files', 'spec/testdata/bash-source.sh', 'spec/testdata/bash-source.sh']\n['begin F lines', '21', '0']\n['G funcs', 'g', 'f', 'main']\n['G files', 'spec/testdata/bash-source-2.sh', 'spec/testdata/bash-source.sh', 'spec/testdata/bash-source.sh']\n['G lines', '15', '21', '0']\n['end F funcs', 'f', 'main']\n['end F', 'spec/testdata/bash-source.sh', 'spec/testdata/bash-source.sh']\n['end F lines', '21', '0']\n", got "(cmd_value.Argv argv:['spec/testdata/bash-source.sh'] arg_spids:[6])\n"

stdout:
(cmd_value.Argv argv:['spec/testdata/bash-source.sh'] arg_spids:[6])
stderr:
[??? no location ???] $HOME isn't defined
Unhandled SimpleCommand
osh_.py9 ${BASH_LINENO[@]} is a stack of line numbers for function calls

[osh_.py stdout] Expected "[]\n['begin F', '10']\n['G', '6', '10']\n['end F', '10']\n", got "(cmd_value.Argv argv:[argv.py] arg_spids:[68])\n(cmd_value.Argv argv:[argv.py 'begin F' 10] arg_spids:[29 31 35])\n(cmd_value.Argv argv:[argv.py G 6 10] arg_spids:[7 9 11 11])\n(cmd_value.Argv argv:[argv.py 'end F' 10] arg_spids:[51 53 57])\n"

stdout:
(cmd_value.Argv argv:[argv.py] arg_spids:[68])
(cmd_value.Argv argv:[argv.py 'begin F' 10] arg_spids:[29 31 35])
(cmd_value.Argv argv:[argv.py G 6 10] arg_spids:[7 9 11 11])
(cmd_value.Argv argv:[argv.py 'end F' 10] arg_spids:[51 53 57])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc9 ${BASH_LINENO[@]} is a stack of line numbers for function calls

[osh_.cc stdout] Expected "[]\n['begin F', '10']\n['G', '6', '10']\n['end F', '10']\n", got ''
[osh_.cc status] Expected 0, got -11

stdout:
stderr: