VirtualBox

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

最後變更 在這個檔案從3208是 3138,由 bird 提交於 7 年 前

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

  • 屬性 svn:eol-style 設為 LF
檔案大小: 1.8 KB
 
1# -*-Perl-*-
2
3$description = "\
4The following test creates a makefile to test the warning function.";
5
6$details = "";
7
8open(MAKEFILE,"> $makefile");
9
10print MAKEFILE <<'EOF';
11ifdef WARNING1
12$(warning warning is $(WARNING1))
13endif
14
15ifdef WARNING2
16$(warning warning is $(WARNING2))
17endif
18
19ifdef WARNING3
20all: some; @echo hi $(warning warning is $(WARNING3))
21endif
22
23ifdef WARNING4
24all: some; @echo hi
25 @echo there $(warning warning is $(WARNING4))
26endif
27
28some: ; @echo Some stuff
29
30EOF
31
32close(MAKEFILE);
33
34# Test #1
35
36&run_make_with_options($makefile, "WARNING1=yes", &get_logfile, 0);
37$answer = "$makefile:2: warning is yes\nSome stuff\n";
38&compare_output($answer,&get_logfile(1));
39
40# Test #2
41
42&run_make_with_options($makefile, "WARNING2=no", &get_logfile, 0);
43$answer = "$makefile:6: warning is no\nSome stuff\n";
44&compare_output($answer,&get_logfile(1));
45
46# Test #3
47
48&run_make_with_options($makefile, "WARNING3=maybe", &get_logfile, 0);
49$answer = "Some stuff\n$makefile:10: warning is maybe\nhi\n";
50&compare_output($answer,&get_logfile(1));
51
52# Test #4
53
54&run_make_with_options($makefile, "WARNING4=definitely", &get_logfile, 0);
55$answer = "Some stuff\n$makefile:15: warning is definitely\nhi\nthere\n";
56&compare_output($answer,&get_logfile(1));
57
58# Test linenumber offset
59
60run_make_test(q!
61all: one two
62 $(warning in $@ line 3)
63 @true
64 $(warning in $@ line 5)
65
66one two:
67 $(warning in $@ line 8)
68 @true
69 $(warning in $@ line 10)
70!,
71 '', "#MAKEFILE#:8: in one line 8
72#MAKEFILE#:10: in one line 10
73#MAKEFILE#:8: in two line 8
74#MAKEFILE#:10: in two line 10
75#MAKEFILE#:3: in all line 3
76#MAKEFILE#:5: in all line 5\n");
77
78# This tells the test driver that the perl test script executed properly.
791;
80
81### Local Variables:
82### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
83### End:
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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