]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/usr.bin/ncal/regress.sh
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / usr.bin / ncal / regress.sh
1 # $FreeBSD$
2
3 CAL_BIN="ncal"
4 CAL="${CAL_BIN} -C"
5 NCAL="${CAL_BIN} -N"
6 YEARS="2008 2009 2010 2011"
7 ONEYEAR="2009"
8
9 REGRESSION_START($1)
10
11 #
12 # The first tests are layout tests, to make sure that the output is still the
13 # same despite varying months.
14 #
15
16 # Full year calendars
17
18 echo 1..16
19
20 for y in ${YEARS}; do
21         # Regular calendar, Month days, No-highlight
22         REGRESSION_TEST(`r-y${y}-md-nhl', `$NCAL -h ${y}')
23         # Backwards calendar, Month days, No-highlight
24         REGRESSION_TEST(`b-y${y}-md-nhl', `$CAL -h ${y}')
25         # Regular calendar, Julian days, No-highlight
26         REGRESSION_TEST(`r-y${y}-jd-nhl', `$NCAL -jh ${y}')
27         # Backwards calendar, Julian days, No-highlight
28         REGRESSION_TEST(`b-y${y}-jd-nhl', `$CAL -jh ${y}')
29 done
30
31 # 3 month calendars
32
33 echo 17 .. 29
34
35 for m in $(jot -w %02d 12); do
36         # Regular calendar, Month days, No-highlight
37         REGRESSION_TEST(`r-3m${ONEYEAR}${m}-md-nhl',
38             `$NCAL -h3 ${m} ${ONEYEAR}')
39         # Backwards calendar, Month days, No-highlight
40         REGRESSION_TEST(`b-3m${ONEYEAR}${m}-md-nhl', `$CAL -h3 ${m} ${ONEYEAR}')
41         # Regular calendar, Julian days, No-highlight
42         REGRESSION_TEST(`r-3m${ONEYEAR}${m}-jd-nhl',
43             `$NCAL -jh3 ${m} ${ONEYEAR}')
44         # Backwards calendar, Julian days, No-highlight
45         REGRESSION_TEST(`b-3m${ONEYEAR}${m}-jd-nhl', `$CAL -jh3 ${m} ${ONEYEAR}')
46 done
47
48 #
49 # The next tests are combinations of the various arguments.
50 #
51
52 # These should fail
53 REGRESSION_TEST(`f-3y-nhl',  `$NCAL -3 -y 2>&1')
54 REGRESSION_TEST(`f-3A-nhl',  `$NCAL -3 -A 3 2>&1')
55 REGRESSION_TEST(`f-3B-nhl',  `$NCAL -3 -B 3 2>&1')
56 REGRESSION_TEST(`f-3gy-nhl', `$NCAL -3 2008 2>&1')
57 REGRESSION_TEST(`f-3AB-nhl', `$NCAL -3 -A 3 -B 3 2>&1')
58 REGRESSION_TEST(`f-mgm-nhl', `$NCAL -m 3 2 2008 2>&1')
59 REGRESSION_TEST(`f-ym-nhl',  `$NCAL -y -m 2 2>&1')
60 REGRESSION_TEST(`f-ygm-nhl', `$NCAL -y 2 2008 2>&1')
61 REGRESSION_TEST(`f-yA-nhl',  `$NCAL -y -A 3 2>&1')
62 REGRESSION_TEST(`f-yB-nhl',  `$NCAL -y -B 3 2>&1')
63 REGRESSION_TEST(`f-yAB-nhl', `$NCAL -y -A 3 -B 3 2>&1')
64
65 # These should be successful
66
67 REGRESSION_TEST(`s-b-3-nhl',    `$CAL -d 2008.03 -3')
68 REGRESSION_TEST(`s-b-A-nhl',    `$CAL -d 2008.03 -A 1')
69 REGRESSION_TEST(`s-b-B-nhl',    `$CAL -d 2008.03 -B 1')
70 REGRESSION_TEST(`s-b-AB-nhl',   `$CAL -d 2008.03 -A 1 -B 1')
71 REGRESSION_TEST(`s-b-m-nhl',    `$CAL -d 2008.03 -m 1')
72 REGRESSION_TEST(`s-b-mgy-nhl',  `$CAL -d 2008.03 -m 1 2007')
73 REGRESSION_TEST(`s-b-gmgy-nhl', `$CAL -d 2008.03 1 2007')
74 REGRESSION_TEST(`s-r-3-nhl',    `$NCAL -d 2008.03 -3')
75 REGRESSION_TEST(`s-r-A-nhl',    `$NCAL -d 2008.03 -A 1')
76 REGRESSION_TEST(`s-r-B-nhl',    `$NCAL -d 2008.03 -B 1')
77 REGRESSION_TEST(`s-r-AB-nhl',   `$NCAL -d 2008.03 -A 1 -B 1')
78 REGRESSION_TEST(`s-r-m-nhl',    `$NCAL -d 2008.03 -m 1')
79 REGRESSION_TEST(`s-r-mgy-nhl',  `$NCAL -d 2008.03 -m 1 2007')
80 REGRESSION_TEST(`s-r-gmgy-nhl', `$NCAL -d 2008.03 1 2007')
81
82 REGRESSION_END()