VirtualBox

source: kBuild/trunk/src/kmk/testcase-lazy-deps-vars.kmk@ 2016

Last change on this file since 2016 was 1934, checked in by bird, 16 years ago

kmk: Implemented lazy resolving of $+, $, $? and $|. This saves > 30% memory and also a bit of time.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1# $Id: testcase-lazy-deps-vars.kmk 1934 2008-10-24 22:24:02Z bird $
2## @file
3# kBuild - testcase for the lazy dependency lists.
4#
5
6#
7# Copyright (c) 2008 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 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
27DEPTH = ../..
28include $(PATH_KBUILD)/header.kmk
29
30ifneq ($(not 1),)
31 $(error The 'not' function is missing)
32endif
33ifneq ($(eq 1,1),1)
34 $(error The 'eq' function is missing)
35endif
36
37
38all: simple_1
39
40
41simple_1: variable.c variable.h variable.c variable.c variable.h function.c | variable.h read.c
42 @$(ECHO) "testcase-lazy-deps-vars.kmk::$@: TESTING..."
43 @$(ECHO) "pluss: $+"
44 $(if $(eq $+,variable.c variable.h variable.c variable.c variable.h function.c),,exit 1)
45 $(if $(eq $(deps-all $@,1),variable.c),,exit 1)
46 $(if $(eq $(deps-all $@,2),variable.h),,exit 2)
47 $(if $(eq $(deps-all $@,3),variable.c),,exit 3)
48 $(if $(eq $(deps-all $@,4),variable.c),,exit 4)
49 $(if $(eq $(deps-all $@,5),variable.h),,exit 5)
50 $(if $(eq $(deps-all $@,6),function.c),,exit 6)
51 $(if $(eq $(deps-all $@,7),),,exit 7)
52
53 @$(ECHO) "caret: $^"
54 $(if $(eq $^,variable.c variable.h function.c),,exit 1)
55 $(if $(eq $(deps $@,1),variable.c),,exit 1)
56 $(if $(eq $(deps $@,2),variable.h),,exit 2)
57 $(if $(eq $(deps $@,3),function.c),,exit 3)
58 $(if $(eq $(deps $@,4),),,exit 4)
59
60 @$(ECHO) "qmark: $?"
61 $(if $(eq $?,variable.c variable.h function.c),,exit 1)
62 $(if $(eq $(deps-newer $@,1),variable.c),,exit 1)
63 $(if $(eq $(deps-newer $@,2),variable.h),,exit 2)
64 $(if $(eq $(deps-newer $@,3),function.c),,exit 3)
65 $(if $(eq $(deps-newer $@,4),),,exit 4)
66
67 @$(ECHO) " bar: $|"
68 $(if $(eq $|,read.c),,exit 1)
69 $(if $(eq $(deps-oo $@,1),read.c),,exit 1)
70 $(if $(eq $(deps-oo $@,2),),,exit 2)
71
72 @$(ECHO) "testcase-lazy-deps-vars.kmk::simple_1: SUCCESS"
73
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette