2010-03-15 14:38:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2010 Nokia Corporation
|
|
|
|
# Written by Alexander Shishkin
|
2010-08-16 18:14:46 +00:00
|
|
|
# Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
2010-03-15 14:38:09 +00:00
|
|
|
|
|
|
|
. ./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" \
|
|
|
|
"" \
|
|
|
|
""
|
2016-06-19 19:54:04 +00:00
|
|
|
rm test.a 2>/dev/null
|
2010-03-15 14:38:09 +00:00
|
|
|
|
|
|
|
testing "ar replaces things in archives" \
|
2010-05-11 01:53:57 +00:00
|
|
|
"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" \
|
2010-03-15 14:38:09 +00:00
|
|
|
"blast!\n" \
|
|
|
|
"" \
|
|
|
|
""
|
2010-05-11 01:53:57 +00:00
|
|
|
rm test.a file1 file1 2>/dev/null
|
2010-03-15 14:38:09 +00:00
|
|
|
|
|
|
|
exit $FAILCOUNT
|