Module Name: src
Committed By: apb
Date: Wed Apr 8 19:06:30 UTC 2009
Modified Files:
src/tests/util/mtree: Makefile d_convert.in d_convert_C.out
d_convert_D.out t_mtree.sh
Added Files:
src/tests/util/mtree: d_convert_C_S.out d_convert_D_S.out
Log Message:
Add tests for "mtree -C -S" and "mtree -D -S"; convert previous tests
for "mtree -C" and "mtree -D" to expect the output to be in the same
order as the input.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/util/mtree/Makefile \
src/tests/util/mtree/t_mtree.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/util/mtree/d_convert.in \
src/tests/util/mtree/d_convert_C.out src/tests/util/mtree/d_convert_D.out
cvs rdiff -u -r0 -r1.1 src/tests/util/mtree/d_convert_C_S.out \
src/tests/util/mtree/d_convert_D_S.out
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/util/mtree/Makefile
diff -u src/tests/util/mtree/Makefile:1.2 src/tests/util/mtree/Makefile:1.3
--- src/tests/util/mtree/Makefile:1.2 Tue Apr 7 19:28:40 2009
+++ src/tests/util/mtree/Makefile Wed Apr 8 19:06:30 2009
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2009/04/07 19:28:40 apb Exp $
+# $NetBSD: Makefile,v 1.3 2009/04/08 19:06:30 apb Exp $
NOMAN= # defined
@@ -11,7 +11,9 @@
FILESDIR= ${TESTSDIR}
FILES+= d_convert.in
FILES+= d_convert_C.out
+FILES+= d_convert_C_S.out
FILES+= d_convert_D.out
+FILES+= d_convert_D_S.out
FILES+= d_create.out
.include <bsd.test.mk>
Index: src/tests/util/mtree/t_mtree.sh
diff -u src/tests/util/mtree/t_mtree.sh:1.2 src/tests/util/mtree/t_mtree.sh:1.3
--- src/tests/util/mtree/t_mtree.sh:1.2 Tue Apr 7 19:28:40 2009
+++ src/tests/util/mtree/t_mtree.sh Wed Apr 8 19:06:30 2009
@@ -1,4 +1,4 @@
-# $NetBSD: t_mtree.sh,v 1.2 2009/04/07 19:28:40 apb Exp $
+# $NetBSD: t_mtree.sh,v 1.3 2009/04/08 19:06:30 apb Exp $
#
# Copyright (c) 2009 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -102,7 +102,7 @@
atf_test_case convert_C
convert_C_head()
{
- atf_set "descr" "Convert a specfile to mtree -C format"
+ atf_set "descr" "Convert a specfile to mtree -C format, unsorted"
}
convert_C_body()
{
@@ -110,10 +110,21 @@
h_check "$(atf_get_srcdir)/d_convert_C.out" output
}
+atf_test_case convert_C_S
+convert_C_S_head()
+{
+ atf_set "descr" "Convert a specfile to mtree -C format, sorted"
+}
+convert_C_S_body()
+{
+ mtree -C -S -K all <"$(atf_get_srcdir)/d_convert.in" >output
+ h_check "$(atf_get_srcdir)/d_convert_C_S.out" output
+}
+
atf_test_case convert_D
convert_D_head()
{
- atf_set "descr" "Convert a specfile to mtree -D format"
+ atf_set "descr" "Convert a specfile to mtree -D format, unsorted"
}
convert_D_body()
{
@@ -121,10 +132,23 @@
h_check "$(atf_get_srcdir)/d_convert_D.out" output
}
+atf_test_case convert_D_S
+convert_D_S_head()
+{
+ atf_set "descr" "Convert a specfile to mtree -D format, sorted"
+}
+convert_D_S_body()
+{
+ mtree -D -S -K all <"$(atf_get_srcdir)/d_convert.in" >output
+ h_check "$(atf_get_srcdir)/d_convert_D_S.out" output
+}
+
atf_init_test_cases()
{
atf_add_test_case create
atf_add_test_case check
atf_add_test_case convert_C
+ atf_add_test_case convert_C_S
atf_add_test_case convert_D
+ atf_add_test_case convert_D_S
}
Index: src/tests/util/mtree/d_convert.in
diff -u src/tests/util/mtree/d_convert.in:1.1 src/tests/util/mtree/d_convert.in:1.2
--- src/tests/util/mtree/d_convert.in:1.1 Tue Apr 7 19:28:40 2009
+++ src/tests/util/mtree/d_convert.in Wed Apr 8 19:06:30 2009
@@ -6,17 +6,18 @@
. type=dir
a.symlink.1 type=link link=a.file.1
top.dangling type=link link=nonexistent
- top.file.1 type=file
top.symlink.b \
type=link link=b
# ./b
b type=dir
- b.file.1 type=file
b.file.2 type=file
+ b.file.1 type=file
# end ./b, up to "."
..
+ top.file.1 type=file
+
# ./a
a type=dir
a.file.2 type=file
Index: src/tests/util/mtree/d_convert_C.out
diff -u src/tests/util/mtree/d_convert_C.out:1.1 src/tests/util/mtree/d_convert_C.out:1.2
--- src/tests/util/mtree/d_convert_C.out:1.1 Tue Apr 7 19:28:40 2009
+++ src/tests/util/mtree/d_convert_C.out Wed Apr 8 19:06:30 2009
@@ -1,11 +1,11 @@
. type=dir
./a.symlink.1 type=link link=a.file.1
./top.dangling type=link link=nonexistent
-./top.file.1 type=file
./top.symlink.b type=link link=b
./b type=dir
-./b/b.file.1 type=file
./b/b.file.2 type=file
+./b/b.file.1 type=file
+./top.file.1 type=file
./a type=dir
./a/a.file.2 type=file
./a/1 type=dir
Index: src/tests/util/mtree/d_convert_D.out
diff -u src/tests/util/mtree/d_convert_D.out:1.1 src/tests/util/mtree/d_convert_D.out:1.2
--- src/tests/util/mtree/d_convert_D.out:1.1 Tue Apr 7 19:28:40 2009
+++ src/tests/util/mtree/d_convert_D.out Wed Apr 8 19:06:30 2009
@@ -1,11 +1,11 @@
type=dir .
type=link link=a.file.1 ./a.symlink.1
type=link link=nonexistent ./top.dangling
-type=file ./top.file.1
type=link link=b ./top.symlink.b
type=dir ./b
-type=file ./b/b.file.1
type=file ./b/b.file.2
+type=file ./b/b.file.1
+type=file ./top.file.1
type=dir ./a
type=file ./a/a.file.2
type=dir ./a/1
Added files:
Index: src/tests/util/mtree/d_convert_C_S.out
diff -u /dev/null src/tests/util/mtree/d_convert_C_S.out:1.1
--- /dev/null Wed Apr 8 19:06:30 2009
+++ src/tests/util/mtree/d_convert_C_S.out Wed Apr 8 19:06:30 2009
@@ -0,0 +1,14 @@
+. type=dir
+./a.symlink.1 type=link link=a.file.1
+./top.dangling type=link link=nonexistent
+./top.file.1 type=file
+./top.symlink.b type=link link=b
+./a type=dir
+./a/a.file.1 type=file
+./a/a.file.2 type=file
+./a/1 type=dir
+./a/1/a1.file.1 type=file
+./a/2 type=dir
+./b type=dir
+./b/b.file.1 type=file
+./b/b.file.2 type=file
Index: src/tests/util/mtree/d_convert_D_S.out
diff -u /dev/null src/tests/util/mtree/d_convert_D_S.out:1.1
--- /dev/null Wed Apr 8 19:06:30 2009
+++ src/tests/util/mtree/d_convert_D_S.out Wed Apr 8 19:06:30 2009
@@ -0,0 +1,14 @@
+type=dir .
+type=link link=a.file.1 ./a.symlink.1
+type=link link=nonexistent ./top.dangling
+type=file ./top.file.1
+type=link link=b ./top.symlink.b
+type=dir ./a
+type=file ./a/a.file.1
+type=file ./a/a.file.2
+type=dir ./a/1
+type=file ./a/1/a1.file.1
+type=dir ./a/2
+type=dir ./b
+type=file ./b/b.file.1
+type=file ./b/b.file.2