svn commit: r289195 - in head: etc/mtree lib/libarchive lib/libarchive/test lib/libarchive/tests usr.bin/cpio usr.bin/cpio/test usr.bin/cpio/tests usr.bin/tar usr.bin/tar/test usr.bin/tar/tests
Garrett Cooper
ngie at FreeBSD.org
Mon Oct 12 18:31:23 UTC 2015
Author: ngie
Date: Mon Oct 12 18:31:21 2015
New Revision: 289195
URL: https://svnweb.freebsd.org/changeset/base/289195
Log:
Integrate the tests from lib/libarchive, usr.bin/cpio, and usr.bin/tar in to
the FreeBSD test suite
functional_test.sh was ported from bin/sh/tests/functional_test.sh, as a
small wrapper around libarchive_test, bsdcpio_test, and bsdtar_test provided
by upstream.
A handful of testcases in lib/libarchive/tests have been disabled as they
were failing when run with kyua test (see BROKEN_TESTS in
lib/libarchive/tests/Makefile)
As a sidenote: this removes the check/test targets from the Makefiles as they
don't match the pattern used in the rest of the FreeBSD test suite.
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Added:
head/lib/libarchive/tests/
- copied from r289179, user/ngie/more-tests2/lib/libarchive/tests/
head/usr.bin/cpio/tests/
- copied from r289179, user/ngie/more-tests2/usr.bin/cpio/tests/
head/usr.bin/tar/tests/
- copied from r289179, user/ngie/more-tests2/usr.bin/tar/tests/
Deleted:
head/lib/libarchive/test/
head/usr.bin/cpio/test/
head/usr.bin/tar/test/
Modified:
head/etc/mtree/BSD.tests.dist
head/lib/libarchive/Makefile
head/lib/libarchive/tests/Makefile
head/usr.bin/cpio/Makefile
head/usr.bin/cpio/tests/Makefile
head/usr.bin/tar/Makefile
head/usr.bin/tar/tests/Makefile
Directory Properties:
head/ (props changed)
Modified: head/etc/mtree/BSD.tests.dist
==============================================================================
--- head/etc/mtree/BSD.tests.dist Mon Oct 12 18:15:25 2015 (r289194)
+++ head/etc/mtree/BSD.tests.dist Mon Oct 12 18:31:21 2015 (r289195)
@@ -242,6 +242,8 @@
test-programs
..
..
+ libarchive
+ ..
libc
c063
..
@@ -518,6 +520,8 @@
..
cmp
..
+ cpio
+ ..
col
..
comm
@@ -556,6 +560,8 @@
..
soelim
..
+ tar
+ ..
timeout
..
tr
Modified: head/lib/libarchive/Makefile
==============================================================================
--- head/lib/libarchive/Makefile Mon Oct 12 18:15:25 2015 (r289194)
+++ head/lib/libarchive/Makefile Mon Oct 12 18:31:21 2015 (r289195)
@@ -398,11 +398,8 @@ MLINKS+= archive_write_set_options.3 arc
MLINKS+= archive_write_set_options.3 archive_write_set_option.3
MLINKS+= libarchive.3 archive.3
-.PHONY: check test clean-test
-check test:
- cd ${.CURDIR}/test && make obj && make test
-
-clean-test:
- cd ${.CURDIR}/test && make clean
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
.include <bsd.lib.mk>
Modified: head/lib/libarchive/tests/Makefile
==============================================================================
--- user/ngie/more-tests2/lib/libarchive/tests/Makefile Mon Oct 12 09:13:47 2015 (r289179)
+++ head/lib/libarchive/tests/Makefile Mon Oct 12 18:31:21 2015 (r289195)
@@ -12,10 +12,6 @@ CFLAGS+= -I${.CURDIR:H} -I${.OBJDIR}
CFLAGS+= -I${LIBARCHIVEDIR}/libarchive -I${LIBARCHIVEDIR}/test_utils
CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
-DEBUG_CFLAGS+= -g
-
-LIBADD.libarchive_test= archive
-
# Uncomment to link against dmalloc
#LDADD+= -L/usr/local/lib -ldmalloc
#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
@@ -253,6 +249,8 @@ SRCS.libarchive_test= \
DPSRCS.libarchive_test= \
list.h
+LIBADD.libarchive_test= archive
+
.PATH: ${LIBARCHIVEDIR}/test_utils
SRCS.libarchive_test+= test_utils.c
@@ -263,6 +261,8 @@ list.h: ${TESTS_SRCS} Makefile
egrep -v '${BROKEN_TESTS:tW:C/ /|/g}') > ${.TARGET}.tmp
@mv ${.TARGET}.tmp ${.TARGET}
+CLEANFILES+= list.h list.h.tmp
+
FILES+= README
FILES+= test_acl_pax.tar.uu
FILES+= test_archive_string_conversion.txt.Z.uu
@@ -452,6 +452,4 @@ FILES+= test_write_disk_hfs_compression.
FILES+= test_write_disk_mac_metadata.tar.gz.uu
FILES+= test_write_disk_no_hfs_compression.tgz.uu
-CLEANFILES+= list.h list.h.tmp
-
.include <bsd.test.mk>
Modified: head/usr.bin/cpio/Makefile
==============================================================================
--- head/usr.bin/cpio/Makefile Mon Oct 12 18:15:25 2015 (r289194)
+++ head/usr.bin/cpio/Makefile Mon Oct 12 18:31:21 2015 (r289195)
@@ -32,12 +32,8 @@ CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1
SYMLINKS=bsdcpio ${BINDIR}/cpio
MLINKS= bsdcpio.1 cpio.1
-.PHONY: check test clean-test
-
-check test: $(PROG) bsdcpio.1.gz
- cd ${.CURDIR}/test && make obj && make test
-
-clean-test:
- cd ${.CURDIR}/test && make clean
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
.include <bsd.prog.mk>
Modified: head/usr.bin/cpio/tests/Makefile
==============================================================================
--- user/ngie/more-tests2/usr.bin/cpio/tests/Makefile Mon Oct 12 09:13:47 2015 (r289179)
+++ head/usr.bin/cpio/tests/Makefile Mon Oct 12 18:31:21 2015 (r289195)
@@ -4,9 +4,20 @@ LIBARCHIVEDIR= ${SRCTOP}/contrib/libarch
ATF_TESTS_SH+= functional_test
+BINDIR= ${TESTSDIR}
+
PROGS+= bsdcpio_test
-BINDIR= ${TESTSDIR}
+CFLAGS+= -DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
+CFLAGS+= -I${SRCTOP}/lib/libarchive -I${.OBJDIR}
+
+CFLAGS+= -I${.OBJDIR}
+CFLAGS+= -I${LIBARCHIVEDIR}/cpio -I${LIBARCHIVEDIR}/libarchive_fe
+CFLAGS+= -I${LIBARCHIVEDIR}/test_utils
+
+# Uncomment to link against dmalloc
+#LDADD+= -L/usr/local/lib -ldmalloc
+#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
.PATH: ${LIBARCHIVEDIR}/cpio
CPIO_SRCS= cmdline.c
@@ -59,35 +70,26 @@ TESTS_SRCS= \
test_passthrough_dotdot.c \
test_passthrough_reverse.c
-# Build the test program
SRCS.bsdcpio_test= list.h \
${CPIO_SRCS} \
${TESTS_SRCS} \
main.c
+DPSRCS.bsdcpio_test= \
+ list.h
+
.PATH: ${LIBARCHIVEDIR}/test_utils
SRCS.bsdcpio_test+= test_utils.c
-CLEANFILES+= list.h
-
-CFLAGS+= -DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
-CFLAGS+= -I${SRCTOP}/lib/libarchive -I${.OBJDIR}
-LIBADD= archive
-
-DEBUG_FLAGS+= -g
-CFLAGS+= -I${.OBJDIR}
-CFLAGS+= -I${LIBARCHIVEDIR}/cpio -I${LIBARCHIVEDIR}/libarchive_fe
-CFLAGS+= -I${LIBARCHIVEDIR}/test_utils
-
-# Uncomment to link against dmalloc
-#LDADD+= -L/usr/local/lib -ldmalloc
-#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
+LIBADD.bsdcpio_test= archive
list.h: ${TESTS_SRCS} Makefile
@(cd ${LIBARCHIVEDIR}/tar/test && \
grep -h DEFINE_TEST ${.ALLSRC:N*Makefile}) > ${.TARGET}.tmp
@mv ${.TARGET}.tmp ${.TARGET}
+CLEANFILES+= list.h list.h.tmp
+
FILES+= test_extract.cpio.Z.uu
FILES+= test_extract.cpio.bz2.uu
FILES+= test_extract.cpio.grz.uu
Modified: head/usr.bin/tar/Makefile
==============================================================================
--- head/usr.bin/tar/Makefile Mon Oct 12 18:15:25 2015 (r289194)
+++ head/usr.bin/tar/Makefile Mon Oct 12 18:31:21 2015 (r289195)
@@ -32,11 +32,8 @@ CFLAGS+= -I${LIBARCHIVEDIR}/libarchive_f
SYMLINKS= bsdtar ${BINDIR}/tar
MLINKS= bsdtar.1 tar.1
-.PHONY: check test clean-test
-check test: $(PROG) bsdtar.1.gz
- cd ${.CURDIR}/test && make obj && make test
-
-clean-test:
- cd ${.CURDIR}/test && make clean
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
.include <bsd.prog.mk>
Modified: head/usr.bin/tar/tests/Makefile
==============================================================================
--- user/ngie/more-tests2/usr.bin/tar/tests/Makefile Mon Oct 12 09:13:47 2015 (r289179)
+++ head/usr.bin/tar/tests/Makefile Mon Oct 12 18:31:21 2015 (r289195)
@@ -6,6 +6,15 @@ ATF_TESTS_SH+= functional_test
BINDIR= ${TESTSDIR}
+CFLAGS+= -DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
+CFLAGS+= -static
+CFLAGS+= -I${SRCTOP}/lib/libarchive -I${.OBJDIR}
+CFLAGS+= -I${LIBARCHIVEDIR}/tar -I${LIBARCHIVEDIR}/test_utils
+
+# Uncomment to link against dmalloc
+#LDADD+= -L/usr/local/lib -ldmalloc
+#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
+
PROGS+= bsdtar_test
.PATH: ${LIBARCHIVEDIR}/tar/test
@@ -61,33 +70,17 @@ TESTS_SRCS= \
test_symlink_dir.c \
test_version.c
-# Build the test program
SRCS.bsdtar_test= \
${TESTS_SRCS} \
list.h \
main.c
-BROKEN_TESTS=
-
DPSRCS.bsdtar_test+= list.h
.PATH: ${LIBARCHIVEDIR}/test_utils
SRCS.bsdtar_test+= test_utils.c
-CLEANFILES+= list.h
-
-LIBADD+= archive
-
-DEBUG_FLAGS+= -g
-CFLAGS+= -DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
-CFLAGS+= -static -Wall
-
-CFLAGS+= -I${SRCTOP}/lib/libarchive -I${.OBJDIR}
-CFLAGS+= -I${LIBARCHIVEDIR}/tar -I${LIBARCHIVEDIR}/test_utils
-
-# Uncomment to link against dmalloc
-#LDADD+= -L/usr/local/lib -ldmalloc
-#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
+LIBADD.bsdtar_test= archive
list.h: ${TESTS_SRCS} Makefile
@(cd ${LIBARCHIVEDIR}/tar/test && \
More information about the svn-src-head
mailing list