summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorjlam <jlam>2007-07-12 18:27:54 +0000
committerjlam <jlam>2007-07-12 18:27:54 +0000
commitc8966dd456c185b91c27e4948cf0fb1ace7df283 (patch)
tree3ed5da3f1959cde091362b8c7f216f7948859cf0 /regress
parent04f8f8b34b8a80d607ec30e3af5ce62fa33f06d5 (diff)
downloadpkgsrc-c8966dd456c185b91c27e4948cf0fb1ace7df283.tar.gz
Add some regression tests for backing up existing files, e.g. "-b" and
"-B fmt".
Diffstat (limited to 'regress')
-rw-r--r--regress/bootstrap-install-sh/Makefile39
1 files changed, 38 insertions, 1 deletions
diff --git a/regress/bootstrap-install-sh/Makefile b/regress/bootstrap-install-sh/Makefile
index 219dba91e38..350b5ff3db7 100644
--- a/regress/bootstrap-install-sh/Makefile
+++ b/regress/bootstrap-install-sh/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2007/07/04 19:18:12 jlam Exp $
+# $NetBSD: Makefile,v 1.5 2007/07/12 18:27:54 jlam Exp $
DISTNAME= bootstrap-install-sh-0.0
CATEGORIES= regress
@@ -110,6 +110,43 @@ test-c4:
${CMP} -s ${WRKSRC}/c4_file2 ${WRKSRC}/c4_dir/c4_file2 && \
${CMP} -s ${WRKSRC}/c4_file3 ${WRKSRC}/c4_dir/c4_file3 ) || exit 1
+# copy one existing file to existing file with backup
+regress: test-c5
+test-c5:
+ ${ECHO} "Test data 1" > ${WRKSRC}/c5_file1
+ ${ECHO} "Test data 2" > ${WRKSRC}/c5_file2
+ ${CP} ${WRKSRC}/c5_file2 ${WRKSRC}/c5_file2.backup
+ ${INSTALL_SH} -b -c ${WRKSRC}/c5_file1 ${WRKSRC}/c5_file2
+ ( ${CMP} ${WRKSRC}/c5_file1 ${WRKSRC}/c5_file2 && \
+ ${TEST} -f ${WRKSRC}/c5_file2.old && \
+ ${CMP} ${WRKSRC}/c5_file2.old ${WRKSRC}/c5_file2.backup ) || exit 1
+
+# copy one existing file to existing file with backup and custom suffix
+regress: test-c6
+test-c6:
+ ${ECHO} "Test data 1" > ${WRKSRC}/c6_file1
+ ${ECHO} "Test data 2" > ${WRKSRC}/c6_file2
+ ${CP} ${WRKSRC}/c6_file2 ${WRKSRC}/c6_file2.backup
+ ${INSTALL_SH} -B .OLD -c ${WRKSRC}/c6_file1 ${WRKSRC}/c6_file2
+ ( ${CMP} ${WRKSRC}/c6_file1 ${WRKSRC}/c6_file2 && \
+ ${TEST} -f ${WRKSRC}/c6_file2.OLD && \
+ ${CMP} ${WRKSRC}/c6_file2.OLD ${WRKSRC}/c6_file2.backup ) || exit 1
+
+# copy one existing file to existing file with numbered backup
+regress: test-c7
+test-c7:
+ ${ECHO} "Test data 1" > ${WRKSRC}/c7_file1
+ ${ECHO} "Test data 2" > ${WRKSRC}/c7_file2
+ ${ECHO} "Test data 3" > ${WRKSRC}/c7_file2.backup.0
+ ${ECHO} "Test data 4" > ${WRKSRC}/c7_file2.backup.1
+ ${ECHO} "Test data 5" > ${WRKSRC}/c7_file2.backup.2
+ ${CP} ${WRKSRC}/c7_file2 ${WRKSRC}/c7_file2.backup
+ ${INSTALL_SH} -B .backup.%i -c ${WRKSRC}/c7_file1 ${WRKSRC}/c7_file2
+ ( ${CMP} ${WRKSRC}/c7_file1 ${WRKSRC}/c7_file2 && \
+ ${TEST} -f ${WRKSRC}/c7_file2.backup.3 && \
+ ${CMP} ${WRKSRC}/c7_file2.backup.3 ${WRKSRC}/c7_file2.backup ) || \
+ exit 1
+
MODES= 0 1 2 3 4 5 6 7
MODE_0= ---
MODE_1= --x