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:14: warning is definitely\nhi\nthere\n";
56&compare_output($answer,&get_logfile(1));
57
58# This tells the test driver that the perl test script executed properly.
591;
60
61
62
63
64
65
66