]> mj.ucw.cz Git - libucw.git/blob - ucw/opt.t
Merge branch 'master' into dev-opt
[libucw.git] / ucw / opt.t
1 # Tests of the command line option parser
2
3 Name:   Opt-1
4 Run:    ../obj/ucw/opt-test 2>&1 1>/dev/null || [ $? -eq "2" ]
5 Out:    Required option -t not found.
6         Run with argument --help for more information.
7
8 Name:   Opt-2
9 Run:    ../obj/ucw/opt-test -t95C -w640 -gG darjeeling
10 Out:    English style: no|Chosen teapot: glass|Temperature: 95C|Verbosity: 1|Prayer: no|Water amount: 640|Gas: yes|First tea: darjeeling|Everything OK. Bye.
11
12 Name:   Opt-3
13 Run:    ../obj/ucw/opt-test -vvqvqvhpe -t120F -w4 darjeeling
14 Out:    English style: yes|Chosen teapot: hands|Temperature: 120F|Verbosity: 3|Prayer: yes|Water amount: 4|Gas: no|First tea: darjeeling|Everything OK. Bye.
15
16 Name:   Opt-4
17 Run:    ../obj/ucw/opt-test -t120F -w4 puerh darjeeling earl-grey
18 Out:    English style: no|Temperature: 120F|Verbosity: 1|Prayer: no|Water amount: 4|Gas: no|First tea: puerh|Boiling a tea: darjeeling|Boiling a tea: earl-grey|Everything OK. Bye.
19
20 Name:   Opt-5
21 Run:    ../obj/ucw/opt-test -ghx 2>&1 1>/dev/null || [ $? -eq "2" ]
22 Out:    Multiple switches: -h
23         Run with argument --help for more information.
24
25 Name:   Opt-6
26 Run:    ../obj/ucw/opt-test -t120F -w4 -b15 -he -- --puerh darjeeling earl-grey
27 Out:    English style: yes|Chosen teapot: hands|Temperature: 120F|Verbosity: 1|Black magic: 15|Prayer: no|Water amount: 4|Gas: no|First tea: --puerh|Boiling a tea: darjeeling|Boiling a tea: earl-grey|Everything OK. Bye.
28
29 Name:   Opt-7
30 Run:    ../obj/ucw/opt-test -t120F -w4 -b15 -b54 -he -- --puerh darjeeling earl-grey
31 Out:    English style: yes|Chosen teapot: hands|Temperature: 120F|Verbosity: 1|Black magic: 15|Black magic: 54|Prayer: no|Water amount: 4|Gas: no|First tea: --puerh|Boiling a tea: darjeeling|Boiling a tea: earl-grey|Everything OK. Bye.
32
33 Name:   Opt-Conf-1
34 Run:    ../obj/ucw/opt-test -h --dumpconfig 2>&1 1>/dev/null || [ $? -eq "2" ]
35 Out:    Config options (-C, -S) must stand before other options.
36         Run with argument --help for more information.
37
38 Name:   Opt-Hook-1
39 Run:    ../obj/ucw/opt-test -Ht 95C -w640 -gG darjeeling
40 Out:    [HOOK-postval:H/show-hooks=(null)] [HOOK-preval:t/temperature=95C] [HOOK-postval:t/temperature=95C] [HOOK-prearg] [HOOK-preval:w/water=640] [HOOK-postval:w/water=640] [HOOK-prearg] [HOOK-preval:g/glass-set=(null)] [HOOK-postval:g/glass-set=(null)] [HOOK-preval:G/with-gas=(null)] [HOOK-postval:G/with-gas=(null)] [HOOK-prearg] [HOOK-preval:\ 1/(null)=darjeeling] [HOOK-postval:\ 1/(null)=darjeeling] English style: no|Chosen teapot: glass|Temperature: 95C|Verbosity: 1|Prayer: no|Water amount: 640|Gas: yes|First tea: darjeeling|Everything OK. Bye.