File: test_rex.sh

package info (click to toggle)
argtable2 6-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,520 kB
  • ctags: 380
  • sloc: sh: 8,918; ansic: 4,305; makefile: 144
file content (29 lines) | stat: -rwxr-xr-x 896 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

fail ()
    { 
    echo "$0 TESTS FAILED";
    exit 1;
    }

echo $0 TESTS BEGIN

#these tests should all return zero (parse succeeded)
./test_rex --help || fail
./test_rex --beta world goodbye || fail
./test_rex GoodBye --beta World || fail
./test_rex --beta world GOODBYE GoodBye Goodbye gOoDbyE Anything || fail
./test_rex --beta world GOODBYE AnyHow || fail
./test_rex -a hello --beta world GOODBYE AnyHow || fail

#these tests should all return non-zero (parse failed)
./test_rex && fail
./test_rex --beta WORLD goodbye && fail
./test_rex --beta World goodby  && fail
./test_rex --beta world GOODBYE GoodBye Goodbye gOoDbyE Anything goodbye && fail
./test_rex --beta world GOODBYE GoodBye Goodbye gOoDbyE Anything Anytime && fail
./test_rex --beta world GOODBYE GoodBye Goodbye gOoDbyE Anything -a Hello && fail

echo "$0 TESTS PASSED"
echo "----------------------------------"