Results for builtin-getopts.test.sh

statusoshosh_.pyosh_.cc
pass 13111
BUG 330
FAIL 1316
total171717
caseoshosh_.pyosh_.ccdescription
0pass pass FAIL getopts empty
details
1pass pass FAIL getopts sees unknown arg
details
2pass pass FAIL getopts three invocations
details
3pass pass FAIL getopts resets OPTARG
details
4pass pass FAIL Basic getopts invocation
details
5pass pass FAIL getopts with invalid variable name
details
6pass FAIL FAIL getopts with invalid flag
detailsdetails
7pass FAIL FAIL getopts missing required argument
detailsdetails
8pass pass FAIL getopts doesn't look for flags after args
details
9pass pass FAIL getopts with explicit args
details
10pass pass pass OPTIND
11BUG BUG FAIL OPTIND after multiple getopts with same spec
detailsdetailsdetails
12BUG BUG FAIL OPTIND after multiple getopts with different spec
detailsdetailsdetails
13BUG BUG FAIL OPTIND narrowed down
detailsdetailsdetails
14pass pass FAIL Getopts parses the function's arguments
details
15pass pass FAIL Local OPTIND
details
16FAIL FAIL FAIL Flags can be smooshed together, e.g. -ab
detailsdetailsdetails
25 passed, 0 OK, 0 not implemented, 6 BUG, 20 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh_.cc0 getopts empty

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

stdout:
stderr: 
set 2
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc1 getopts sees unknown arg

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

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc2 getopts three invocations

[osh_.cc stdout] Expected u'status=0 opt=h\nstatus=0 opt=c\nstatus=1 opt=?\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
set 5
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc3 getopts resets OPTARG

[osh_.cc stdout] Expected u'status=0 opt=c OPTARG=foo\nstatus=0 opt=h OPTARG=\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
set 5
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc4 Basic getopts invocation

[osh_.cc stdout] Expected 'h=1 c=foo optind=4 argv=x y z\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
set 8
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc5 getopts with invalid variable name

[osh_.cc stdout] Expected 'status=2 opt= OPTARG=foo OPTIND=3\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
set 5
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.py6 getopts with invalid flag

[osh_.py status] Expected 2, got 1

stdout:
ERROR 3
stderr:
osh_.cc6 getopts with invalid flag

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

stdout:
stderr: 
set 4
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.py7 getopts missing required argument

[osh_.py status] Expected 2, got 1

stdout:
ERROR 3
stderr:
[??? no location ???] getopts: option '-c' requires an argument.
(getopts argv: -h -c)
osh_.cc7 getopts missing required argument

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

stdout:
stderr: 
set 4
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc8 getopts doesn't look for flags after args

[osh_.cc stdout] Expected 'h=0 c= optind=1 argv=x -h -c y\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
set 6
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc9 getopts with explicit args

[osh_.cc stdout] Expected 'h=1 c=foo optind=4 argv=A B C\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
set 5
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh11 OPTIND after multiple getopts with same spec

stdout:
1
-
-
4
4
stderr:
osh_.py11 OPTIND after multiple getopts with same spec

stdout:
1
-
-
4
4
stderr:
osh_.cc11 OPTIND after multiple getopts with same spec

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

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh12 OPTIND after multiple getopts with different spec

stdout:
.
2
-
-
5
5
stderr:
osh_.py12 OPTIND after multiple getopts with different spec

stdout:
.
2
-
-
5
5
stderr:
osh_.cc12 OPTIND after multiple getopts with different spec

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

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh13 OPTIND narrowed down

stdout:
a=1 b= c= d=1 e=E
stderr:
osh_.py13 OPTIND narrowed down

stdout:
a=1 b= c= d=1 e=E
stderr:
osh_.cc13 OPTIND narrowed down

[osh_.cc stdout] Expected 'a=1 b= c= d=1 e=E\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc14 Getopts parses the function's arguments

[osh_.cc stdout] Expected 'h=0 c=bar opt=? optind=3 argv=-h -c foo x y z\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
set 8
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh_.cc15 Local OPTIND

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

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.
osh16 Flags can be smooshed together, e.g. -ab

[osh stdout] Expected 'OPTIND=2 opt=a OPTARG=\nOPTIND=3 opt=b OPTARG=hi\nOPTIND=5 opt=c OPTARG=hello\n', got 'OPTIND=2 opt=? OPTARG=\nOPTIND=2 opt=? OPTARG=\nOPTIND=2 opt=? OPTARG=\n'

stdout:
OPTIND=2 opt=? OPTARG=
OPTIND=2 opt=? OPTARG=
OPTIND=2 opt=? OPTARG=
stderr:
osh_.py16 Flags can be smooshed together, e.g. -ab

[osh_.py stdout] Expected 'OPTIND=2 opt=a OPTARG=\nOPTIND=3 opt=b OPTARG=hi\nOPTIND=5 opt=c OPTARG=hello\n', got 'OPTIND=2 opt=? OPTARG=\nOPTIND=2 opt=? OPTARG=\nOPTIND=2 opt=? OPTARG=\n'

stdout:
OPTIND=2 opt=? OPTARG=
OPTIND=2 opt=? OPTARG=
OPTIND=2 opt=? OPTARG=
stderr:
osh_.cc16 Flags can be smooshed together, e.g. -ab

[osh_.cc stdout] Expected 'OPTIND=2 opt=a OPTARG=\nOPTIND=3 opt=b OPTARG=hi\nOPTIND=5 opt=c OPTARG=hello\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:596: V Dict<Str *, Dict<Str *, bool> *>::index(K) [K = Str *, V = Dict<Str *, bool> *]: Assertion `0' failed.