scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 53c7d5b80bcac6f01be892f18725fcb42ebfdfd7
parent 37924c4d0f4e809d000f05aebe81aebba20c895f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 19 Feb 2018 18:27:19 +0000

[tests/ar] Add tests for -t

Diffstat:
Atests/ar/execute/30-test-t.sh | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+), 0 deletions(-)

diff --git a/tests/ar/execute/30-test-t.sh b/tests/ar/execute/30-test-t.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +exec >> test.log 2>&1 +set -e + +tmp1=`mktemp` +tmp2=`mktemp` +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 + + +############################################################################ +#list 1st member + +cp master.a file.a + +ar -t file.a file1 > $tmp1 + +cat <<! > $tmp2 +file1 +! + +cmp $tmp1 $tmp2 + +############################################################################ +#print 3rd member + +ar -t file.a file3 > $tmp1 + +cat <<! > $tmp2 +file3 +! + +cmp $tmp1 $tmp2 + +############################################################################ +#print 2nd member with verbose + +ar -tv file.a file2 >$tmp1 + +cat <<! > $tmp2 +rw-r--r-- `id -u`/`id -g` Tue Jan 1 00:00:00 1980 file2 +! + +cmp $tmp1 $tmp2 + +############################################################################ +#print all members + +ar -t file.a file1 file2 file3 >$tmp1 + +cat <<! > $tmp2 +file1 +file2 +file3 +! + +cmp $tmp1 $tmp2 + +#and now with no members in command line + +ar -t file.a > $tmp1 + +cmp $tmp1 $tmp2