Source-Changes-HG archive

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

[src/trunk]: src Test make(1) by running the maintained tests, not unmaintained



details:   https://anonhg.NetBSD.org/src/rev/4094ac5138eb
branches:  trunk
changeset: 331742:4094ac5138eb
user:      apb <apb%NetBSD.org@localhost>
date:      Fri Aug 22 16:45:32 2014 +0000

description:
Test make(1) by running the maintained tests, not unmaintained
copies of them.

* Remove all old tests from src/tests/usr.bin/make/d_*.  These tests
  were unmaintained old copies of the actual tests which are maintained
  under src/usr.bin/make/unit-tests.  One exception is the test in
  d_unmatchedvarparen.mk, which was new, but has nw been added to
  src/usr.bin/make/unit-tests/varmisc.mk.
* In src/tests/usr.bin/make/Makefile, copy all
  the tests from src/usr.bin/make/unit-tests to
  ${DESTDIR}/usr/tests/usr.bin/make/unit-tests.
* In src/tests/usr.bin/make/t_make.sh, run the tests installed above,
  instead of the old tests.
* In etc/mtree/NetBSD.dist.tests, create the
  usr/tests/usr.bin/make/unit-tests diectory.
* Update the set lists for all the above.

diffstat:

 distrib/sets/lists/tests/mi                |  128 ++++++++++++++++++------
 etc/mtree/NetBSD.dist.tests                |    3 +-
 tests/usr.bin/make/Makefile                |   59 ++++------
 tests/usr.bin/make/d_comment.mk            |   31 -----
 tests/usr.bin/make/d_comment.out           |    4 -
 tests/usr.bin/make/d_cond1.mk              |  102 -------------------
 tests/usr.bin/make/d_cond1.out             |   18 ---
 tests/usr.bin/make/d_dotwait.mk            |   61 -----------
 tests/usr.bin/make/d_dotwait.out           |   29 -----
 tests/usr.bin/make/d_export.mk             |   22 ----
 tests/usr.bin/make/d_export.out            |    5 -
 tests/usr.bin/make/d_export_all.mk         |   11 --
 tests/usr.bin/make/d_export_all.out        |    9 -
 tests/usr.bin/make/d_moderrs.mk            |   31 -----
 tests/usr.bin/make/d_moderrs.out           |   15 --
 tests/usr.bin/make/d_modmatch.mk           |   18 ---
 tests/usr.bin/make/d_modmatch.out          |   15 --
 tests/usr.bin/make/d_modmisc.mk            |   33 ------
 tests/usr.bin/make/d_modmisc.out           |    8 -
 tests/usr.bin/make/d_modorder.mk           |   22 ----
 tests/usr.bin/make/d_modorder.out          |   10 -
 tests/usr.bin/make/d_modts.mk              |   32 ------
 tests/usr.bin/make/d_modts.out             |   32 ------
 tests/usr.bin/make/d_modword.mk            |  151 -----------------------------
 tests/usr.bin/make/d_modword.out           |  121 -----------------------
 tests/usr.bin/make/d_posix.mk              |   24 ----
 tests/usr.bin/make/d_posix.out             |   22 ----
 tests/usr.bin/make/d_qequals.mk            |    8 -
 tests/usr.bin/make/d_qequals.out           |    1 -
 tests/usr.bin/make/d_ternary.mk            |    8 -
 tests/usr.bin/make/d_ternary.out           |    9 -
 tests/usr.bin/make/d_unmatchedvarparen.mk  |    3 -
 tests/usr.bin/make/d_unmatchedvarparen.out |    1 -
 tests/usr.bin/make/d_varcmd.mk             |   49 ---------
 tests/usr.bin/make/d_varcmd.out            |    8 -
 tests/usr.bin/make/t_make.sh               |   76 ++++++--------
 36 files changed, 155 insertions(+), 1024 deletions(-)

diffs (truncated from 1377 to 300 lines):

diff -r 8bea8e093774 -r 4094ac5138eb distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Fri Aug 22 15:27:50 2014 +0000
+++ b/distrib/sets/lists/tests/mi       Fri Aug 22 16:45:32 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.585 2014/08/22 10:51:38 apb Exp $
+# $NetBSD: mi,v 1.586 2014/08/22 16:45:32 apb Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3463,38 +3463,100 @@
 ./usr/tests/usr.bin/make                       tests-usr.bin-tests
 ./usr/tests/usr.bin/make/Atffile               tests-usr.bin-tests     atf
 ./usr/tests/usr.bin/make/Kyuafile              tests-usr.bin-tests     atf,kyua
