4 The following test creates a makefile to test the error function.";
8 open(MAKEFILE,"> $makefile");
10 print MAKEFILE 'err = $(error Error found!)
13 $(error error is $(ERROR1))
17 $(error error is $(ERROR2))
21 all: some; @echo $(error error is $(ERROR3))
25 all: some; @echo error is $(ERROR4)
26 @echo $(error error is $(ERROR4))
29 some: ; @echo Some stuff
38 &run_make_with_options($makefile, "ERROR1=yes", &get_logfile, 512);
39 $answer = "$makefile:4: *** error is yes. Stop.\n";
40 &compare_output($answer,&get_logfile(1));
44 &run_make_with_options($makefile, "ERROR2=no", &get_logfile, 512);
45 $answer = "$makefile:8: *** error is no. Stop.\n";
46 &compare_output($answer,&get_logfile(1));
50 &run_make_with_options($makefile, "ERROR3=maybe", &get_logfile, 512);
51 $answer = "Some stuff\n$makefile:12: *** error is maybe. Stop.\n";
52 &compare_output($answer,&get_logfile(1));
56 &run_make_with_options($makefile, "ERROR4=definitely", &get_logfile, 512);
57 $answer = "Some stuff\n$makefile:16: *** error is definitely. Stop.\n";
58 &compare_output($answer,&get_logfile(1));
62 &run_make_with_options($makefile, "testvar", &get_logfile, 512);
63 $answer = "$makefile:22: *** Error found!. Stop.\n";
64 &compare_output($answer,&get_logfile(1));
66 # This tells the test driver that the perl test script executed properly.