VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/functions/warning@ 486

Last change on this file since 486 was 53, checked in by bird, 21 years ago

Initial revision

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1$description = "\
2The following test creates a makefile to test the warning function.";
3
4$details = "";
5
6open(MAKEFILE,"> $makefile");
7
8print MAKEFILE <<'EOF';
9ifdef WARNING1
10$(warning warning is $(WARNING1))
11endif
12
13ifdef WARNING2
14$(warning warning is $(WARNING2))
15endif
16
17ifdef WARNING3
18all: some; @echo hi $(warning warning is $(WARNING3))
19endif
20
21ifdef WARNING4
22all: some; @echo hi
23 @echo there $(warning warning is $(WARNING4))
24endif
25
26some: ; @echo Some stuff
27
28EOF
29
30close(MAKEFILE);
31
32# Test #1
33
34&run_make_with_options($makefile, "WARNING1=yes", &get_logfile, 0);
35$answer = "$makefile:2: warning is yes\nSome stuff\n";
36&compare_output($answer,&get_logfile(1));
37
38# Test #2
39
40&run_make_with_options($makefile, "WARNING2=no", &get_logfile, 0);
41$answer = "$makefile:6: warning is no\nSome stuff\n";
42&compare_output($answer,&get_logfile(1));
43
44# Test #3
45
46&run_make_with_options($makefile, "WARNING3=maybe", &get_logfile, 0);
47$answer = "Some stuff\n$makefile:10: warning is maybe\nhi\n";
48&compare_output($answer,&get_logfile(1));
49
50# Test #4
51
52&run_make_with_options($makefile, "WARNING4=definitely", &get_logfile, 0);
53$answer = "Some stuff\n$makefile:14: warning is definitely\nhi\nthere\n";
54&compare_output($answer,&get_logfile(1));
55
56# This tells the test driver that the perl test script executed properly.
571;
58
59
60
61
62
63
Note: See TracBrowser for help on using the repository browser.

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