1 | # $Id: intersects 2243 2009-01-10 02:24:02Z bird $ -*-perl-*-
|
---|
2 | ## @file
|
---|
3 | # $(intersects set-a,set-b)
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2008-2009 knut st. osmundsen <[email protected]>
|
---|
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 3 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, see <http://www.gnu.org/licenses/>
|
---|
23 | #
|
---|
24 | #
|
---|
25 |
|
---|
26 | $description = "Tests the $(intersecs ) predicate function";
|
---|
27 |
|
---|
28 | $details = "A few simple tests, nothing spectacular.";
|
---|
29 |
|
---|
30 | if ($is_kmk) {
|
---|
31 |
|
---|
32 | # TEST #0 - check that the feature is present.
|
---|
33 | # --------------------------------------------
|
---|
34 | run_make_test('
|
---|
35 | ifneq ($(intersects a b c d e f, a),1)
|
---|
36 | $(error sub-test 0 failed)
|
---|
37 | endif
|
---|
38 | .PHONY: all
|
---|
39 | all: ; @:
|
---|
40 | ',
|
---|
41 | '',
|
---|
42 | '');
|
---|
43 |
|
---|
44 | # TEST #1 - the real test.
|
---|
45 | # ------------------------
|
---|
46 | run_make_test('
|
---|
47 | ifneq ($(intersects a b c d e f, f),1)
|
---|
48 | $(error sub-test 0 failed)
|
---|
49 | endif
|
---|
50 | ifneq ($(intersects a b c d e f, f),1)
|
---|
51 | $(error sub-test 1 failed)
|
---|
52 | endif
|
---|
53 | ifneq ($(intersects a b c d e f, d),1)
|
---|
54 | $(error sub-test 2 failed)
|
---|
55 | endif
|
---|
56 | ifneq ($(intersects b c d e f, a),)
|
---|
57 | $(error sub-test 3 failed)
|
---|
58 | endif
|
---|
59 | ifneq ($(intersects a b c d e f, a b c d e f),1)
|
---|
60 | $(error sub-test 4 failed)
|
---|
61 | endif
|
---|
62 | ifneq ($(intersects a b c d e f, f e d c b a),1)
|
---|
63 | $(error sub-test 5 failed)
|
---|
64 | endif
|
---|
65 | ifneq ($(intersects f e d c b a, a b c d e f),1)
|
---|
66 | $(error sub-test 6 failed)
|
---|
67 | endif
|
---|
68 |
|
---|
69 | SET-A = make foo bar
|
---|
70 | SET-B = $(SET-A)
|
---|
71 | ifeq ($(intersects $(SET-A),$(SET-B)),)
|
---|
72 | $(error sub-test 7 failed)
|
---|
73 | endif
|
---|
74 | SET-B = foo
|
---|
75 | ifeq ($(intersects $(SET-A),$(SET-B)),)
|
---|
76 | $(error sub-test 8 failed)
|
---|
77 | endif
|
---|
78 | SET-B = foobar
|
---|
79 | ifneq ($(intersects $(SET-A),$(SET-B)),)
|
---|
80 | $(error sub-test 9 failed)
|
---|
81 | endif
|
---|
82 |
|
---|
83 | .PHONY: all
|
---|
84 | all: ; @:
|
---|
85 | ',
|
---|
86 | '',
|
---|
87 | '');
|
---|
88 | }
|
---|
89 |
|
---|
90 |
|
---|
91 |
|
---|
92 | # Indicate that we're done.
|
---|
93 | 1;
|
---|
94 |
|
---|