1f08c3bdfSopenharmony_ci#!/bin/sh
2f08c3bdfSopenharmony_ci# SPDX-License-Identifier: GPL-2.0-or-later
3f08c3bdfSopenharmony_ci# Copyright (c) International Business Machines Corp., 2000
4f08c3bdfSopenharmony_ci# Copyright (c) 2016 Cyril Hrubis <chrubis@suse.cz>
5f08c3bdfSopenharmony_ci# Author: Robbie Williamson <robbiew@us.ibm.com>
6f08c3bdfSopenharmony_ci#
7f08c3bdfSopenharmony_ci# This is a basic $AR command test.
8f08c3bdfSopenharmony_ci
9f08c3bdfSopenharmony_ciAR="${AR:=ar}"
10f08c3bdfSopenharmony_ciTST_CNT=17
11f08c3bdfSopenharmony_ciTST_SETUP=setup
12f08c3bdfSopenharmony_ciTST_TESTFUNC=test
13f08c3bdfSopenharmony_ciTST_NEEDS_TMPDIR=1
14f08c3bdfSopenharmony_ciTST_NEEDS_CMDS="$AR"
15f08c3bdfSopenharmony_ci
16f08c3bdfSopenharmony_cisetup()
17f08c3bdfSopenharmony_ci{
18f08c3bdfSopenharmony_ci	MOD=
19f08c3bdfSopenharmony_ci	$AR --help | grep "use zero for timestamps and uids/gids (default)" >/dev/null
20f08c3bdfSopenharmony_ci	[ $? -eq 0 ] && MOD="U"
21f08c3bdfSopenharmony_ci}
22f08c3bdfSopenharmony_ci
23f08c3bdfSopenharmony_citest1()
24f08c3bdfSopenharmony_ci{
25f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
26f08c3bdfSopenharmony_ci	ROD $AR -ra"$MOD" file1.in lib.a $TST_DATAROOT/file2.in
27f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
28f08c3bdfSopenharmony_ci
29f08c3bdfSopenharmony_ci	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
30f08c3bdfSopenharmony_ci
31f08c3bdfSopenharmony_ci	if diff ar.out ar.exp >/dev/null; then
32f08c3bdfSopenharmony_ci		tst_res TPASS "$AR added new file after another (-a)"
33f08c3bdfSopenharmony_ci	else
34f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to add new file after another (-a)"
35f08c3bdfSopenharmony_ci		cat ar.out
36f08c3bdfSopenharmony_ci	fi
37f08c3bdfSopenharmony_ci
38f08c3bdfSopenharmony_ci	ROD rm lib.a
39f08c3bdfSopenharmony_ci}
40f08c3bdfSopenharmony_ci
41f08c3bdfSopenharmony_citest2()
42f08c3bdfSopenharmony_ci{
43f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
44f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in
45f08c3bdfSopenharmony_ci	ROD $AR -ma"$MOD" file1.in lib.a file4.in
46f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
47f08c3bdfSopenharmony_ci
48f08c3bdfSopenharmony_ci	printf "file1.in\nfile4.in\nfile2.in\nfile3.in\n" > ar.exp
49f08c3bdfSopenharmony_ci
50f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
51f08c3bdfSopenharmony_ci		tst_res TPASS "$AR moved file correctly (-ma)"
52f08c3bdfSopenharmony_ci	else
53f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to move file (-ma)"
54f08c3bdfSopenharmony_ci		cat ar.out
55f08c3bdfSopenharmony_ci	fi
56f08c3bdfSopenharmony_ci
57f08c3bdfSopenharmony_ci	ROD rm lib.a
58f08c3bdfSopenharmony_ci}
59f08c3bdfSopenharmony_ci
60f08c3bdfSopenharmony_citest3()
61f08c3bdfSopenharmony_ci{
62f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
63f08c3bdfSopenharmony_ci	ROD $AR -rb"$MOD" file3.in lib.a $TST_DATAROOT/file2.in
64f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
65f08c3bdfSopenharmony_ci
66f08c3bdfSopenharmony_ci	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
67f08c3bdfSopenharmony_ci
68f08c3bdfSopenharmony_ci	if diff ar.out ar.exp; then
69f08c3bdfSopenharmony_ci		tst_res TPASS "$AR added new file before another (-b)"
70f08c3bdfSopenharmony_ci	else
71f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to add new file before another (-b)"
72f08c3bdfSopenharmony_ci		cat ar.out
73f08c3bdfSopenharmony_ci	fi
74f08c3bdfSopenharmony_ci
75f08c3bdfSopenharmony_ci	ROD rm lib.a
76f08c3bdfSopenharmony_ci}
77f08c3bdfSopenharmony_ci
78f08c3bdfSopenharmony_citest4()
79f08c3bdfSopenharmony_ci{
80f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
81f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file2.in
82f08c3bdfSopenharmony_ci	ROD $AR -mb"$MOD" file3.in lib.a file2.in
83f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
84f08c3bdfSopenharmony_ci
85f08c3bdfSopenharmony_ci	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
86f08c3bdfSopenharmony_ci
87f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
88f08c3bdfSopenharmony_ci		tst_res TPASS "$AR moved file correctly (-mb)"
89f08c3bdfSopenharmony_ci	else
90f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to move file (-mb)"
91f08c3bdfSopenharmony_ci		cat ar.out
92f08c3bdfSopenharmony_ci	fi
93f08c3bdfSopenharmony_ci
94f08c3bdfSopenharmony_ci	ROD rm lib.a
95f08c3bdfSopenharmony_ci}
96f08c3bdfSopenharmony_ci
97f08c3bdfSopenharmony_citest5()
98f08c3bdfSopenharmony_ci{
99f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out
100f08c3bdfSopenharmony_ci
101f08c3bdfSopenharmony_ci	if [ -s ar.out ]; then
102f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR produced output unexpectedly (-c)"
103f08c3bdfSopenharmony_ci		cat ar.out
104f08c3bdfSopenharmony_ci	else
105f08c3bdfSopenharmony_ci		tst_res TPASS "$AR haven't produced output (-c)"
106f08c3bdfSopenharmony_ci	fi
107f08c3bdfSopenharmony_ci
108f08c3bdfSopenharmony_ci	ROD rm lib.a
109f08c3bdfSopenharmony_ci}
110f08c3bdfSopenharmony_ci
111f08c3bdfSopenharmony_citest6()
112f08c3bdfSopenharmony_ci{
113f08c3bdfSopenharmony_ci	ROD $AR -qc"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out
114f08c3bdfSopenharmony_ci
115f08c3bdfSopenharmony_ci	if [ -s ar.out ]; then
116f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR produced output unexpectedly (-qc)"
117f08c3bdfSopenharmony_ci		cat ar.out
118f08c3bdfSopenharmony_ci	else
119f08c3bdfSopenharmony_ci		tst_res TPASS "$AR haven't produced output (-qc)"
120f08c3bdfSopenharmony_ci	fi
121f08c3bdfSopenharmony_ci
122f08c3bdfSopenharmony_ci	ROD rm lib.a
123f08c3bdfSopenharmony_ci}
124f08c3bdfSopenharmony_ci
125f08c3bdfSopenharmony_citest7()
126f08c3bdfSopenharmony_ci{
127f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
128f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file3.in
129f08c3bdfSopenharmony_ci	ROD $AR -d"$MOD" lib.a file1.in file2.in
130f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
131f08c3bdfSopenharmony_ci
132f08c3bdfSopenharmony_ci	printf "file3.in\n" > ar.exp
133f08c3bdfSopenharmony_ci
134f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
135f08c3bdfSopenharmony_ci		tst_res TPASS "$AR deleted files correctly (-d)"
136f08c3bdfSopenharmony_ci	else
137f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR messed up when deleting files (-d)"
138f08c3bdfSopenharmony_ci		cat ar.out
139f08c3bdfSopenharmony_ci	fi
140f08c3bdfSopenharmony_ci
141f08c3bdfSopenharmony_ci	ROD rm lib.a
142f08c3bdfSopenharmony_ci}
143f08c3bdfSopenharmony_ci
144f08c3bdfSopenharmony_citest8()
145f08c3bdfSopenharmony_ci{
146f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
147f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file3.in
148f08c3bdfSopenharmony_ci	ROD $AR -d"$MOD" lib.a
149f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
150f08c3bdfSopenharmony_ci
151f08c3bdfSopenharmony_ci	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
152f08c3bdfSopenharmony_ci
153f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
154f08c3bdfSopenharmony_ci		tst_res TPASS "$AR deleted nothing (-d with empty list)"
155f08c3bdfSopenharmony_ci	else
156f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR deleted files (-d with empty list)"
157f08c3bdfSopenharmony_ci		cat ar.out
158f08c3bdfSopenharmony_ci	fi
159f08c3bdfSopenharmony_ci
160f08c3bdfSopenharmony_ci	ROD rm lib.a
161f08c3bdfSopenharmony_ci}
162f08c3bdfSopenharmony_ci
163f08c3bdfSopenharmony_citest9()
164f08c3bdfSopenharmony_ci{
165f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
166f08c3bdfSopenharmony_ci	ROD $AR -ri"$MOD" file3.in lib.a $TST_DATAROOT/file2.in
167f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
168f08c3bdfSopenharmony_ci
169f08c3bdfSopenharmony_ci	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
170f08c3bdfSopenharmony_ci
171f08c3bdfSopenharmony_ci	if diff ar.out ar.exp >/dev/null; then
172f08c3bdfSopenharmony_ci		tst_res TPASS "$AR added new file before another (-i)"
173f08c3bdfSopenharmony_ci	else
174f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to add new file before another (-i"
175f08c3bdfSopenharmony_ci		cat ar.out
176f08c3bdfSopenharmony_ci	fi
177f08c3bdfSopenharmony_ci
178f08c3bdfSopenharmony_ci	ROD rm lib.a
179f08c3bdfSopenharmony_ci}
180f08c3bdfSopenharmony_ci
181f08c3bdfSopenharmony_citest10()
182f08c3bdfSopenharmony_ci{
183f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
184f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file2.in
185f08c3bdfSopenharmony_ci	ROD $AR -mi"$MOD" file3.in lib.a file2.in
186f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
187f08c3bdfSopenharmony_ci
188f08c3bdfSopenharmony_ci	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
189f08c3bdfSopenharmony_ci
190f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
191f08c3bdfSopenharmony_ci		tst_res TPASS "$AR moved file correctly (-mi)"
192f08c3bdfSopenharmony_ci	else
193f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to move file (-mi)"
194f08c3bdfSopenharmony_ci		cat ar.out
195f08c3bdfSopenharmony_ci	fi
196f08c3bdfSopenharmony_ci
197f08c3bdfSopenharmony_ci	ROD rm lib.a
198f08c3bdfSopenharmony_ci}
199f08c3bdfSopenharmony_ci
200f08c3bdfSopenharmony_citest11()
201f08c3bdfSopenharmony_ci{
202f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
203f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file2.in
204f08c3bdfSopenharmony_ci	ROD $AR -m"$MOD" lib.a file3.in
205f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
206f08c3bdfSopenharmony_ci
207f08c3bdfSopenharmony_ci	printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
208f08c3bdfSopenharmony_ci
209f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
210f08c3bdfSopenharmony_ci		tst_res TPASS "$AR moved file correctly (-m)"
211f08c3bdfSopenharmony_ci	else
212f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to move file (-m)"
213f08c3bdfSopenharmony_ci		cat ar.out
214f08c3bdfSopenharmony_ci	fi
215f08c3bdfSopenharmony_ci
216f08c3bdfSopenharmony_ci	ROD rm lib.a
217f08c3bdfSopenharmony_ci}
218f08c3bdfSopenharmony_ci
219f08c3bdfSopenharmony_citest12()
220f08c3bdfSopenharmony_ci{
221f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
222f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file3.in
223f08c3bdfSopenharmony_ci	ROD $AR -p"$MOD" lib.a \> ar.out
224f08c3bdfSopenharmony_ci
225f08c3bdfSopenharmony_ci	printf "This is file one\nThis is file two\nThis is file three\n" > ar.exp
226f08c3bdfSopenharmony_ci
227f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
228f08c3bdfSopenharmony_ci		tst_res TPASS "$AR printed file content correctly (-p)"
229f08c3bdfSopenharmony_ci	else
230f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to print file content (-p)"
231f08c3bdfSopenharmony_ci		cat ar.out
232f08c3bdfSopenharmony_ci	fi
233f08c3bdfSopenharmony_ci
234f08c3bdfSopenharmony_ci	ROD rm lib.a
235f08c3bdfSopenharmony_ci}
236f08c3bdfSopenharmony_ci
237f08c3bdfSopenharmony_citest13()
238f08c3bdfSopenharmony_ci{
239f08c3bdfSopenharmony_ci
240f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
241f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file3.in
242f08c3bdfSopenharmony_ci	ROD $AR -q"$MOD" lib.a $TST_DATAROOT/file4.in
243f08c3bdfSopenharmony_ci	ROD $AR -t lib.a \> ar.out
244f08c3bdfSopenharmony_ci
245f08c3bdfSopenharmony_ci	printf "file1.in\nfile2.in\nfile3.in\nfile4.in\n" > ar.exp
246f08c3bdfSopenharmony_ci
247f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
248f08c3bdfSopenharmony_ci		tst_res TPASS "$AR appended file correctly (-q)"
249f08c3bdfSopenharmony_ci	else
250f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to append file (-q)"
251f08c3bdfSopenharmony_ci		cat ar.out
252f08c3bdfSopenharmony_ci	fi
253f08c3bdfSopenharmony_ci
254f08c3bdfSopenharmony_ci	ROD rm lib.a
255f08c3bdfSopenharmony_ci}
256f08c3bdfSopenharmony_ci
257f08c3bdfSopenharmony_citest14()
258f08c3bdfSopenharmony_ci{
259f08c3bdfSopenharmony_ci	ROD touch file0.in
260f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a file0.in $TST_DATAROOT/file1.in
261f08c3bdfSopenharmony_ci
262f08c3bdfSopenharmony_ci	file0_mtime1=$($AR -tv lib.a | grep file0.in)
263f08c3bdfSopenharmony_ci	file1_mtime1=$($AR -tv lib.a | grep file1.in)
264f08c3bdfSopenharmony_ci
265f08c3bdfSopenharmony_ci	touch -c -t $(date --date='next day' +"%Y%m%d%H%M") file0.in
266f08c3bdfSopenharmony_ci
267f08c3bdfSopenharmony_ci	ROD $AR -ru"$MOD" lib.a file0.in $TST_DATAROOT/file1.in
268f08c3bdfSopenharmony_ci
269f08c3bdfSopenharmony_ci	file0_mtime2=$($AR -tv lib.a | grep file0.in)
270f08c3bdfSopenharmony_ci	file1_mtime2=$($AR -tv lib.a | grep file1.in)
271f08c3bdfSopenharmony_ci
272f08c3bdfSopenharmony_ci	if [ "$file0_mtime1" = "$file0_mtime2" ]; then
273f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR haven't updated modified file0 (-u)"
274f08c3bdfSopenharmony_ci	else
275f08c3bdfSopenharmony_ci		tst_res TPASS "$AR updated modified file0 (-u)"
276f08c3bdfSopenharmony_ci	fi
277f08c3bdfSopenharmony_ci
278f08c3bdfSopenharmony_ci	if [ "$file1_mtime1" = "$file1_mtime2" ]; then
279f08c3bdfSopenharmony_ci		tst_res TPASS "$AR haven't updated unmodified file1 (-u)"
280f08c3bdfSopenharmony_ci	else
281f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR updated unmodified file1 (-u)"
282f08c3bdfSopenharmony_ci	fi
283f08c3bdfSopenharmony_ci
284f08c3bdfSopenharmony_ci	ROD rm lib.a file0.in
285f08c3bdfSopenharmony_ci}
286f08c3bdfSopenharmony_ci
287f08c3bdfSopenharmony_citest15()
288f08c3bdfSopenharmony_ci{
289f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in
290f08c3bdfSopenharmony_ci	ROD $AR -tv lib.a \> ar.out
291f08c3bdfSopenharmony_ci
292f08c3bdfSopenharmony_ci	if grep -q '[rwx-]\{9\} [0-9].*/[0-9].*\s*[0-9].*.*file1.in' ar.out; then
293f08c3bdfSopenharmony_ci		tst_res TPASS "$AR verbose listing works (-tv)"
294f08c3bdfSopenharmony_ci	else
295f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR verbose listing failed (-tv)"
296f08c3bdfSopenharmony_ci		cat ar.out
297f08c3bdfSopenharmony_ci	fi
298f08c3bdfSopenharmony_ci
299f08c3bdfSopenharmony_ci	ROD rm lib.a
300f08c3bdfSopenharmony_ci}
301f08c3bdfSopenharmony_ci
302f08c3bdfSopenharmony_citest16()
303f08c3bdfSopenharmony_ci{
304f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
305f08c3bdfSopenharmony_ci			       $TST_DATAROOT/file3.in
306f08c3bdfSopenharmony_ci	ROD $AR -xv"$MOD" lib.a \> ar.out
307f08c3bdfSopenharmony_ci
308f08c3bdfSopenharmony_ci	printf "x - file1.in\nx - file2.in\nx - file3.in\n" > ar.exp
309f08c3bdfSopenharmony_ci
310f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
311f08c3bdfSopenharmony_ci		tst_res TPASS "$AR printed extracted filenames (-xv)"
312f08c3bdfSopenharmony_ci	else
313f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to print extracted filenames (-xv)"
314f08c3bdfSopenharmony_ci		cat ar.out
315f08c3bdfSopenharmony_ci	fi
316f08c3bdfSopenharmony_ci
317f08c3bdfSopenharmony_ci	if [ -e file1.in -a -e file2.in -a -e file3.in ]; then
318f08c3bdfSopenharmony_ci		tst_res TPASS "$AR extracted files correctly"
319f08c3bdfSopenharmony_ci	else
320f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to extract files"
321f08c3bdfSopenharmony_ci	fi
322f08c3bdfSopenharmony_ci
323f08c3bdfSopenharmony_ci	ROD rm -f lib.a file1.in file2.in file3.in
324f08c3bdfSopenharmony_ci}
325f08c3bdfSopenharmony_ci
326f08c3bdfSopenharmony_citest17()
327f08c3bdfSopenharmony_ci{
328f08c3bdfSopenharmony_ci	ROD $AR -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in
329f08c3bdfSopenharmony_ci	ROD $AR -xv"$MOD" lib.a file2.in \> ar.out
330f08c3bdfSopenharmony_ci
331f08c3bdfSopenharmony_ci	printf "x - file2.in\n" > ar.exp
332f08c3bdfSopenharmony_ci
333f08c3bdfSopenharmony_ci	if diff ar.out ar.exp > /dev/null; then
334f08c3bdfSopenharmony_ci		tst_res TPASS "$AR printed extracted filename (-xv)"
335f08c3bdfSopenharmony_ci	else
336f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to print extracted filename (-xv)"
337f08c3bdfSopenharmony_ci		cat ar.out
338f08c3bdfSopenharmony_ci	fi
339f08c3bdfSopenharmony_ci
340f08c3bdfSopenharmony_ci	if [ -e file2.in ]; then
341f08c3bdfSopenharmony_ci		tst_res TPASS "$AR extracted file correctly"
342f08c3bdfSopenharmony_ci	else
343f08c3bdfSopenharmony_ci		tst_res TFAIL "$AR failed to extract file"
344f08c3bdfSopenharmony_ci	fi
345f08c3bdfSopenharmony_ci
346f08c3bdfSopenharmony_ci	ROD rm -f lib.a file2.in
347f08c3bdfSopenharmony_ci}
348f08c3bdfSopenharmony_ci
349f08c3bdfSopenharmony_ci. tst_test.sh
350f08c3bdfSopenharmony_citst_run
351