Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk Implement Atffile automatic generation.



details:   https://anonhg.NetBSD.org/src/rev/8d013d8bc9f6
branches:  trunk
changeset: 756351:8d013d8bc9f6
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Tue Jul 13 21:11:41 2010 +0000

description:
Implement Atffile automatic generation.

This change adds the ATFFILE variable, which can take the following values:
- yes: The source directory contains a static Atffile to be installed.
- auto: The Atffile is automatically generated.
- no: Do not install any Atffile (replaces the previous NOATFFILE variable).

The ugly bit of this is that I have to add a TESTS_SUBDIRS variable that
lists the subdirectories that contain test cases (so that they can be listed
in the Atffiles, without including auxiliary directories without tests).
This is a subset of SUBDIR.

Addresses a minor part of PR bin/43394.

diffstat:

 share/mk/bsd.test.mk |  39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 2 deletions(-)

diffs (62 lines):

diff -r a8161a64a396 -r 8d013d8bc9f6 share/mk/bsd.test.mk
--- a/share/mk/bsd.test.mk      Tue Jul 13 18:13:57 2010 +0000
+++ b/share/mk/bsd.test.mk      Tue Jul 13 21:11:41 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.test.mk,v 1.10 2010/06/18 13:14:21 jmmv Exp $
+# $NetBSD: bsd.test.mk,v 1.11 2010/07/13 21:11:41 jmmv Exp $
 #
 
 .include <bsd.init.mk>
@@ -7,6 +7,18 @@
 
 _TESTS=                # empty
 
+.if defined(TESTS_SUBDIRS)
+SUBDIR+=       ${TESTS_SUBDIRS}
+
+.  for dir in ${TESTS_SUBDIRS}
+.    if ${dir} != ".WAIT"
+_TESTS:=       ${_TESTS} ${dir}
+.    endif
+.  endfor
+.endif
+
+.include <bsd.subdir.mk>
+
 .if defined(TESTS_C)
 PROGS+=                ${TESTS_C}
 LDADD+=                -latf-c
@@ -46,9 +58,32 @@
 .  endfor
 .endif
 
-.if !defined(NOATFFILE)
+ATFFILE?=      auto
+
+.if empty(ATFFILE:M[Nn][Oo])
 FILES+=                        Atffile
 FILESDIR_Atffile=      ${TESTSDIR}
+
+.  if !empty(ATFFILE:M[Aa][Uu][Tt][Oo])
+realall: Atffile
+Atffile: Makefile
+       ${_MKTARGET_CREATE}
+       @{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \
+       echo; \
+       echo '# Automatically generated by bsd.test.mk.'; \
+       echo; \
+       echo 'prop: test-suite = "NetBSD"'; \
+       echo; \
+       for tp in ${_TESTS}; do \
+           echo "tp: $${tp}"; \
+       done; } >Atffile.tmp
+       @mv Atffile.tmp Atffile
+
+clean: clean-atffile
+clean-atffile: .PHONY
+       rm -f Atffile Atffile.tmp
+.  endif
+
 .include <bsd.files.mk>
 .endif
 



Home | Main Index | Thread Index | Old Index