-./usr/tests/usr.bin/make/d_comment.mk          tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_comment.out         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_cond1.mk            tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_cond1.out           tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_dotwait.mk          tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_dotwait.out         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_export.mk           tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_export.out          tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_export_all.mk       tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_export_all.out      tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_moderrs.mk          tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_moderrs.out         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modmatch.mk         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modmatch.out                tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modmisc.mk          tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modmisc.out         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modorder.mk         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modorder.out                tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modts.mk            tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modts.out           tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modword.mk          tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_modword.out         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_posix.mk            tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_posix.out           tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_qequals.mk          tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_qequals.out         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_ternary.mk          tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_ternary.out         tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_unmatchedvarparen.mk        tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_unmatchedvarparen.out       tests-usr.bin-tests
-./usr/tests/usr.bin/make/d_varcmd.mk           tests-usr.bin-tests     atf
-./usr/tests/usr.bin/make/d_varcmd.out          tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests            tests-usr.bin-tests
+./usr/tests/usr.bin/make/unit-tests/Makefile   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/comment.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/comment.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/cond1.exp  tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/cond1.mk   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/doterror.exp       tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/doterror.mk        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/dotwait.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/dotwait.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/error.exp  tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/error.mk   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/export-all.exp     tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/export-all.mk      tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/export-env.exp     tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/export-env.mk      tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/export.exp tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/export.mk  tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/forloop.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/forloop.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/forsubst.exp       tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/forsubst.mk        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/hash.exp   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/hash.mk    tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/misc.exp   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/misc.mk    tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/moderrs.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/moderrs.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modmatch.exp       tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modmatch.mk        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modmisc.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modmisc.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modorder.exp       tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modorder.mk        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modts.exp  tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modts.mk   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modword.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/modword.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/order.exp  tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/order.mk   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/phony-end.exp      tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/phony-end.mk       tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/posix.exp  tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/posix.mk   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/qequals.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/qequals.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/sunshcmd.exp       tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/sunshcmd.mk        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/sysv.exp   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/sysv.mk    tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/ternary.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/ternary.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/unexport-env.exp   tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/unexport-env.mk    tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/unexport.exp       tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/unexport.mk        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/varcmd.exp tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/varcmd.mk  tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/varmisc.exp        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/varmisc.mk tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/varshell.exp       tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/unit-tests/varshell.mk        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/make/d_comment.mk          tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_comment.out         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_cond1.mk            tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_cond1.out           tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_dotwait.mk          tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_dotwait.out         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_export.mk           tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_export.out          tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_export_all.mk       tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_export_all.out      tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_moderrs.mk          tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_moderrs.out         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modmatch.mk         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modmatch.out                tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modmisc.mk          tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modmisc.out         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modorder.mk         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modorder.out                tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modts.mk            tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modts.out           tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modword.mk          tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_modword.out         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_posix.mk            tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_posix.out           tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_qequals.mk          tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_qequals.out         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_ternary.mk          tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_ternary.out         tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_unmatchedvarparen.mk        tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_unmatchedvarparen.out       tests-obsolete obsolete,atf
+./usr/tests/usr.bin/make/d_varcmd.mk           tests-obsolete  obsolete,atf
+./usr/tests/usr.bin/make/d_varcmd.out          tests-obsolete  obsolete,atf
 ./usr/tests/usr.bin/make/t_make                        tests-usr.bin-tests     atf
 ./usr/tests/usr.bin/mkdep                      tests-usr.bin-tests
 ./usr/tests/usr.bin/mkdep/Atffile              tests-usr.bin-tests     atf
diff -r 8bea8e093774 -r 4094ac5138eb etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Fri Aug 22 15:27:50 2014 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Fri Aug 22 16:45:32 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.tests,v 1.108 2014/06/30 21:32:59 alnsn Exp $
+#      $NetBSD: NetBSD.dist.tests,v 1.109 2014/08/22 16:45:32 apb Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -358,6 +358,7 @@
 ./usr/tests/usr.bin/jot
 ./usr/tests/usr.bin/m4
 ./usr/tests/usr.bin/make
+./usr/tests/usr.bin/make/unit-tests
 ./usr/tests/usr.bin/mkdep
 ./usr/tests/usr.bin/nbperf
 ./usr/tests/usr.bin/pr
diff -r 8bea8e093774 -r 4094ac5138eb tests/usr.bin/make/Makefile
--- a/tests/usr.bin/make/Makefile       Fri Aug 22 15:27:50 2014 +0000
+++ b/tests/usr.bin/make/Makefile       Fri Aug 22 16:45:32 2014 +0000
@@ -1,4 +1,12 @@
-# $NetBSD: Makefile,v 1.1 2012/03/17 16:33:14 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2014/08/22 16:45:32 apb Exp $
+
+# The tests for make(1) are maintained in src/usr.bin/make/unit-tests
+# (UNIT_TESTS_DISTDIR).  We copy them verbatim to ${FILESDIR}/unit-tests
+# (UNIT_TESTS_DIR) at install time.
+#
+# The t_make .sh script (installed as ${FILESDIR}/t_make) is the only
+# thing that knows about Atf.  At run time, the t_make simply invokes
+# the Makefile in UNIT_TESTS_DIR for each test.
 
 NOMAN=                 # defined
 
