run-file () { local spec_name=$1; shift; local spec_file=spec/$spec_name.test.sh; local suite; suite=$(test/sh_spec.py --print-spec-suite $spec_file); local spec_subdir; case $suite in osh) spec_subdir='osh-cpp' ;; ysh) spec_subdir='ysh-cpp' ;; *) die "Invalid suite $suite" ;; esac; local base_dir=_tmp/spec/$spec_subdir; mkdir -v -p $base_dir; sh-spec $spec_file --timeout 10 --oils-bin-dir $PWD/bin --oils-cpp-bin-dir $REPO_ROOT/_bin/cxx-asan --tsv-output $base_dir/${spec_name}.tsv "$@" } ysh-stdlib-testing: spec test case results

Results for ysh-stdlib-testing.test.sh

statusyshysh-cpp
FAIL 55
total55
caseyshysh-cppdescription
0FAIL FAIL value.Expr test - positional test
detailsdetails
1FAIL FAIL value.Expr test - named test
detailsdetails
2FAIL FAIL assert builtin
detailsdetails
3FAIL FAIL ysh --tool test file
detailsdetails
4FAIL FAIL Describe Prototype
detailsdetails
0 passed, 0 OK, 0 not implemented, 0 BUG, 5 failed, 0 timeouts, 0 cases skipped
5 failed under osh

Details on runs that didn't PASS

ysh0 value.Expr test - positional test

[ysh stdout] Expected '', got 'TODO\nparens\nexpr\n(Int) 43\n\nbrackets\nexpr\n(Expr) <Expr 0x7f6e15eb1cf8>\n\nexpr in parens\nexpr\n(Expr) <Expr 0x7f6e15ec4170>\n\n'

stdout:
TODO
parens
expr
(Int)   43

brackets
expr
(Expr)   <Expr 0x7f6e15eb1cf8>

expr in parens
expr
(Expr)   <Expr 0x7f6e15ec4170>

stderr:
ysh-cpp0 value.Expr test - positional test

[ysh-cpp stdout] Expected '', got 'TODO\nparens\nexpr\n(Int) 43\n\nbrackets\nexpr\n(Expr) <Expr 0x40c9>\n\nexpr in parens\nexpr\n(Expr) <Expr 0x5375>\n\n'

stdout:
TODO
parens
expr
(Int)   43

brackets
expr
(Expr)   <Expr 0x40c9>

expr in parens
expr
(Expr)   <Expr 0x5375>

stderr:
ysh1 value.Expr test - named test

[ysh stdout] Expected '', got 'TODO\nparens\nn\n(Int) 43\n\nbrackets\nn\n(Expr) <Expr 0x7f906c507cf8>\n\nexpr in parens\nn\n(Expr) <Expr 0x7f906c51a170>\n\nno value\nn\n(Expr) <Expr 0x7f906c4c9d40>\n\n'

stdout:
TODO
parens
n
(Int)   43

brackets
n
(Expr)   <Expr 0x7f906c507cf8>

expr in parens
n
(Expr)   <Expr 0x7f906c51a170>

no value
n
(Expr)   <Expr 0x7f906c4c9d40>

stderr:
ysh-cpp1 value.Expr test - named test

[ysh-cpp stdout] Expected '', got 'TODO\nparens\nn\n(Int) 43\n\nbrackets\n'
[ysh-cpp status] Expected 0, got 1

stdout:
TODO
parens
n
(Int)   43

