Importing NetBSD "Kyua" test framework

To do so, a few dependencies have been imported:

 * external/bsd/lutok
 * external/mit/lua
 * external/public-domain/sqlite
 * external/public-domain/xz

The Kyua framework is the new generation of ATF (Automated Test
Framework), it is composed of:

 * external/bsd/atf
 * external/bsd/kyua-atf-compat
 * external/bsd/kyua-cli
 * external/bsd/kyua-tester
 * tests

Kyua/ATF being written in C++, it depends on libstdc++ which is
provided by GCC. As this is not part of the sources, Kyua is only
compiled when the native GCC utils are installed.

To install Kyua do the following:

 * In a cross-build enviromnent, add the following to the build.sh
   commandline: -V MKBINUTILS=yes -V MKGCCCMDS=yes

WARNING:
  At this point the import is still experimental, and not supported
  on native builds (a.k.a make build).

Change-Id: I26aee23c5bbd2d64adcb7c1beb98fe0d479d7ada
This commit is contained in:
2013-02-26 09:24:42 +01:00
committed by Gerrit Code Review
parent 003ff52ebb
commit 11be35a165
2893 changed files with 502052 additions and 2630 deletions

View File

@@ -1,4 +1,4 @@
# $NetBSD: bsd.README,v 1.304 2012/10/02 04:53:11 jkoshy Exp $
# $NetBSD: bsd.README,v 1.318 2013/06/02 11:02:40 mbalmer Exp $
# @(#)bsd.README 8.2 (Berkeley) 4/2/94
This is the README file for the make "include" files for the NetBSD
@@ -113,8 +113,11 @@ MAKEVERBOSE Control how "verbose" the standard make(1) rules are.
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag
MKATF If "no", don't build libatf-c, libatf-c++ libraries associated
with the Automated Testing Framework (ATF).
MKATF If "no", don't build the Automated Testing Framework (ATF),
which includes the libatf-c, libatf-c++ and libatf-sh libraries
and the various command line tools. Also, because the build of
the libraries is disabled, don't build the NetBSD test suite
either.
Default: yes
MKBFD Obsolete, use MKBINUTILS
@@ -154,6 +157,13 @@ MKDEBUGLIB Build *_g.a debugging libraries, which are compiled
with -DDEBUG.
Default: no
MKDEPINCLUDES If "yes" issue .include statements in the .depend file
instead of inlining the contents of the .d files. Useful
when stale dependencies are present, to list the exact
files that need refreshing. It is off by default because
it is possibly slower.
Default "no"
MKDOC If "no", don't build or install the documentation.
Default: yes
@@ -226,10 +236,22 @@ MKKERBEROS If "no", disables building of Kerberos v5
MKKMOD If "no", disables building of kernel modules.
Default: yes
MKKYUA If "no", don't build Kyua nor its dependent library Lutok.
Note that setting this to "no" does not disable the build of
the NetBSD test suite itself; the build of the tests is
controlled by the MKATF knob.
Default: no (until the import is done and validated)
MKLDAP If "no", disables building of LDAP infrastructure
(libraries and support programs).
Default: yes
MKLIBCXX If not "no", build and install libc++.
Default: no
MKLIBSTDCXX If not "no", build and install libstdc++.
Default: yes
MKLINKLIB If "no", act as "MKLINT=no MKPICINSTALL=no MKPROFILE=no".
Also:
- don't install the .a libraries
@@ -330,6 +352,10 @@ MKSKEY If "no", disables building of S/key authentication
infrastructure (libraries and support programs).
Default: yes
MKSLJIT If "no", disables buildin of sljit (stack-less platform
independent JIT compiler) private library and tests.
Default: yes on amd64, i386 and sparc, no elsewhere.
MKSOFTFLOAT If not "no", build with options to enable the compiler to
generate output containing library calls for floating
point and possibly soft-float library support.
@@ -339,6 +365,10 @@ MKSTATICLIB If "no", don't build or install the normal static (*.a)
libraries.
Default: yes
MKTPM If "no" then don't build the Trusted Platform Module
infrastructure.
Default: no
MKUNPRIVED If not "no", don't set the owner/group/mode when installing
files or directories, and keep a metadata log of what
the owner/group/mode should be. This allows a
@@ -361,6 +391,12 @@ MKX11FONTS If not "no", if ${X11FLAVOUR} is "Xorg", do not build or
will be empty.
Default: yes
MKX11MOTIF: If "yes" and ${X11FLAVOUR} is "Xorg", build the native X11
libGLw with Motif stubs. If Motif is not installed in the
default location /usr/pkg, the location can be specified
using the X11MOTIFPATH variable.
Default: no
MKYP If "no", disables building of YP (NIS)
infrastructure (libraries and support programs).
Default: yes
@@ -499,6 +535,28 @@ _SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk>
is "internal" to <bsd.own.mk>, although its value is only
determined once and then propagated to all sub-makes.
_NETBSD_VERSION_DEPENDS
A list of files which contain information about
the version of the NetBSD being built. This is
defined only if the current directory appears
to be inside a NetBSD source tree. The list of
files includes ${NETBSDSRCDIR}/sys/sys/param.h
(which contains the kernel version number),
${NETBSDSRCDIR}/sys/conf/newvers.sh and
${NETBSDSRCDIR}/sys/conf/osrelease.sh (which
interpret the information in sys/sys/param.h), and
${_SRC_TOP_OBJ_}/params (which is an optional file,
created by "make build" in ${_SRC_TOP_}/Makefile,
containing all the variables that may influence the
build).
Targets that depend on the NetBSD version, or on
variables defined at build time, can declare a
dependency on ${_NETBSD_VERSION_DEPENDS}, like this:
version.c: ${_NETBSD_VERSION_DEPENDS}
commands to create version.c
BSDSRCDIR The real path to the system sources, so that 'make obj'
will work correctly. [/usr/src]
@@ -598,6 +656,10 @@ COPY The flag passed to the install program to cause the binary
can either be installed with copies, or with moves using
a single knob. [-c]
MAKEDIRTARGETENV
Environment variables passed to the child make process
invoked by MAKEDIRTARGET.
MAKEDIRTARGET dir target [params]
Runs "cd $${dir} && ${MAKE} [params] $${target}",
displaying a "pretty" message whilst doing so.
@@ -763,6 +825,8 @@ TOOL_MKLOCALE Make LC_CTYPE locale files. [mklocale]
TOOL_MKMAGIC Create database for file(1). [file]
TOOL_MKNOD Make device special file. [mknod]
TOOL_MKTEMP Make (unique) temporary file name. [mktemp]
TOOL_MSGC Simple message list compiler. [msgc]
@@ -878,6 +942,11 @@ or CLEANDIRFILES variables. For example:
.include <bsd.clean.mk>
The files listed in CLEANFILES and CLEANDIRFILES must not be
directories, because the potential risk from running "rm -rf" commands
in bsd.clean.mk is considered too great. If you want to recursively
delete a directory as part of "make clean" or "make cleandir" then you
need to provide your own target.
=-=-=-=-= bsd.dep.mk =-=-=-=-=
@@ -1139,6 +1208,11 @@ LIBDPLIBS A list of the tuples:
* DPADD gets ${LIBDO.libname}/liblibname.so or
${LIBDO.libname}/liblibname.a added.
The special value "_external" for LIBDO.lib makes the
build system to assume the library comes from outside
of the NetBSD source tree and only causes -llibname
to be added to LDADD.
This variable may be used for individual libraries, as
well as in parent directories to cache common libraries
as a build-time optimization.
@@ -1423,6 +1497,8 @@ DPADD Additional dependencies for the program. Usually used for
LIBDNS?= ${DESTDIR}/usr/lib/libdns.a
LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a
LIBEVENT_OPENSSL?= ${DESTDIR}/usr/lib/libevent_openssl.a
LIBEVENT_PTHREADS?= ${DESTDIR}/usr/lib/libevent_pthreads.a
LIBEXPAT?= ${DESTDIR}/usr/lib/libexpat.a
LIBFETCH?= ${DESTDIR}/usr/lib/libfetch.a
LIBFORM?= ${DESTDIR}/usr/lib/libform.a
@@ -1450,6 +1526,7 @@ DPADD Additional dependencies for the program. Usually used for
LIBLDAP?= ${DESTDIR}/usr/lib/libldap.a
LIBLDAP_R?= ${DESTDIR}/usr/lib/libldap_r.a
LIBLUA?= ${DESTDIR}/usr/lib/liblua.a
LIBLUTOK?= ${DESTDIR}/usr/lib/liblutok.a
LIBLWRES?= ${DESTDIR}/usr/lib/liblwres.a
LIBM?= ${DESTDIR}/usr/lib/libm.a
LIBMAGIC?= ${DESTDIR}/usr/lib/libmagic.a
@@ -1513,6 +1590,7 @@ DPADD Additional dependencies for the program. Usually used for
LIBICE?= ${DESTDIR}/usr/X11R7/lib/libICE.a
LIBSM?= ${DESTDIR}/usr/X11R7/lib/libSM.a
LIBX11?= ${DESTDIR}/usr/X11R7/lib/libX11.a
LIBX11_XCB?= ${DESTDIR}/usr/X11R7/lib/libX11-xcb.a
LIBXTRAP?= ${DESTDIR}/usr/X11R7/lib/libXTrap.a
LIBXAU?= ${DESTDIR}/usr/X11R7/lib/libXau.a
LIBXAW?= ${DESTDIR}/usr/X11R7/lib/libXaw.a

