2 The following test creates a makefile to test the warning function.";
6 open(MAKEFILE,"> $makefile");
8 print MAKEFILE <<'EOF';
10 $(warning warning is $(WARNING1))
14 $(warning warning is $(WARNING2))
18 all: some; @echo hi $(warning warning is $(WARNING3))
23 @echo there $(warning warning is $(WARNING4))
26 some: ; @echo Some stuff
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));
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));
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));
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));
56 # This tells the test driver that the perl test script executed properly.