1 $description = "The following test creates a makefile to test command \n"
2 ."echoing. It tests that when a command line starts with \n"
3 ."a '\@', the echoing of that line is suppressed. It also \n"
4 ."tests the -n option which tells make to ONLY echo the \n"
5 ."commands and no execution happens. In this case, even \n"
6 ."the commands with '\@' are printed. Lastly, it tests the \n"
7 ."-s flag which tells make to prevent all echoing, as if \n"
8 ."all commands started with a '\@'.";
10 $details = "This test is similar to the 'clean' test except that a '\@' has\n"
11 ."been placed in front of the delete command line. Four tests \n"
12 ."are run here. First, make is run normally and the first echo\n"
13 ."command should be executed. In this case there is no '\@' so \n"
14 ."we should expect make to display the command AND display the \n"
15 ."echoed message. Secondly, make is run with the clean target, \n"
16 ."but since there is a '\@' at the beginning of the command, we\n"
17 ."expect no output; just the deletion of a file which we check \n"
18 ."for. Third, we give the clean target again except this time\n"
19 ."we give make the -n option. We now expect the command to be \n"
20 ."displayed but not to be executed. In this case we need only \n"
21 ."to check the output since an error message would be displayed\n"
22 ."if it actually tried to run the delete command again and the \n"
23 ."file didn't exist. Lastly, we run the first test again with \n"
24 ."the -s option and check that make did not echo the echo \n"
25 ."command before printing the message.";
27 $example = "EXAMPLE_FILE";
29 open(MAKEFILE,"> $makefile");
31 # The Contents of the MAKEFILE ...
33 print MAKEFILE "all: \n";
34 print MAKEFILE "\techo This makefile did not clean the dir... good\n";
35 print MAKEFILE "clean: \n";
36 print MAKEFILE "\t\@$delete_command $example\n";
38 # END of Contents of MAKEFILE
47 &run_make_with_options($makefile,"",&get_logfile,0);
48 $answer = "echo This makefile did not clean the dir... good\n"
49 ."This makefile did not clean the dir... good\n";
50 &compare_output($answer,&get_logfile(1));
56 &run_make_with_options($makefile,"clean",&get_logfile,0);
58 &compare_output($answer,&get_logfile(1));
68 &run_make_with_options($makefile,"-n clean",&get_logfile,0);
69 $answer = "$delete_command $example\n";
70 &compare_output($answer,&get_logfile(1));
76 &run_make_with_options($makefile,"-s",&get_logfile,0);
77 $answer = "This makefile did not clean the dir... good\n";
78 &compare_output($answer,&get_logfile(1));