View File

@@ -1,4 +1,4 @@
# $NetBSD: bsd.hostprog.mk,v 1.67 2012/02/29 20:07:57 tron Exp $
# $NetBSD: bsd.hostprog.mk,v 1.71 2013/06/14 16:10:02 tsutsui Exp $
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
.include <bsd.init.mk>
@@ -21,6 +21,8 @@ LIBDBM?= /usr/lib/libdbm.a
LIBDES?= /usr/lib/libdes.a
LIBEDIT?= /usr/lib/libedit.a
LIBEVENT?= /usr/lib/libevent.a
LIBEVENT_OPENSSL?= /usr/lib/libevent_openssl.a
LIBEVENT_PTHREADS?= /usr/lib/libevent_pthreads.a
LIBEXPAT?= /usr/lib/libexpat.a
LIBFETCH?= /usr/lib/libfetch.a
LIBFORM?= /usr/lib/libform.a
@@ -30,6 +32,7 @@ LIBINTL?= /usr/lib/libintl.a
LIBIPSEC?= /usr/lib/libipsec.a
LIBKVM?= /usr/lib/libkvm.a
LIBL?= /usr/lib/libl.a
LIBLUTOK?= /usr/lib/liblutok.a
LIBLZMA?= /usr/lib/liblzma.a
LIBM?= /usr/lib/libm.a
LIBMAGIC?= /usr/lib/libmagic.a
@@ -113,6 +116,10 @@ ${OBJS} ${LOBJS}: ${DPSRCS}
${HOSTPROG}: ${OBJS} ${DPADD}
${_MKTARGET_LINK}
${HOST_LINK.c} ${HOST_LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
.if !empty(.MAKE.OS:M*CYGWIN*)
${HOST_SH} ${NETBSDSRCDIR}/tools/binstall/mkmanifest ${HOSTPROG}
.endif
.endif # defined(OBJS) && !empty(OBJS)

View File

@@ -14,7 +14,6 @@ _BSD_OWN_MK_=1
LDSTATIC?= -static
MKDYNAMICROOT?= no
NO_LIBGOMP?= yes
MKKYUA?= yes
BINMODE?= 755
NONBINMODE?= 644
@@ -28,6 +27,7 @@ MKBINUTILS?= no
MKGDB:= no
MKGCC?= no
MKGCCCMDS?= no
MKSLJIT?= no
# LSC MINIX SMP Support?
.ifdef CONFIG_SMP
@@ -94,8 +94,14 @@ NOCLANGERROR?= yes
AFLAGS+= -D__ASSEMBLY__
CFLAGS+= -fno-builtin
# For C++ programs
#CPPFLAGS+= -I${DESTDIR}/usr/include/g++
# Compile Kyua only if we have MKGCCCMDS, as we need libstdc++ from GCC
.if ${MKGCCCMDS:Uno} == "no"
MKATF:= no
.else
# For C++ programs, only if we have the GCC sources
CXXFLAGS+= -I${DESTDIR}/usr/include/g++
MKKYUA?= yes
.endif # ${MKGCCCMDS:Uno} == "no"
#LSC FIXME: Needed by clang for now
.if ${MACHINE_ARCH} == "i386"
@@ -174,6 +180,19 @@ HAVE_GDB?= 6
HAVE_GDB?= 7
.endif
.if (${MACHINE_ARCH} == "alpha") || \
(${MACHINE_ARCH} == "hppa") || \
(${MACHINE_ARCH} == "ia64") || \
(${MACHINE_ARCH} == "mipsel") || (${MACHINE_ARCH} == "mipseb") || \
(${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
HAVE_SSP?= no
.else
HAVE_SSP?= yes
.if ${USE_FORT:Uno} != "no"
USE_SSP?= yes
.endif
.endif
.if empty(.MAKEFLAGS:M-V*)
.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
@@ -898,6 +917,14 @@ MKSOFTFLOAT?= yes
SOFTFLOAT_BITS= 32
.endif
.if ${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "x86_64" || \
${MACHINE_ARCH} == "sparc"
MKSLJIT?= yes
.else
MKSLJIT?= no
.endif
#
# MK* backward compatibility.
#
@@ -926,7 +953,6 @@ MKNLS:= no
MKHESIOD:= no
MKPOSTFIX:= no
MKKMOD:= no
MKATF:= no
MKEXTSRC:= no
MKRUMP:= no
MKSKEY:= no
@@ -997,6 +1023,7 @@ _MKVARS.no= \
MKBSDGREP MKBSDTAR \
MKCATPAGES MKCRYPTO_RC5 MKDEBUG \
MKDEBUGLIB MKDTRACE MKEXTSRC \
MKKYUA \
MKMANZ MKOBJDIRS \
MKLLVM MKPCC \
MKPIGZGZIP \
@@ -1041,6 +1068,7 @@ X11FLAVOUR?= Xorg
.if ${MKCXX} == "no"
MKATF:= no
MKGROFF:= no
MKKYUA:= no
.endif
.if ${MKCRYPTO} == "no"

View File

@@ -84,6 +84,7 @@ LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
# NB: If you are a library here, add it in bsd.README
.for _lib in \
archive \
atf_c \
atf_cxx \
bz2 \
@@ -95,9 +96,13 @@ LIBCRT0= ${DESTDIR}/usr/lib/crt0.o
edit \
expat \
l \
lua \
m \
magic \
objc \
rmt \
sqlite3 \
stdcxx \
terminfo \
util \
z

View File

@@ -1,4 +1,4 @@
# $NetBSD: bsd.test.mk,v 1.21 2012/08/25 22:21:16 jmmv Exp $
# $NetBSD: bsd.test.mk,v 1.24 2013/02/23 22:01:51 jmmv Exp $
#
.include <bsd.init.mk>
@@ -7,7 +7,6 @@ _TESTS:= # empty
.if defined(TESTS_SUBDIRS)
SUBDIR+= ${TESTS_SUBDIRS}
_TESTS:= ${TESTS_SUBDIRS:N.WAIT}
.endif
.include <bsd.subdir.mk>
@@ -60,6 +59,19 @@ ${_T}: ${TESTS_SH_SRC_${_T}}
.endif
ATFFILE?= auto
.if ${MKKYUA} != "no"
KYUAFILE?= ${ATFFILE}
.else
KYUAFILE= no
.endif
# Additional list of 'tp' entries to add to the Atffile when ATFFILE=auto.
# These entries must all correspond to subdirectories to descend into.
#
# This is useful in the cases where the tests in a single directory come
# from various sources (e.g. src/tests and src/external/.../tests) and
# the installation of some of those tests rely on MK* variables being set.
ATFFILE_EXTRA_SUBDIRS?=
.if ${ATFFILE:tl} != "no"
FILES+= Atffile
@@ -77,13 +89,51 @@ Atffile: Makefile
echo; \
echo 'prop: test-suite = "NetBSD"'; \
echo; \
for tp in ${_TESTS}; do \
for tp in ${TESTS_SUBDIRS:N.WAIT} ${_TESTS} ${ATFFILE_EXTRA_SUBDIRS}; \
do \
echo "tp: $${tp}"; \
done; } >Atffile.tmp
@mv Atffile.tmp Atffile
. endif
.endif
.include <bsd.files.mk>
.if ${KYUAFILE:tl} != "no"
FILES+= Kyuafile
FILESDIR_Kyuafile= ${TESTSDIR}
. if ${KYUAFILE:tl} == "auto"
CLEANDIRFILES+= Kyuafile Kyuafile.tmp
realall: Kyuafile
Kyuafile: Makefile
${_MKTARGET_CREATE}
@{ \
echo '-- Automatically generated by bsd.test.mk.'; \
echo; \
echo 'syntax(2)'; \
echo; \
echo 'test_suite("NetBSD")'; \
if [ -n "${_TESTS}" ]; then \
echo; \
for tp in ${_TESTS}; do \
echo "atf_test_program{name=\"$${tp}\"}"; \
done; \
fi; \
if [ -n "${TESTS_SUBDIRS:N.WAIT}" -o \
-n "${ATFFILE_EXTRA_SUBDIRS}" ]; then \
echo; \
for subdir in ${TESTS_SUBDIRS:N.WAIT} \
${ATFFILE_EXTRA_SUBDIRS}; do \
echo "include(\"$${subdir}/Kyuafile\")"; \
done; \
fi; \
} >Kyuafile.tmp
@mv Kyuafile.tmp Kyuafile
. endif
.endif
.if ${ATFFILE:tl} != "no" || ${KYUAFILE:tl} != "no"
. include <bsd.files.mk>
.endif
.if !empty(SCRIPTS) || !empty(PROGS) || !empty(PROGS_CXX)