shithub: scc

Download patch

ref: c6c3b57966e269e48931d8b1124372467df0454d
parent: c56a7fd3e9ff59442c90189030421c2c0a3aad20
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Feb 21 11:38:06 EST 2018

Split tests in smaller files

This makes easier to debug the problems.

--- a/tests/ar/execute/00-test-q.sh
+++ /dev/null
@@ -1,69 +1,0 @@
-#!/bin/sh
-
-exec >> test.log 2>&1
-
-set -e
-
-trap "rm -f file.a;\
-      rm -f *.tst" 0 2 3
-
-###########################################################################
-#Generate a bunch of files that we can use to test -q
-
-for i in `awk 'BEGIN {for (i=0; i <999; ++i) print i}'`
-do
-	echo $i > $i.tst
-done
-
-
-###########################################################################
-#Append all the generated files one by one
-
-rm -f file.a
-ls | grep .tst | sort -n | xargs -n 1 ar -qv file.a
-
-ar -t file.a |
-tee -a test.log |
-awk '$0 != NR-1 ".tst" {
-	printf "bad line %d:%s\n", NR, $0
-	exit 1
-}'
-
-###########################################################################
-#Appenp all the generated files 10 by 10
-
-rm -f file.a
-ls | grep .tst | sort -n | xargs -n 10 ar -qv file.a
-
-ar -t file.a |
-tee -a test.log |
-awk '$0 != NR-1 ".tst" {
-	printf "bad line %d:%s\n", NR, $0
-	exit 1
-}'
-
-
-###########################################################################
-#Test special cases
-
-#empty file list
-rm -f file.a
-ar -qv file.a
-if ! test -f file.a
-then
-	echo "ar -q didn't generated empty archive" >&2
-	exit 1
-fi
-
-#recursive inclusion
-rm -f file.a
-ar -qv file.a file.a
-
-
-#missed file
-ar -qv file.a badfile.a || true
-if ar -qv file.a badfile.a
-then
-	echo "ar -q failed to detect missed file" >&2
-	exit 1
-fi
--- /dev/null
+++ b/tests/ar/execute/0001-append.sh
@@ -1,0 +1,39 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+###########################################################################
+#Append generated files at once to an empty archive
+
+echo First > file1
+echo Second > file2
+echo Third > file3
+
+rm -f file.a
+ar -qv file.a file1 file2 file3
+
+ar -t file.a > $tmp1
+
+cat <<EOF > $tmp2
+file1
+file2
+file3
+EOF
+
+cmp $tmp1 $tmp2
+
+ar -p file.a > $tmp1
+
+cat <<EOF > $tmp2
+First
+Second
+Third
+EOF
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0002-append.sh
@@ -1,0 +1,40 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+###########################################################################
+#Append generated files one by one to an empty file
+
+echo First > file1
+echo Second > file2
+echo Third > file3
+
+rm -f file.a
+ar -qv file.a file1
+ar -qv file.a file2
+ar -qv file.a file3
+ar -t file.a > $tmp1
+
+cat <<EOF > $tmp2
+file1
+file2
+file3
+EOF
+
+cmp $tmp1 $tmp2
+
+ar -p file.a > $tmp1
+
+cat <<EOF > $tmp2
+First
+Second
+Third
+EOF
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0003-append.sh
@@ -1,0 +1,39 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+###########################################################################
+#Append generated files at once to an existing archive
+
+echo First > file1
+echo Second > file2
+echo Third > file3
+
+cp master.a file.a
+ar -qv file.a file1 file2 file3
+
+ar -t file.a file1 file2 file3 > $tmp1
+
+cat <<EOF > $tmp2
+file1
+file2
+file3
+EOF
+
+cmp $tmp1 $tmp2
+
+ar -p file.a file1 file2 file3 > $tmp1
+
+cat <<EOF > $tmp2
+First
+Second
+Third
+EOF
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0004-append.sh
@@ -1,0 +1,20 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+###########################################################################
+#empty file list
+
+rm -f file.a
+ar -qv file.a
+if ! test -f file.a
+then
+	echo "ar -q didn't generated empty archive" >&2
+	exit 1
+fi
--- /dev/null
+++ b/tests/ar/execute/0005-append.sh
@@ -1,0 +1,19 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+###########################################################################
+#empty file list
+
+rm -f file.a
+if ar -qv file.a badfile.a
+then
+	echo "ar -q failed to detect missed file" >&2
+	exit 1
+fi
--- /dev/null
+++ b/tests/ar/execute/0006-append.sh
@@ -1,0 +1,15 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+###########################################################################
+#empty file list
+
+rm -f file.a
+ar -qv file.a file.a
--- /dev/null
+++ b/tests/ar/execute/0007-delete.sh
@@ -1,0 +1,20 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file.a" 0 2 3
+
+############################################################################
+#delete one member
+
+cp master.a file.a
+
+ar -dv file.a file2
+
+if ar -tv file.a file2
+then
+	echo file-2 was not deleted >&2
+	exit 1
+fi
--- /dev/null
+++ b/tests/ar/execute/0008-delete.sh
@@ -1,0 +1,20 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file.a" 0 2 3
+
+############################################################################
+#delete two members, 1st and 2nd
+
+cp master.a file.a
+
+ar -dv file.a file1 file2
+
+if ar -tv file.a file1 file2
+then
+	echo file-1 or file-2 were not deleted >&2
+	exit 1
+fi
--- /dev/null
+++ b/tests/ar/execute/0009-delete.sh
@@ -1,0 +1,19 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file.a" 0 2 3
+
+############################################################################
+#delete two members, 2nd and 3rd
+
+cp master.a file.a
+ar -dv  file.a file2 file3
+
+if ar -tv file.a file2 file3
+then
+	echo file-2 file-3 were not deleted >&2
+	exit 1
+fi
--- /dev/null
+++ b/tests/ar/execute/0010-delete.sh
@@ -1,0 +1,25 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file.a" 0 2 3
+
+############################################################################
+#remove all the members
+
+cp master.a file.a
+ar -dv file.a file1 file2 file3
+
+if ar -tv file.a file2 file3
+then
+	echo file-1 file2 file were not deleted >&2
+	exit 1
+fi
+
+if test `ar -t file.a | wc -l` -ne 0
+then
+	echo file.a is not empty after deleting all the members >&2
+	exit 1
+fi
--- /dev/null
+++ b/tests/ar/execute/0011-delete.sh
@@ -1,0 +1,26 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file.a" 0 2 3
+
+############################################################################
+#no members
+cp master.a file.a
+
+last=`ls -l file.a | awk '{print $6,$7,$8}'`
+
+if ! ar -dv file.a
+then
+	echo ar returned with error when no members
+	exit 1
+fi
+
+now=`ls -l file.a | awk '{print $6,$7,$8}'`
+if test "$now" != "$last"
+then
+	echo empty ar -d modified the archive >&2
+	exit 1
+fi
--- /dev/null
+++ b/tests/ar/execute/0012-delete.sh
@@ -1,0 +1,95 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file.a" 0 2 3
+
+############################################################################
+#delete one member
+
+cp master.a file.a
+
+ar -dv file.a file2
+
+if ar -tv file.a file2
+then
+	echo file-2 was not deleted >&2
+	exit 1
+fi
+
+
+############################################################################
+#delete two members, 1st and 2nd
+
+cp master.a file.a
+
+ar -dv file.a file1 file2
+
+if ar -tv file.a file1 file2
+then
+	echo file-1 or file-2 were not deleted >&2
+	exit 1
+fi
+
+
+############################################################################
+#delete two members, 2nd and 3rd
+
+cp master.a file.a
+ar -dv  file.a file2 file3
+
+if ar -tv file.a file2 file3
+then
+	echo file-2 file-3 were not deleted >&2
+	exit 1
+fi
+
+############################################################################
+#remove all the members
+
+cp master.a file.a
+ar -dv file.a file1 file2 file3
+
+if ar -tv file.a file2 file3
+then
+	echo file-1 file2 file were not deleted >&2
+	exit 1
+fi
+
+if test `ar -t file.a | wc -l` -ne 0
+then
+	echo file.a is not empty after deleting all the members >&2
+	exit 1
+fi
+
+############################################################################
+#special cases
+
+#no members
+cp master.a file.a
+
+last=`ls -l file.a | awk '{print $6,$7,$8}'`
+
+if ! ar -dv file.a
+then
+	echo ar returned with error when no members
+	exit 1
+fi
+
+now=`ls -l file.a | awk '{print $6,$7,$8}'`
+if test "$now" != "$last"
+then
+	echo empty ar -d modified the archive >&2
+	exit 1
+fi
+
+#delete not existing member
+cp master.a file.a
+
+if ar -dv file.a badfile
+then
+	echo ar returned ok deleting a not existing member >&2
+	exit 1
+fi
--- /dev/null
+++ b/tests/ar/execute/0013-print.sh
@@ -1,0 +1,25 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+
+############################################################################
+#print 1st member
+
+cp master.a file.a
+
+ar -p file.a file1 > $tmp1
+
+cat <<! > $tmp2
+This is the first file,
+and it should go in the
+first position in the archive.
+!
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0014-print.sh
@@ -1,0 +1,24 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+
+############################################################################
+#print 3rd member
+
+cp master.a file.a
+ar -p file.a file3 > $tmp1
+
+cat <<! > $tmp2
+and at the end, this is the last file
+that should go at the end of the file,
+thus it should go in the third position.
+!
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0015-print.sh
@@ -1,0 +1,28 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+
+
+############################################################################
+#print 2nd member with verbose
+
+cp master.a file.a
+ar -pv file.a file2 >$tmp1
+
+cat <<! > $tmp2
+
+<file2>
+
+But this other one is the second one,
+and it shouldn't go in the first position
+because it should go in the second position.
+!
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0016-print.sh
@@ -1,0 +1,30 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+
+############################################################################
+#print all members
+
+cp master.a file.a
+ar -p file.a file1 file2 file3 >$tmp1
+
+cat <<! > $tmp2
+This is the first file,
+and it should go in the
+first position in the archive.
+But this other one is the second one,
+and it shouldn't go in the first position
+because it should go in the second position.
+and at the end, this is the last file
+that should go at the end of the file,
+thus it should go in the third position.
+!
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0017-print.sh
@@ -1,0 +1,28 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+
+#and now with no members in command line
+
+cp master.a file.a
+ar -p file.a > $tmp1
+
+cat <<! > $tmp2
+This is the first file,
+and it should go in the
+first position in the archive.
+But this other one is the second one,
+and it shouldn't go in the first position
+because it should go in the second position.
+and at the end, this is the last file
+that should go at the end of the file,
+thus it should go in the third position.
+!
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0018-list.sh
@@ -1,0 +1,22 @@
+#!/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
--- /dev/null
+++ b/tests/ar/execute/0019-list.sh
@@ -1,0 +1,21 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+
+
+############################################################################
+#print 3rd member
+
+cp master.a file.a
+ar -t file.a file3 > $tmp1
+
+cat <<! > $tmp2
+file3
+!
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0020-list.sh
@@ -1,0 +1,20 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+
+############################################################################
+#print 2nd member with verbose
+
+cp master.a file.a
+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
--- /dev/null
+++ b/tests/ar/execute/0021-list.sh
@@ -1,0 +1,22 @@
+#!/bin/sh
+
+exec >> test.log 2>&1
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+
+############################################################################
+#print all members
+
+cp master.a file.a
+ar -t file.a file1 file2 file3 >$tmp1
+
+cat <<! > $tmp2
+file1
+file2
+file3
+!
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0022-list.sh
@@ -1,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
--- /dev/null
+++ b/tests/ar/execute/0023-extract.sh
@@ -1,0 +1,23 @@
+#!/bin/sh
+
+
+exec >> test.log 2>&1
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file* $tmp1 $tmp2" 0 2 3
+
+############################################################################
+#extract 1st member
+
+cp master.a file.a
+ar -xv file.a file1
+
+cat <<EOF > $tmp1
+This is the first file,
+and it should go in the
+first position in the archive.
+EOF
+
+cmp file1 $tmp1
--- /dev/null
+++ b/tests/ar/execute/0024-extract.sh
@@ -1,0 +1,24 @@
+#!/bin/sh
+
+
+exec >> test.log 2>&1
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file* $tmp1 $tmp2" 0 2 3
+
+
+############################################################################
+#extract 3rd member
+
+cp master.a file.a
+ar -xv file.a file3
+
+cat <<EOF > $tmp1
+and at the end, this is the last file
+that should go at the end of the file,
+thus it should go in the third position.
+EOF
+
+cmp file3 $tmp1
--- /dev/null
+++ b/tests/ar/execute/0025-extract.sh
@@ -1,0 +1,23 @@
+#!/bin/sh
+
+
+exec >> test.log 2>&1
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file* $tmp1 $tmp2" 0 2 3
+
+############################################################################
+#extract 3rd member
+
+cp master.a file.a
+ar -xv file.a file3
+
+cat <<EOF > $tmp1
+and at the end, this is the last file
+that should go at the end of the file,
+thus it should go in the third position.
+EOF
+
+cmp file3 $tmp1
--- /dev/null
+++ b/tests/ar/execute/0026-extract.sh
@@ -1,0 +1,37 @@
+#!/bin/sh
+
+
+exec >> test.log 2>&1
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file* $tmp1 $tmp2" 0 2 3
+
+############################################################################
+#extract all members
+
+cp master.a file.a
+ar -xv file.a file1 file2 file3
+
+cat <<EOF > $tmp1
+This is the first file,
+and it should go in the
+first position in the archive.
+But this other one is the second one,
+and it shouldn't go in the first position
+because it should go in the second position.
+and at the end, this is the last file
+that should go at the end of the file,
+thus it should go in the third position.
+EOF
+
+cat file1 file2 file3 > $tmp2
+
+cmp $tmp1 $tmp2
+
+if test `ls file? | wc -l` -ne 3
+then
+	echo some error extracting files
+	exit
+fi
--- /dev/null
+++ b/tests/ar/execute/0027-extract.sh
@@ -1,0 +1,38 @@
+#!/bin/sh
+
+
+exec >> test.log 2>&1
+set -e
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+trap "rm -f file* $tmp1 $tmp2" 0 2 3
+
+
+############################################################################
+#extract without parameters
+
+cp master.a file.a
+ar -xv file.a
+
+cat <<EOF > $tmp1
+This is the first file,
+and it should go in the
+first position in the archive.
+But this other one is the second one,
+and it shouldn't go in the first position
+because it should go in the second position.
+and at the end, this is the last file
+that should go at the end of the file,
+thus it should go in the third position.
+EOF
+
+cat file1 file2 file3 > $tmp2
+
+cmp $tmp1 $tmp2
+
+if test `ls file? | wc -l` -ne 3
+then
+	echo some error extracting files
+	exit
+fi
--- /dev/null
+++ b/tests/ar/execute/0029-move.sh
@@ -1,0 +1,26 @@
+#!/bin/sh
+
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file* $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+############################################################################
+#move 1st without specifier
+
+cp master.a file.a
+ar -mv file.a file1
+ar -t file.a > $tmp1
+
+cat <<EOF > $tmp2
+file2
+file3
+file1
+EOF
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0030-move.sh
@@ -1,0 +1,26 @@
+#!/bin/sh
+
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file* $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+############################################################################
+#move 1st at the end
+
+cp master.a file.a
+ar -mv -a file3 file.a file1
+ar -t file.a > $tmp1
+
+cat <<EOF > $tmp2
+file2
+file3
+file1
+EOF
+
+cmp $tmp1 $tmp2
--- /dev/null
+++ b/tests/ar/execute/0031-move.sh
@@ -1,0 +1,26 @@
+#!/bin/sh
+
+
+exec >> test.log 2>&1
+
+set -e
+
+trap "rm -f file* $tmp1 $tmp2" 0 2 3
+
+tmp1=`mktemp`
+tmp2=`mktemp`
+
+############################################################################
+#and now, test without parameters
+
+cp master.a file.a
+ar -mv file.a
+ar -t file.a > $tmp1
+
+cat <<EOF > $tmp2
+file1
+file2
+file3
+EOF
+
+cmp $tmp1 $tmp2
--- a/tests/ar/execute/10-test-d.sh
+++ /dev/null
@@ -1,95 +1,0 @@
-#!/bin/sh
-
-exec >> test.log 2>&1
-
-set -e
-
-trap "rm -f file.a" 0 2 3
-
-############################################################################
-#delete one member
-
-cp master.a file.a
-
-ar -dv file.a file2
-
-if ar -tv file.a file2
-then
-	echo file-2 was not deleted >&2
-	exit 1
-fi
-
-
-############################################################################
-#delete two members, 1st and 2nd
-
-cp master.a file.a
-
-ar -dv file.a file1 file2
-
-if ar -tv file.a file1 file2
-then
-	echo file-1 or file-2 were not deleted >&2
-	exit 1
-fi
-
-
-############################################################################
-#delete two members, 2nd and 3rd
-
-cp master.a file.a
-ar -dv  file.a file2 file3
-
-if ar -tv file.a file2 file3
-then
-	echo file-2 file-3 were not deleted >&2
-	exit 1
-fi
-
-############################################################################
-#remove all the members
-
-cp master.a file.a
-ar -dv file.a file1 file2 file3
-
-if ar -tv file.a file2 file3
-then
-	echo file-1 file2 file were not deleted >&2
-	exit 1
-fi
-
-if test `ar -t file.a | wc -l` -ne 0
-then
-	echo file.a is not empty after deleting all the members >&2
-	exit 1
-fi
-
-############################################################################
-#special cases
-
-#no members
-cp master.a file.a
-
-last=`ls -l file.a | awk '{print $6,$7,$8}'`
-
-if ! ar -dv file.a
-then
-	echo ar returned with error when no members
-	exit 1
-fi
-
-now=`ls -l file.a | awk '{print $6,$7,$8}'`
-if test "$now" != "$last"
-then
-	echo empty ar -d modified the archive >&2
-	exit 1
-fi
-
-#delete not existing member
-cp master.a file.a
-
-if ar -dv file.a badfile
-then
-	echo ar returned ok deleting a not existing member >&2
-	exit 1
-fi
--- a/tests/ar/execute/20-test-p.sh
+++ /dev/null
@@ -1,79 +1,0 @@
-#!/bin/sh
-
-exec >> test.log 2>&1
-
-
-set -e
-
-tmp1=`mktemp`
-tmp2=`mktemp`
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
-
-############################################################################
-#print 1st member
-
-cp master.a file.a
-
-ar -p file.a file1 > $tmp1
-
-cat <<! > $tmp2
-This is the first file,
-and it should go in the
-first position in the archive.
-!
-
-cmp $tmp1 $tmp2
-
-############################################################################
-#print 3rd member
-
-ar -p file.a file3 > $tmp1
-
-cat <<! > $tmp2
-and at the end, this is the last file
-that should go at the end of the file,
-thus it should go in the third position.
-!
-
-cmp $tmp1 $tmp2
-
-############################################################################
-#print 2nd member with verbose
-
-ar -pv file.a file2 >$tmp1
-
-cat <<! > $tmp2
-
-<file2>
-
-But this other one is the second one,
-and it shouldn't go in the first position
-because it should go in the second position.
-!
-
-cmp $tmp1 $tmp2
-
-############################################################################
-#print all members
-
-ar -p file.a file1 file2 file3 >$tmp1
-
-cat <<! > $tmp2
-This is the first file,
-and it should go in the
-first position in the archive.
-But this other one is the second one,
-and it shouldn't go in the first position
-because it should go in the second position.
-and at the end, this is the last file
-that should go at the end of the file,
-thus it should go in the third position.
-!
-
-cmp $tmp1 $tmp2
-
-#and now with no members in command line
-
-ar -p file.a > $tmp1
-
-cmp $tmp1 $tmp2
--- a/tests/ar/execute/30-test-t.sh
+++ /dev/null
@@ -1,63 +1,0 @@
-#!/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
--- a/tests/ar/execute/40-test-x.sh
+++ /dev/null
@@ -1,95 +1,0 @@
-#!/bin/sh
-
-
-exec >> test.log 2>&1
-set -e
-
-tmp1=`mktemp`
-tmp2=`mktemp`
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
-
-
-cp master.a file.a
-
-############################################################################
-#extract 1st member
-
-ar -xv file.a file1
-
-cat <<EOF > $tmp1
-This is the first file,
-and it should go in the
-first position in the archive.
-EOF
-
-cmp file1 $tmp1
-
-############################################################################
-#extract 3rd member
-
-ar -xv file.a file3
-
-cat <<EOF > $tmp1
-and at the end, this is the last file
-that should go at the end of the file,
-thus it should go in the third position.
-EOF
-
-cmp file3 $tmp1
-
-############################################################################
-#extract 3rd member
-
-rm -f file1 file3
-ar -xv file.a file1 file2 file3
-
-cat <<EOF > $tmp1
-This is the first file,
-and it should go in the
-first position in the archive.
-But this other one is the second one,
-and it shouldn't go in the first position
-because it should go in the second position.
-and at the end, this is the last file
-that should go at the end of the file,
-thus it should go in the third position.
-EOF
-
-cat file1 file2 file3 > $tmp2
-
-cmp $tmp1 $tmp2
-
-if test `ls file? | wc -l` -ne 3
-then
-	echo some error extracting files
-	exit
-fi
-
-
-############################################################################
-#extract all members
-
-rm -f file1 file2 file3
-ar -xv file.a
-
-cat <<EOF > $tmp1
-This is the first file,
-and it should go in the
-first position in the archive.
-But this other one is the second one,
-and it shouldn't go in the first position
-because it should go in the second position.
-and at the end, this is the last file
-that should go at the end of the file,
-thus it should go in the third position.
-EOF
-
-cat file1 file2 file3 > $tmp2
-
-cmp $tmp1 $tmp2
-
-if test `ls file? | wc -l` -ne 3
-then
-	echo some error extracting files
-	exit
-fi
--- a/tests/ar/execute/50-test-m.sh
+++ /dev/null
@@ -1,70 +1,0 @@
-#!/bin/sh
-
-
-exec >> test.log 2>&1
-set -e
-
-tmp1=`mktemp`
-tmp2=`mktemp`
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
-
-############################################################################
-#move 1st without specifier
-
-cp master.a file.a
-ar -mv file.a file1
-ar -t file.a > $tmp1
-
-cat <<EOF > $tmp2
-file2
-file3
-file1
-EOF
-
-cmp $tmp1 $tmp2
-
-############################################################################
-#move 1st at the end
-
-cp master.a file.a
-ar -mv -a file3 file.a file1
-ar -t file.a > $tmp1
-
-cat <<EOF > $tmp2
-file2
-file3
-file1
-EOF
-
-cmp $tmp1 $tmp2
-
-
-############################################################################
-#move 3rd at the beginning
-
-cp master.a file.a
-ar -mv -i file1 file.a file3
-ar -t file.a > $tmp1
-
-cat <<EOF > $tmp2
-file3
-file1
-file2
-EOF
-
-cmp $tmp1 $tmp2
-
-############################################################################
-#and now, test without parameters
-
-cp master.a file.a
-ar -mv file.a
-ar -t file.a > $tmp1
-
-cat <<EOF > $tmp2
-file1
-file2
-file3
-EOF
-
-cmp $tmp1 $tmp2
--- a/tests/ar/execute/Makefile
+++ b/tests/ar/execute/Makefile
@@ -11,4 +11,3 @@
 clean:
 	rm -f *.a test.log
 	rm -f file*
-	rm -f *.dst
--- a/tests/ar/execute/chktest.sh
+++ b/tests/ar/execute/chktest.sh
@@ -29,7 +29,7 @@
 thus it should go in the third position.
 EOF
 
-for i in *-test*.sh
+for i in *-*.sh
 do
 	printf "Test: %s\n\n" $i >> test.log
 	printf "%s\t" $i