xref: /minix3/usr.bin/make/unit-tests/modorder.mk (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc# $NetBSD: modorder.mk,v 1.1 2014/08/21 13:44:51 apb Exp $
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel SambucLIST=		one two three four five six seven eight nine ten
4*0a6a1f1dSLionel SambucLISTX=		${LIST:Ox}
5*0a6a1f1dSLionel SambucLISTSX:=	${LIST:Ox}
6*0a6a1f1dSLionel SambucTEST_RESULT= && echo Ok || echo Failed
7*0a6a1f1dSLionel Sambuc
8*0a6a1f1dSLionel Sambuc# unit-tests have to produce the same results on each run
9*0a6a1f1dSLionel Sambuc# so we cannot actually include :Ox output.
10*0a6a1f1dSLionel Sambucall:
11*0a6a1f1dSLionel Sambuc	@echo "LIST      = ${LIST}"
12*0a6a1f1dSLionel Sambuc	@echo "LIST:O    = ${LIST:O}"
13*0a6a1f1dSLionel Sambuc	# Note that 1 in every 10! trials two independently generated
14*0a6a1f1dSLionel Sambuc	# randomized orderings will be the same.  The test framework doesn't
15*0a6a1f1dSLionel Sambuc	# support checking probabilistic output, so we accept that the test
16*0a6a1f1dSLionel Sambuc	# will incorrectly fail with probability 2.8E-7.
17*0a6a1f1dSLionel Sambuc	@echo "LIST:Ox   = `test '${LIST:Ox}' != '${LIST:Ox}' ${TEST_RESULT}`"
18*0a6a1f1dSLionel Sambuc	@echo "LIST:O:Ox = `test '${LIST:O:Ox}' != '${LIST:O:Ox}' ${TEST_RESULT}`"
19*0a6a1f1dSLionel Sambuc	@echo "LISTX     = `test '${LISTX}' != '${LISTX}' ${TEST_RESULT}`"
20*0a6a1f1dSLionel Sambuc	@echo "LISTSX    = `test '${LISTSX}' = '${LISTSX}' ${TEST_RESULT}`"
21*0a6a1f1dSLionel Sambuc	@echo "BADMOD 1  = ${LIST:OX}"
22*0a6a1f1dSLionel Sambuc	@echo "BADMOD 2  = ${LIST:OxXX}"
23