@@ -9,37 +17,22 @@
 TESTS_SH=              t_make
 
 FILESDIR=              ${TESTSDIR}
-FILES=                 d_comment.mk
-FILES+=                        d_comment.out
-FILES+=                        d_cond1.mk
-FILES+=                        d_cond1.out
-FILES+=                        d_dotwait.mk
-FILES+=                        d_dotwait.out
-FILES+=                        d_export.mk
-FILES+=                        d_export.out
-FILES+=                        d_export_all.mk
-FILES+=                        d_export_all.out
-FILES+=                        d_moderrs.mk
-FILES+=                        d_moderrs.out
-FILES+=                        d_modmatch.mk
-FILES+=                        d_modmatch.out
-FILES+=                        d_modmisc.mk
-FILES+=                        d_modmisc.out
-FILES+=                        d_modorder.mk
-FILES+=                        d_modorder.out
-FILES+=                        d_modts.mk
-FILES+=                        d_modts.out
-FILES+=                        d_modword.mk
-FILES+=                        d_modword.out
-FILES+=                        d_posix.mk
-FILES+=                        d_posix.out
-FILES+=                        d_qequals.mk
-FILES+=                        d_qequals.out
-FILES+=                        d_ternary.mk
-FILES+=                        d_ternary.out
-FILES+=                        d_unmatchedvarparen.mk
-FILES+=                        d_unmatchedvarparen.out
-FILES+=                        d_varcmd.mk
-FILES+=                        d_varcmd.out
+
+# Where we install the copies of the files for the tests
+UNIT_TESTS_DIR=                ${FILESDIR}/unit-tests
+
+# Where we obtain the original files for the tests
+UNIT_TESTS_DISTDIR=    ${NETBSDSRCDIR}/usr.bin/make/unit-tests
+
+# Which original files to copy
+DISTFILES!=    (cd ${UNIT_TESTS_DISTDIR} && echo Makefile *.mk *.exp)
+
+# Instruct bsd.files.mk to make the copies
+.for f in ${DISTFILES}
+_file := ${UNIT_TESTS_DISTDIR}/${f}
+FILES+= ${UNIT_TESTS_DISTDIR}/${f}
+FILESNAME_${_file} := ${_file:T}
+FILESDIR_${_file} := ${UNIT_TESTS_DIR}
+.endfor
 
 .include <bsd.test.mk>
diff -r 8bea8e093774 -r 4094ac5138eb tests/usr.bin/make/d_comment.mk
--- a/tests/usr.bin/make/d_comment.mk   Fri Aug 22 15:27:50 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-# This is a comment
-.if ${MACHINE_ARCH} == something
-FOO=bar
-.endif
-
-#\
-       Multiline comment
-
-BAR=# defined
-FOOBAR= # defined 
-
-# This is an escaped comment \
-that keeps going until the end of this line
-
-# Another escaped comment \
-that \
-goes \
-on
-
-# This is NOT an escaped comment due to the double backslashes \\
-all: hi foo bar
-       @echo comment testing done
-
-hi:
-       @echo comment testing start
-
-foo:
-       @echo this is $@
-
-bar:
-       @echo This is how a comment looks: '# comment'
diff -r 8bea8e093774 -r 4094ac5138eb tests/usr.bin/make/d_comment.out
--- a/tests/usr.bin/make/d_comment.out  Fri Aug 22 15:27:50 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-comment testing start
-this is foo
-This is how a comment looks: # comment
-comment testing done
diff -r 8bea8e093774 -r 4094ac5138eb tests/usr.bin/make/d_cond1.mk
--- a/tests/usr.bin/make/d_cond1.mk     Fri Aug 22 15:27:50 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-# $NetBSD: d_cond1.mk,v 1.1 2012/03/17 16:33:14 jruoho Exp $
-
-# hard code these!
-TEST_UNAME_S= NetBSD
-TEST_UNAME_M= sparc
-TEST_MACHINE= i386
-
-.if ${TEST_UNAME_S}
-Ok=var,
-.endif
-.if ("${TEST_UNAME_S}")
-Ok+=(\"var\"),
-.endif
-.if (${TEST_UNAME_M} != ${TEST_MACHINE})
-Ok+=(var != var),
-.endif
-.if ${TEST_UNAME_M} != ${TEST_MACHINE}
-Ok+= var != var,
-.endif
-.if !((${TEST_UNAME_M} != ${TEST_MACHINE}) && defined(X))
-Ok+= !((var != var) && defined(name)),
-.endif



Home | Main Index | Thread Index | Old Index