| 1 | # $Id: $
|
|---|
| 2 | ## @file
|
|---|
| 3 | # kBuild - testcase for the if1of and ifn1of conditionals.
|
|---|
| 4 | #
|
|---|
| 5 |
|
|---|
| 6 | #
|
|---|
| 7 | # Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
|
|---|
| 8 | #
|
|---|
| 9 | # This file is part of kBuild.
|
|---|
| 10 | #
|
|---|
| 11 | # kBuild is free software; you can redistribute it and/or modify
|
|---|
| 12 | # it under the terms of the GNU General Public License as published by
|
|---|
| 13 | # the Free Software Foundation; either version 2 of the License, or
|
|---|
| 14 | # (at your option) any later version.
|
|---|
| 15 | #
|
|---|
| 16 | # kBuild is distributed in the hope that it will be useful,
|
|---|
| 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
|
|---|
| 22 | # along with kBuild; if not, write to the Free Software
|
|---|
| 23 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|---|
| 24 | #
|
|---|
| 25 | #
|
|---|
| 26 |
|
|---|
| 27 | DEPTH = ../..
|
|---|
| 28 | include $(PATH_KBUILD)/header.kmk
|
|---|
| 29 |
|
|---|
| 30 | # the basics.
|
|---|
| 31 | if1of (asdf,asdf)
|
|---|
| 32 | else
|
|---|
| 33 | $(error busted)
|
|---|
| 34 | endif
|
|---|
| 35 | ifn1of (asdf,asdf)
|
|---|
| 36 | $(error busted)
|
|---|
| 37 | endif
|
|---|
| 38 |
|
|---|
| 39 | # larger sets.
|
|---|
| 40 | if1of (1,2 3 4 5 6 7 8 9 0)
|
|---|
| 41 | $(error busted)
|
|---|
| 42 | endif
|
|---|
| 43 | if1of (1,12 3 4 5 6 7 8 9 0)
|
|---|
| 44 | $(error busted)
|
|---|
| 45 | endif
|
|---|
| 46 | if1of (1,2 31 4 5 6 7 8 9 0)
|
|---|
| 47 | $(error busted)
|
|---|
| 48 | endif
|
|---|
| 49 | ifn1of (1,1 2 3 4 5 6 7 8 9 0)
|
|---|
| 50 | $(error busted)
|
|---|
| 51 | endif
|
|---|
| 52 | ifn1of (8,1 2 3 4 5 6 7 8 9 0)
|
|---|
| 53 | $(error busted)
|
|---|
| 54 | endif
|
|---|
| 55 | ifn1of (asdf,asdf)
|
|---|
| 56 | $(error busted)
|
|---|
| 57 | endif
|
|---|
| 58 | ifn1of (asdf,asdf asdf)
|
|---|
| 59 | $(error busted)
|
|---|
| 60 | endif
|
|---|
| 61 |
|
|---|
| 62 | # any in set 1 match any in set 2.
|
|---|
| 63 | if1of (1 3 5 7 9, 2 4 6 8)
|
|---|
| 64 | $(error busted)
|
|---|
| 65 | endif
|
|---|
| 66 | ifn1of (1 2 3 4 5, 2 4 6 8)
|
|---|
| 67 | $(error busted)
|
|---|
| 68 | endif
|
|---|
| 69 |
|
|---|
| 70 | # real life.
|
|---|
| 71 | ifn1of (win linux, linux)
|
|---|
| 72 | $(error busted)
|
|---|
| 73 | endif
|
|---|
| 74 | ifn1of (win.x86, win.amd64 linux.x86 darwin.x86 win.x86 os2.x86)
|
|---|
| 75 | $(error busted)
|
|---|
| 76 | endif
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 | all_recursive:
|
|---|
| 80 | $(ECHO) "if1of and ifn1of works fine"
|
|---|