Alexander Shishkin | 535584c | 2010-03-15 15:38:09 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2010 Nokia Corporation |
| 3 | # Written by Alexander Shishkin |
| 4 | # Licensed under GPL v2 or later, see file LICENSE for details |
| 5 | |
| 6 | . ./testing.sh |
| 7 | |
| 8 | # testing "test name" "command(s)" "expected result" "file input" "stdin" |
| 9 | |
| 10 | optional FEATURE_AR_CREATE |
| 11 | |
| 12 | rm test.a 2>/dev/null |
| 13 | testing "ar creates archives" \ |
| 14 | "ar rc test.a README && ar p test.a README | md5sum" \ |
| 15 | "$(md5sum <README)\n" \ |
| 16 | "" \ |
| 17 | "" |
| 18 | rm test.a |
| 19 | |
| 20 | testing "ar replaces things in archives" \ |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 21 | "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" \ |
Alexander Shishkin | 535584c | 2010-03-15 15:38:09 +0100 | [diff] [blame] | 22 | "blast!\n" \ |
| 23 | "" \ |
| 24 | "" |
Denys Vlasenko | bfa1b2e | 2010-05-11 03:53:57 +0200 | [diff] [blame] | 25 | rm test.a file1 file1 2>/dev/null |
Alexander Shishkin | 535584c | 2010-03-15 15:38:09 +0100 | [diff] [blame] | 26 | |
| 27 | exit $FAILCOUNT |