]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/modorder.mk
Update to bmake-20200704
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / modorder.mk
1 # $NetBSD: modorder.mk,v 1.3 2020/06/09 01:48:17 sjg Exp $
2
3 LIST=           one two three four five six seven eight nine ten
4 LISTX=          ${LIST:Ox}
5 LISTSX:=        ${LIST:Ox}
6 TEST_RESULT= && echo Ok || echo Failed
7
8 # unit-tests have to produce the same results on each run
9 # so we cannot actually include :Ox output.
10 all:
11         @echo "LIST      = ${LIST}"
12         @echo "LIST:O    = ${LIST:O}"
13         @echo "LIST:Or    = ${LIST:Or}"
14         # Note that 1 in every 10! trials two independently generated
15         # randomized orderings will be the same.  The test framework doesn't
16         # support checking probabilistic output, so we accept that each of the
17         # 3 :Ox tests will incorrectly fail with probability 2.756E-7, which
18         # lets the whole test fail once in 1.209.600 runs, on average.
19         @echo "LIST:Ox   = `test '${LIST:Ox}' != '${LIST:Ox}' ${TEST_RESULT}`"
20         @echo "LIST:O:Ox = `test '${LIST:O:Ox}' != '${LIST:O:Ox}' ${TEST_RESULT}`"
21         @echo "LISTX     = `test '${LISTX}' != '${LISTX}' ${TEST_RESULT}`"
22         @echo "LISTSX    = `test '${LISTSX}' = '${LISTSX}' ${TEST_RESULT}`"
23         @echo "BADMOD 1  = ${LIST:OX}"
24         @echo "BADMOD 2  = ${LIST:OxXX}"