blob: ad7b8fe5fa5bfc2d9a73918de0e72dc3d037bf66 [file] [log] [blame]
Alexander Shishkin535584c2010-03-15 15:38:09 +01001#!/bin/sh
2# Copyright 2010 Nokia Corporation
3# Written by Alexander Shishkin
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02004# Licensed under GPLv2 or later, see file LICENSE in this source tree.
Alexander Shishkin535584c2010-03-15 15:38:09 +01005
6. ./testing.sh
7
8# testing "test name" "command(s)" "expected result" "file input" "stdin"
9
10optional FEATURE_AR_CREATE
11
12rm test.a 2>/dev/null
13testing "ar creates archives" \
14 "ar rc test.a README && ar p test.a README | md5sum" \
15 "$(md5sum <README)\n" \
16 "" \
17 ""
Denys Vlasenkobb0bf282016-06-19 21:54:04 +020018rm test.a 2>/dev/null
Alexander Shishkin535584c2010-03-15 15:38:09 +010019
20testing "ar replaces things in archives" \
Denys Vlasenkobfa1b2e2010-05-11 03:53:57 +020021 "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 Shishkin535584c2010-03-15 15:38:09 +010022 "blast!\n" \
23 "" \
24 ""
Denys Vlasenkobfa1b2e2010-05-11 03:53:57 +020025rm test.a file1 file1 2>/dev/null
Alexander Shishkin535584c2010-03-15 15:38:09 +010026
27exit $FAILCOUNT