Results for xtrace.test.sh

statusoshosh_.pyosh_.cc
pass 13133
ok 220
FAIL 1113
total161616
caseoshosh_.pyosh_.ccdescription
0pass pass FAIL unset PS4
details
1FAIL FAIL FAIL set -o verbose prints unevaluated code
detailsdetailsdetails
2pass pass FAIL xtrace with unprintable chars
details
3pass pass FAIL xtrace with unicode chars
details
4pass pass FAIL xtrace with tabs
details
5pass pass FAIL xtrace with whitespace, quotes, and backslash
details
6pass pass FAIL xtrace with newlines
details
7pass pass FAIL xtrace written before command executes
details
8pass pass FAIL Assignments and assign builtins
details
9pass pass FAIL [[ ]]
details
10ok ok FAIL PS4 is scoped
detailsdetailsdetails
11ok ok FAIL xtrace with variables in PS4
detailsdetailsdetails
12pass pass pass PS4 with unterminated ${
13pass pass pass PS4 with unterminated $(
14pass pass pass PS4 with runtime error
15pass pass FAIL Reading $? in PS4
details
29 passed, 4 OK, 0 not implemented, 0 BUG, 15 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh_.cc0 unset PS4

[osh_.cc stderr] Expected '+ echo 1\n+ unset PS4\necho 2\n', got '+ echo 1\n+ unset PS4\necho 2\n\ndumb_alloc:\n\tgNumNew = 2252\n\tgNumDelete = 197\n\tgMemPos = 75104\n\n\tgNumMalloc = 186\n\tgNumFree = 0\n\tgMemPos2 = 11568\n'

stdout:
1
2
stderr:
+ echo 1
+ unset PS4
echo 2

dumb_alloc:
	gNumNew = 2252
	gNumDelete = 197
	gMemPos = 75104

	gNumMalloc = 186
	gNumFree = 0
	gMemPos2 = 11568
osh1 set -o verbose prints unevaluated code

[osh stderr] Expected 'x=foo\ny=bar\necho $x\necho $(echo $y)\n', got 'Warning: set -o verbose not implemented\n'

stdout:
foo
bar
stderr:
Warning: set -o verbose not implemented
osh_.py1 set -o verbose prints unevaluated code

[osh_.py stderr] Expected 'x=foo\ny=bar\necho $x\necho $(echo $y)\n', got 'Warning: set -o verbose not implemented\n'

stdout:
foo
bar
stderr:
Warning: set -o verbose not implemented
osh_.cc1 set -o verbose prints unevaluated code

[osh_.cc stdout] Expected 'foo\nbar\n', got ''
[osh_.cc stderr] Expected 'x=foo\ny=bar\necho $x\necho $(echo $y)\n', got "Warning: set -o verbose not implemented\nosh_eval.opt.stripped: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.\ntimeout: the monitored command dumped core\n"
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
Warning: set -o verbose not implemented
osh_eval.opt.stripped: cpp/posix.h:74: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
timeout: the monitored command dumped core
osh_.cc2 xtrace with unprintable chars

[osh_.cc stderr] Expected "+ echo $'a\\x03b\\x04c\\x00d'\n", got "+ echo $'a\\x03b\\x04c\\x00d'\n\ndumb_alloc:\n\tgNumNew = 2175\n\tgNumDelete = 190\n\tgMemPos = 73776\n\n\tgNumMalloc = 166\n\tgNumFree = 0\n\tgMemPos2 = 11360\n"

stdout:
abcd
stderr:
+ echo $'a\x03b\x04c\x00d'

dumb_alloc:
	gNumNew = 2175
	gNumDelete = 190
	gMemPos = 73776

	gNumMalloc = 166
	gNumFree = 0
	gMemPos2 = 11360
osh_.cc3 xtrace with unicode chars

[osh_.cc stderr] Expected "+ echo '[\xce\xbc]' '[\xce\xbc]'\n", got "+ echo $'[\xce\xbc]' $'[\xce\xbc]'\n\ndumb_alloc:\n\tgNumNew = 2251\n\tgNumDelete = 210\n\tgMemPos = 75648\n\n\tgNumMalloc = 177\n\tgNumFree = 0\n\tgMemPos2 = 11504\n"

stdout:
[μ] [μ]
stderr:
+ echo $'[μ]' $'[μ]'

dumb_alloc:
	gNumNew = 2251
	gNumDelete = 210
	gMemPos = 75648

	gNumMalloc = 177
	gNumFree = 0
	gMemPos2 = 11504
osh_.cc4 xtrace with tabs

[osh_.cc stderr] Expected "+ echo $'[\\t]'\n", got "+ echo $'[\\t]'\n\ndumb_alloc:\n\tgNumNew = 2116\n\tgNumDelete = 182\n\tgMemPos = 72144\n\n\tgNumMalloc = 142\n\tgNumFree = 0\n\tgMemPos2 = 10944\n"

stdout:
[	]
stderr:
+ echo $'[\t]'

dumb_alloc:
	gNumNew = 2116
	gNumDelete = 182
	gMemPos = 72144

	gNumMalloc = 142
	gNumFree = 0
	gMemPos2 = 10944
osh_.cc5 xtrace with whitespace, quotes, and backslash

[osh_.cc stderr] Expected '+ echo \'1 2\' $\'\\\'\' \'"\' $\'\\\\\'\n', got '+ echo \'1 2\' $\'\\\'\' \'"\' $\'\\\\\'\n\ndumb_alloc:\n\tgNumNew = 2107\n\tgNumDelete = 189\n\tgMemPos = 71616\n\n\tgNumMalloc = 152\n\tgNumFree = 0\n\tgMemPos2 = 11024\n'

stdout:
1 2 ' " \
stderr:
+ echo '1 2' $'\'' '"' $'\\'

dumb_alloc:
	gNumNew = 2107
	gNumDelete = 189
	gMemPos = 71616

	gNumMalloc = 152
	gNumFree = 0
	gMemPos2 = 11024
osh_.cc6 xtrace with newlines

[osh_.cc stderr] Expected "+ echo $'[\\n]'\n", got "+ echo $'[\\n]'\n\ndumb_alloc:\n\tgNumNew = 1994\n\tgNumDelete = 161\n\tgMemPos = 68448\n\n\tgNumMalloc = 109\n\tgNumFree = 0\n\tgMemPos2 = 10336\n"

stdout:
[
]
stderr:
+ echo $'[\n]'

dumb_alloc:
	gNumNew = 1994
	gNumDelete = 161
	gMemPos = 68448

	gNumMalloc = 109
	gNumFree = 0
	gMemPos2 = 10336
osh_.cc7 xtrace written before command executes

[osh_.cc stderr] Expected '+ echo one\none\n+ echo two\ntwo\n', got "osh_eval.opt.stripped: cpp/posix.h:111: void posix::dup2(int, int): Assertion `0' failed.\ntimeout: the monitored command dumped core\n"
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt.stripped: cpp/posix.h:111: void posix::dup2(int, int): Assertion `0' failed.
timeout: the monitored command dumped core
osh_.cc8 Assignments and assign builtins

[osh_.cc stderr] Expected '+ x=1\n+ x=2\n+ echo 2\n+ readonly x=3\n', got '+ x=1\n+ x=2\n+ echo 2\n+ readonly x=3\n\ndumb_alloc:\n\tgNumNew = 2165\n\tgNumDelete = 199\n\tgMemPos = 73280\n\n\tgNumMalloc = 127\n\tgNumFree = 0\n\tgMemPos2 = 10624\n'

stdout:
2
stderr:
+ x=1
+ x=2
+ echo 2
+ readonly x=3

dumb_alloc:
	gNumNew = 2165
	gNumDelete = 199
	gMemPos = 73280

	gNumMalloc = 127
	gNumFree = 0
	gMemPos2 = 10624
osh_.cc9 [[ ]]

[osh_.cc stderr] Expected "+ dir='/'\n+ [[ -d $dir ]]\n+ (( a = 42 ))\n", got "+ dir='/'\n+ [[ -d $dir ]]\nosh_eval.opt.stripped: cpp/osh_bool_stat.h:37: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str*): Assertion `0' failed.\ntimeout: the monitored command dumped core\n"
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
+ dir='/'
+ [[ -d $dir ]]
osh_eval.opt.stripped: cpp/osh_bool_stat.h:37: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str*): Assertion `0' failed.
timeout: the monitored command dumped core
osh10 PS4 is scoped

stdout:
one
func
two
stderr:
+ echo one
+ f
+ local PS4='- '
- echo func
+ echo two
osh_.py10 PS4 is scoped

stdout:
one
func
two
stderr:
+ echo one
+ f
+ local PS4='- '
- echo func
+ echo two
osh_.cc10 PS4 is scoped

[osh_.cc stderr] Expected "+ echo one\n+ f\n+ local PS4='- '\n- echo func\n+ echo two\n", got "+ echo one\n+ f\n+ local PS4='- '\n- echo func\n+ echo two\n\ndumb_alloc:\n\tgNumNew = 2529\n\tgNumDelete = 254\n\tgMemPos = 83696\n\n\tgNumMalloc = 238\n\tgNumFree = 0\n\tgMemPos2 = 12400\n"

stdout:
one
func
two
stderr:
+ echo one
+ f
+ local PS4='- '
- echo func
+ echo two

dumb_alloc:
	gNumNew = 2529
	gNumDelete = 254
	gMemPos = 83696

	gNumMalloc = 238
	gNumFree = 0
	gMemPos2 = 12400
osh11 xtrace with variables in PS4

stdout:
one
two
stderr:
+1:x=1
+1:echo one
+2:x=2
+2:echo two
osh_.py11 xtrace with variables in PS4

stdout:
one
two
stderr:
+1:x=1
+1:echo one
+2:x=2
+2:echo two
osh_.cc11 xtrace with variables in PS4

[osh_.cc stderr] Expected '+1:x=1\n+1:echo one\n+2:x=2\n+2:echo two\n', got '+1:x=1\n+1:echo one\n+2:x=2\n+2:echo two\n\ndumb_alloc:\n\tgNumNew = 2301\n\tgNumDelete = 211\n\tgMemPos = 76304\n\n\tgNumMalloc = 198\n\tgNumFree = 0\n\tgMemPos2 = 11728\n'

stdout:
one
two
stderr:
+1:x=1
+1:echo one
+2:x=2
+2:echo two

dumb_alloc:
	gNumNew = 2301
	gNumDelete = 211
	gMemPos = 76304

	gNumMalloc = 198
	gNumFree = 0
	gMemPos2 = 11728
osh_.cc15 Reading $? in PS4

[osh_.cc stderr] Expected '[last=0] false\n[last=1] echo ok\n', got '[last=0] false\n[last=1] echo ok\n\ndumb_alloc:\n\tgNumNew = 2092\n\tgNumDelete = 171\n\tgMemPos = 70976\n\n\tgNumMalloc = 139\n\tgNumFree = 0\n\tgMemPos2 = 10784\n'

stdout:
ok
stderr:
[last=0] false
[last=1] echo ok

dumb_alloc:
	gNumNew = 2092
	gNumDelete = 171
	gMemPos = 70976

	gNumMalloc = 139
	gNumFree = 0
	gMemPos2 = 10784