busybox/testsuite/ar.tests
Alexander Shishkin 535584c750 ar: add archive creation support
function                                             old     new   delta
ar_main                                              184     542    +358
output_ar_header                                       -     166    +166
copy_data                                              -      54     +54
filter_replaceable                                     -      19     +19
get_header_ar                                        409     414      +5
header_verbose_list_ar                                85      88      +3
static.msg_unsupported_err                            28       -     -28
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 3/0 up/down: 605/-28)           Total: 577 bytes

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-15 15:38:09 +01:00

28 lines
703 B
Bash
Executable File

#!/bin/sh
# Copyright 2010 Nokia Corporation
# Written by Alexander Shishkin
# Licensed under GPL v2 or later, see file LICENSE for details
. ./testing.sh
# testing "test name" "command(s)" "expected result" "file input" "stdin"
optional FEATURE_AR_CREATE
rm test.a 2>/dev/null
testing "ar creates archives" \
"ar rc test.a README && ar p test.a README | md5sum" \
"$(md5sum <README)\n" \
"" \
""
rm test.a
testing "ar replaces things in archives" \
"echo 'blah!' >file1 && echo 'blast!'> file2 && ar cr test.a README file1 file2 && mv file2 file1 && ar cr test.a file1 && ar p test.a file1" \
"blast!\n" \
"" \
""
rm test.a
exit $FAILCOUNT