[2019] | 1 | # $Id: testcase-if1of.kmk 2413 2010-09-11 17:43:04Z bird $
|
---|
[819] | 2 | ## @file
|
---|
[1109] | 3 | # kBuild - testcase for the if1of and ifn1of conditionals.
|
---|
[819] | 4 | #
|
---|
[1109] | 5 |
|
---|
[819] | 6 | #
|
---|
[2413] | 7 | # Copyright (c) 2007-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
|
---|
[819] | 8 | #
|
---|
[1109] | 9 | # This file is part of kBuild.
|
---|
[819] | 10 | #
|
---|
[1109] | 11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
[819] | 12 | # it under the terms of the GNU General Public License as published by
|
---|
[2019] | 13 | # the Free Software Foundation; either version 3 of the License, or
|
---|
[819] | 14 | # (at your option) any later version.
|
---|
| 15 | #
|
---|
[1109] | 16 | # kBuild is distributed in the hope that it will be useful,
|
---|
[819] | 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | # GNU General Public License for more details.
|
---|
| 20 | #
|
---|
| 21 | # You should have received a copy of the GNU General Public License
|
---|
[2019] | 22 | # along with kBuild. If not, see <http://www.gnu.org/licenses/>
|
---|
[819] | 23 | #
|
---|
| 24 | #
|
---|
| 25 |
|
---|
| 26 | DEPTH = ../..
|
---|
| 27 | include $(PATH_KBUILD)/header.kmk
|
---|
| 28 |
|
---|
[1109] | 29 | # the basics.
|
---|
| 30 | if1of (asdf,asdf)
|
---|
| 31 | else
|
---|
| 32 | $(error busted)
|
---|
[819] | 33 | endif
|
---|
[1109] | 34 | ifn1of (asdf,asdf)
|
---|
| 35 | $(error busted)
|
---|
[819] | 36 | endif
|
---|
| 37 |
|
---|
[1109] | 38 | # larger sets.
|
---|
| 39 | if1of (1,2 3 4 5 6 7 8 9 0)
|
---|
| 40 | $(error busted)
|
---|
| 41 | endif
|
---|
| 42 | if1of (1,12 3 4 5 6 7 8 9 0)
|
---|
| 43 | $(error busted)
|
---|
| 44 | endif
|
---|
| 45 | if1of (1,2 31 4 5 6 7 8 9 0)
|
---|
| 46 | $(error busted)
|
---|
| 47 | endif
|
---|
| 48 | ifn1of (1,1 2 3 4 5 6 7 8 9 0)
|
---|
| 49 | $(error busted)
|
---|
| 50 | endif
|
---|
| 51 | ifn1of (8,1 2 3 4 5 6 7 8 9 0)
|
---|
| 52 | $(error busted)
|
---|
| 53 | endif
|
---|
| 54 | ifn1of (asdf,asdf)
|
---|
| 55 | $(error busted)
|
---|
| 56 | endif
|
---|
| 57 | ifn1of (asdf,asdf asdf)
|
---|
| 58 | $(error busted)
|
---|
| 59 | endif
|
---|
[819] | 60 |
|
---|
[1109] | 61 | # any in set 1 match any in set 2.
|
---|
| 62 | if1of (1 3 5 7 9, 2 4 6 8)
|
---|
| 63 | $(error busted)
|
---|
| 64 | endif
|
---|
| 65 | ifn1of (1 2 3 4 5, 2 4 6 8)
|
---|
| 66 | $(error busted)
|
---|
| 67 | endif
|
---|
| 68 |
|
---|
| 69 | # real life.
|
---|
| 70 | ifn1of (win linux, linux)
|
---|
| 71 | $(error busted)
|
---|
| 72 | endif
|
---|
| 73 | ifn1of (win.x86, win.amd64 linux.x86 darwin.x86 win.x86 os2.x86)
|
---|
| 74 | $(error busted)
|
---|
| 75 | endif
|
---|
| 76 |
|
---|
| 77 |
|
---|
[819] | 78 | all_recursive:
|
---|
[1719] | 79 | $(ECHO) "if1of and ifn1of work fine"
|
---|
[2019] | 80 |
|
---|