OSDN Git Service

* tests/Makefile.am (EXTRA_DIST): lha-test12, lha-test13 and
[lha/lha.git] / tests / lha-test8
1 # -*- shell-script -*-
2 FILENAME=lha-test8
3 message testing timestamp
4 # level 0 header
5 $lha c0 test-tmp-h0.lzh test-[abc]
6                                                         check $? $LINENO
7 # show time stamp
8 $lha vv test-tmp-h0.lzh
9 ls -l test-[abc]
10
11 $lha xw=test-tmp-h0 test-tmp-h0.lzh
12                                                         check $? $LINENO
13 diff -r test-1 test-tmp-h0
14                                                         check $? $LINENO
15 test test-a -nt test-tmp-h0/test-a ||
16 test test-a -ot test-tmp-h0/test-a ||
17 test test-b -nt test-tmp-h0/test-b ||
18 test test-b -ot test-tmp-h0/test-b ||
19 test test-c -nt test-tmp-h0/test-c ||
20 test test-c -ot test-tmp-h0/test-c
21 test $? -ne 0
22                                                         check $? $LINENO
23
24 # level 1 header
25 $lha c1 test-tmp-h1.lzh test-[abc]
26                                                         check $? $LINENO
27 # show time stamp
28 $lha vv test-tmp-h1.lzh
29 ls -l test-[abc]
30
31 $lha xw=test-tmp-h1 test-tmp-h1.lzh
32                                                         check $? $LINENO
33 diff -r test-1 test-tmp-h1
34                                                         check $? $LINENO
35 test test-a -nt test-tmp-h1/test-a ||
36 test test-a -ot test-tmp-h1/test-a ||
37 test test-b -nt test-tmp-h1/test-b ||
38 test test-b -ot test-tmp-h1/test-b ||
39 test test-c -nt test-tmp-h1/test-c ||
40 test test-c -ot test-tmp-h1/test-c
41 test $? -ne 0
42                                                         check $? $LINENO
43
44 # level 2 header
45 $lha c1 test-tmp-h2.lzh test-[abc]
46                                                         check $? $LINENO
47 # show time stamp
48 $lha vv test-tmp-h2.lzh
49 ls -l test-[abc]
50
51 $lha xw=test-tmp-h2 test-tmp-h2.lzh
52                                                         check $? $LINENO
53 diff -r test-1 test-tmp-h2
54                                                         check $? $LINENO
55 test test-a -nt test-tmp-h2/test-a ||
56 test test-a -ot test-tmp-h2/test-a ||
57 test test-b -nt test-tmp-h2/test-b ||
58 test test-b -ot test-tmp-h2/test-b ||
59 test test-c -nt test-tmp-h2/test-c ||
60 test test-c -ot test-tmp-h2/test-c
61 test $? -ne 0
62                                                         check $? $LINENO
63
64 # Note: level 0, 1 header (generic) format use the MS-DOS `ftime'
65 # structure, so it cannot save odd seconds.
66
67 # set even seconds timestamp
68 cp test-a test-tmp-a &&
69 cp test-b test-tmp-b &&
70 cp test-c test-tmp-c &&
71 change_timestamp 01020304.02 test-tmp-a &&
72 change_timestamp 01020304.04 test-tmp-b &&
73 change_timestamp 01020304.06 test-tmp-c
74                                                         check $? $LINENO
75
76 # level 0 header (generic)
77 $lha cg0 test-tmp-hg0.lzh test-tmp-[abc]
78                                                         check $? $LINENO
79 # show time stamp
80 $lha vv test-tmp-hg0.lzh
81 ls -l test-tmp-[abc]
82
83 $lha xw=test-tmp-hg0 test-tmp-hg0.lzh
84                                                         check $? $LINENO
85 diff test-tmp-a test-tmp-hg0/test-tmp-a &&
86 diff test-tmp-b test-tmp-hg0/test-tmp-b &&
87 diff test-tmp-c test-tmp-hg0/test-tmp-c
88                                                         check $? $LINENO
89 test test-tmp-a -nt test-tmp-hg0/test-tmp-a ||
90 test test-tmp-a -ot test-tmp-hg0/test-tmp-a ||
91 test test-tmp-b -nt test-tmp-hg0/test-tmp-b ||
92 test test-tmp-b -ot test-tmp-hg0/test-tmp-b ||
93 test test-tmp-c -nt test-tmp-hg0/test-tmp-c ||
94 test test-tmp-c -ot test-tmp-hg0/test-tmp-c
95 test $? -ne 0
96                                                         check $? $LINENO
97
98 # level 1 header (generic)
99 $lha cg1 test-tmp-hg1.lzh test-tmp-[abc]
100                                                         check $? $LINENO
101 # show time stamp
102 $lha vv test-tmp-hg1.lzh
103 ls -l test-tmp-[abc]
104
105 $lha xw=test-tmp-hg1 test-tmp-hg1.lzh
106                                                         check $? $LINENO
107 diff test-tmp-a test-tmp-hg0/test-tmp-a &&
108 diff test-tmp-b test-tmp-hg0/test-tmp-b &&
109 diff test-tmp-c test-tmp-hg0/test-tmp-c
110                                                         check $? $LINENO
111 test test-tmp-a -nt test-tmp-hg1/test-tmp-a ||
112 test test-tmp-a -ot test-tmp-hg1/test-tmp-a ||
113 test test-tmp-b -nt test-tmp-hg1/test-tmp-b ||
114 test test-tmp-b -ot test-tmp-hg1/test-tmp-b ||
115 test test-tmp-c -nt test-tmp-hg1/test-tmp-c ||
116 test test-tmp-c -ot test-tmp-hg1/test-tmp-c
117 test $? -ne 0
118                                                         check $? $LINENO