brackets
stderr:
AddressSanitizer:DEADLYSIGNAL
=================================================================
==31980==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000004 (pc 0x5607684f18a7 bp 0x7ffe76c09ce0 sp 0x7ffe76c09be0 T0)
==31980==The signal is caused by a READ memory access.
==31980==Hint: address points to the zero page.
    #0 0x5607684f18a6 in Dict<BigStr*, value_asdl::value_t*>::hash_and_probe(BigStr*) const /home/uke/oil/mycpp/gc_dict.h:308
    #1 0x56076840dd2e in Dict<BigStr*, value_asdl::value_t*>::set(BigStr*, value_asdl::value_t*) /home/uke/oil/mycpp/gc_dict.h:394
    #2 0x5607683b8578 in func_proc::EvalTypedArgsToProc(expr_eval::ExprEvaluator*, state::MutableOpts*, syntax_asdl::command__Simple*, runtime_asdl::cmd_value__Argv*) _gen/bin/oils_for_unix.mycpp.cc:53142
    #3 0x5607682cf5fa in cmd_eval::CommandEvaluator::_DoSimple(syntax_asdl::command__Simple*, runtime_asdl::CommandStatus*) _gen/bin/oils_for_unix.mycpp.cc:34668
    #4 0x5607682daae1 in cmd_eval::CommandEvaluator::_Dispatch(syntax_asdl::command_t*, runtime_asdl::CommandStatus*) _gen/bin/oils_for_unix.mycpp.cc:35538
    #5 0x5607682dd0b8 in cmd_eval::CommandEvaluator::_Execute(syntax_asdl::command_t*) _gen/bin/oils_for_unix.mycpp.cc:35781
    #6 0x5607682dec88 in cmd_eval::CommandEvaluator::ExecuteAndCatch(syntax_asdl::command_t*, int) _gen/bin/oils_for_unix.mycpp.cc:35939
    #7 0x56076824756e in main_loop::Batch(cmd_eval::CommandEvaluator*, cmd_parse::CommandParser*, ui::ErrorFormatter*, int) _gen/bin/oils_for_unix.mycpp.cc:23876
    #8 0x5607683e64bb in shell::Main(BigStr*, args::Reader*, Dict<BigStr*, BigStr*>*, bool, pyutil::_ResourceLoader*, py_readline::Readline*) _gen/bin/oils_for_unix.mycpp.cc:56203
    #9 0x56076819e019 in oils_for_unix::AppBundleMain(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:12121
    #10 0x56076819e67b in oils_for_unix::main(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:12157
    #11 0x5607683e846c in main _gen/bin/oils_for_unix.mycpp.cc:56225
    #12 0x7f74f33c209a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #13 0x560768177fc9 in _start (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x192fc9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/uke/oil/mycpp/gc_dict.h:308 in Dict<BigStr*, value_asdl::value_t*>::hash_and_probe(BigStr*) const
==31980==ABORTING
ysh2 assert builtin

[ysh stdout] Expected '', got 'TODO\nhi from assert\n(Expr) <Expr 0x7fddbe9bfcb0>\n\nvalue\n(Bool) true\n(Bool) true\n(Str) "default fail message"\nOK\nhi from assert\n(Expr) <Expr 0x7fddbe9bfe60>\n\nvalue\n(Bool) false\n(Bool) false\n(Str) "default fail message"\n'
[ysh status] Expected 0, got 3

stdout:
TODO
hi from assert
(Expr)   <Expr 0x7fddbe9bfcb0>

value
(Bool)   true
(Bool)   true
(Str)   "default fail message"
OK
hi from assert
(Expr)   <Expr 0x7fddbe9bfe60>

value
(Bool)   false
(Bool)   false
(Str)   "default fail message"
stderr:
      var m = evalExpr(fail_message)
                       ^~~~~~~~~~~~
stdlib/testing.ysh:39: fatal: Arg 1 should be a Expr, got Str
ysh-cpp2 assert builtin

[ysh-cpp stdout] Expected '', got 'TODO\nhi from assert\n(Expr) <Expr 0x43bd>\n\nvalue\n(Bool) true\n(Bool) true\n(Str) "default fail message"\nOK\nhi from assert\n(Expr) <Expr 0x54bd>\n\nvalue\n(Bool) false\n(Bool) false\n(Str) "default fail message"\n'
[ysh-cpp status] Expected 0, got 3

stdout:
TODO
hi from assert
(Expr)   <Expr 0x43bd>

value
(Bool)   true
(Bool)   true
(Str)   "default fail message"
OK
hi from assert
(Expr)   <Expr 0x54bd>

value
(Bool)   false
(Bool)   false
(Str)   "default fail message"
stderr:
      var m = evalExpr(fail_message)
                       ^~~~~~~~~~~~
stdlib/testing.ysh:39: fatal: Arg 1 should be a Expr, got Str
ysh3 ysh --tool test file

[ysh status] Expected 0, got 1
[ysh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 198, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 170, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 137, in AppBundleMain
    return shell.Main('ysh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1104, in Main
    raise AssertionError('TODO')
AssertionError: TODO
  $SH --tool test mytest.ysh
  ^~~
[ stdin ]:7: errexit PID 32027: command.Simple failed with status 1
ysh-cpp3 ysh --tool test file

[ysh-cpp status] Expected 0, got 134

stdout:
stderr: 
ysh: _gen/bin/oils_for_unix.mycpp.cc:56179: int shell::Main(BigStr*, args::Reader*, Dict<BigStr*, BigStr*>*, bool, pyutil::_ResourceLoader*, py_readline::Readline*): Assertion `0' failed.
  $SH --tool test mytest.ysh
  ^~~
[ stdin ]:7: errexit PID 32049: command.Simple failed with status 134
ysh4 Describe Prototype

[ysh stdout] Expected 'TODO\n', got 'TODO\ndescribe\n'

stdout:
TODO
describe
stderr:
ysh-cpp4 Describe Prototype

[ysh-cpp stdout] Expected 'TODO\n', got 'TODO\ndescribe\n'

stdout:
TODO
describe
stderr: