[BACK]Return to modorder.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / make / unit-tests

File: [cvs.NetBSD.org] / src / usr.bin / make / unit-tests / modorder.mk (download)

Revision 1.1, Thu Aug 21 13:44:51 2014 UTC (3 years, 5 months ago) by apb
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, HEAD

Give each group of tests its own output file.

* Rename each sub-makefile to *.mk;
* Add a *.exp file of expected output for each sub-makefile;
* Remove test.exp, which is replaced by all the other *.exp files.
* Use suffix rules to generate *.rawout and *.out files for
  each test case.
* Rewrite the test and accept targets to adapt to the new way.

The old (now removed) test.exp file is almost identical to the
concatenation (in the correct order) of all the new *.exp files.  There
are expected differences in makefile names embedded in the output, and
the new "exit status" lines.  Some old "*** Error code 1 (ignored)"
lines are also removed (replaced by new "exit status 1" lines).

# $NetBSD: modorder.mk,v 1.1 2014/08/21 13:44:51 apb Exp $

LIST=		one two three four five six seven eight nine ten
LISTX=		${LIST:Ox}
LISTSX:=	${LIST:Ox}
TEST_RESULT= && echo Ok || echo Failed

# unit-tests have to produce the same results on each run
# so we cannot actually include :Ox output.
all:
	@echo "LIST      = ${LIST}"
	@echo "LIST:O    = ${LIST:O}"
	# Note that 1 in every 10! trials two independently generated
	# randomized orderings will be the same.  The test framework doesn't
	# support checking probabilistic output, so we accept that the test
	# will incorrectly fail with probability 2.8E-7.
	@echo "LIST:Ox   = `test '${LIST:Ox}' != '${LIST:Ox}' ${TEST_RESULT}`"
	@echo "LIST:O:Ox = `test '${LIST:O:Ox}' != '${LIST:O:Ox}' ${TEST_RESULT}`"
	@echo "LISTX     = `test '${LISTX}' != '${LISTX}' ${TEST_RESULT}`"
	@echo "LISTSX    = `test '${LISTSX}' = '${LISTSX}' ${TEST_RESULT}`"
	@echo "BADMOD 1  = ${LIST:OX}"
	@echo "BADMOD 2  = ${LIST:OxXX}"