summaryrefslogtreecommitdiff
path: root/usr.bin/make/unit-tests/Makefile
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-03-15 13:08:45 -0500
committerKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-03-15 13:08:45 -0500
commit09cff699a514e452eccc6420f1213967b767cb3e (patch)
treee9888cd55d03c840b20d080af4e472453c910835 /usr.bin/make/unit-tests/Makefile
parentffeabdfb18fd21102159641f5258e8b1c473dec2 (diff)
downloaduserland-09cff699a514e452eccc6420f1213967b767cb3e.tar.gz
userland-09cff699a514e452eccc6420f1213967b767cb3e.tar.bz2
userland-09cff699a514e452eccc6420f1213967b767cb3e.tar.xz
userland-09cff699a514e452eccc6420f1213967b767cb3e.zip
rm bin/sh usr.bin/make: utilities provided by other packages
Diffstat (limited to 'usr.bin/make/unit-tests/Makefile')
-rw-r--r--usr.bin/make/unit-tests/Makefile139
1 files changed, 0 insertions, 139 deletions
diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile
deleted file mode 100644
index 07aaceb..0000000
--- a/usr.bin/make/unit-tests/Makefile
+++ /dev/null
@@ -1,139 +0,0 @@
-# $NetBSD: Makefile,v 1.53 2018/05/24 00:25:44 christos Exp $
-#
-# Unit tests for make(1)
-# The main targets are:
-#
-# all: run all the tests
-# test: run 'all', and compare to expected results
-# accept: move generated output to expected results
-#
-# Adding a test case.
-# Each feature should get its own set of tests in its own suitably
-# named makefile (*.mk), with its own set of expected results (*.exp),
-# and it should be added to the TESTNAMES list.
-#
-
-.MAIN: all
-
-UNIT_TESTS:= ${.PARSEDIR}
-.PATH: ${UNIT_TESTS}
-
-# Each test is in a sub-makefile.
-# Keep the list sorted.
-TESTNAMES= \
- comment \
- cond1 \
- cond2 \
- error \
- export \
- export-all \
- export-env \
- doterror \
- dotwait \
- forloop \
- forsubst \
- hash \
- misc \
- moderrs \
- modmatch \
- modmisc \
- modorder \
- modts \
- modword \
- order \
- posix \
- qequals \
- sunshcmd \
- sysv \
- ternary \
- unexport \
- unexport-env \
- varcmd \
- varmisc \
- varquote \
- varshell
-
-# these tests were broken by referting POSIX chanegs
-STRICT_POSIX_TESTS = \
- escape \
- impsrc \
- phony-end \
- posix1 \
- suffixes
-
-# Override make flags for certain tests
-flags.doterror=
-flags.order=-j1
-
-OUTFILES= ${TESTNAMES:S/$/.out/}
-
-all: ${OUTFILES}
-
-CLEANFILES += *.rawout *.out *.status *.tmp *.core *.tmp
-CLEANFILES += obj*.[och] lib*.a # posix1.mk
-CLEANFILES += issue* .[ab]* # suffixes.mk
-CLEANRECURSIVE += dir dummy # posix1.mk
-
-clean:
- rm -f ${CLEANFILES}
-.if !empty(CLEANRECURSIVE)
- rm -rf ${CLEANRECURSIVE}
-.endif
-
-TEST_MAKE?= ${.MAKE}
-TOOL_SED?= sed
-
-# ensure consistent results from sort(1)
-LC_ALL= C
-LANG= C
-.export LANG LC_ALL
-
-# the tests are actually done with sub-makes.
-.SUFFIXES: .mk .rawout .out
-.mk.rawout:
- @echo ${TEST_MAKE} ${flags.${.TARGET:R}:U-k} -f ${.IMPSRC}
- -@cd ${.OBJDIR} && \
- { ${TEST_MAKE} ${flags.${.TARGET:R}:U-k} -f ${.IMPSRC} \
- 2>&1 ; echo $$? >${.TARGET:R}.status ; } > ${.TARGET}.tmp
- @mv ${.TARGET}.tmp ${.TARGET}
-
-# We always pretend .MAKE was called 'make'
-# and strip ${.CURDIR}/ from the output
-# and replace anything after 'stopped in' with unit-tests
-# so the results can be compared.
-.rawout.out:
- @echo postprocess ${.TARGET}
- @${TOOL_SED} -e 's,^${TEST_MAKE:T:C/\./\\\./g}[][0-9]*:,make:,' \
- -e 's,${TEST_MAKE:C/\./\\\./g},make,' \
- -e '/stopped/s, /.*, unit-tests,' \
- -e 's,${.CURDIR:C/\./\\\./g}/,,g' \
- -e 's,${UNIT_TESTS:C/\./\\\./g}/,,g' \
- < ${.IMPSRC} > ${.TARGET}.tmp
- @echo "exit status `cat ${.TARGET:R}.status`" >> ${.TARGET}.tmp
- @mv ${.TARGET}.tmp ${.TARGET}
-
-# Compare all output files
-test: ${OUTFILES} .PHONY
- @failed= ; \
- for test in ${TESTNAMES}; do \
- diff -u ${UNIT_TESTS}/$${test}.exp $${test}.out \
- || failed="$${failed}$${failed:+ }$${test}" ; \
- done ; \
- if [ -n "$${failed}" ]; then \
- echo "Failed tests: $${failed}" ; false ; \
- else \
- echo "All tests passed" ; \
- fi
-
-accept:
- @for test in ${TESTNAMES}; do \
- cmp -s ${UNIT_TESTS}/$${test}.exp $${test}.out \
- || { echo "Replacing $${test}.exp" ; \
- cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \
- done
-
-.if exists(${TEST_MAKE})
-${TESTNAMES:S/$/.rawout/}: ${TEST_MAKE}
-.endif
-
-.-include <bsd.obj.mk>