2 The following test creates a makefile to test the error function.";
6 open(MAKEFILE,"> $makefile");
8 print MAKEFILE <<'EOF';
10 $(error error is $(ERROR1))
14 $(error error is $(ERROR2))
18 all: some; @echo $(error error is $(ERROR3))
22 all: some; @echo error is $(ERROR4)
23 @echo $(error error is $(ERROR4))
26 some: ; @echo Some stuff
34 &run_make_with_options($makefile, "ERROR1=yes", &get_logfile, 512);
35 $answer = "$makefile:2: *** error is yes. Stop.\n";
36 &compare_output($answer,&get_logfile(1));
40 &run_make_with_options($makefile, "ERROR2=no", &get_logfile, 512);
41 $answer = "$makefile:6: *** error is no. Stop.\n";
42 &compare_output($answer,&get_logfile(1));
46 &run_make_with_options($makefile, "ERROR3=maybe", &get_logfile, 512);
47 $answer = "Some stuff\n$makefile:10: *** error is maybe. Stop.\n";
48 &compare_output($answer,&get_logfile(1));
52 &run_make_with_options($makefile, "ERROR4=definitely", &get_logfile, 512);
53 $answer = "Some stuff\n$makefile:14: *** error is definitely. Stop.\n";
54 &compare_output($answer,&get_logfile(1));
56 # This tells the test driver that the perl test script executed properly.