Debian Codegraph @

tests/scripts/targets/clean

raw
1 # -*-perl-*-
2
3 $description = "The following test creates a makefile to delete a \n"
4 ."file in the directory. It tests to see if make will \n"
5 ."NOT execute the command unless the rule is given in \n"
6 ."the make command line.";
7
8 $example = "EXAMPLE_FILE";
9
10 open(MAKEFILE,"> $makefile");
11 print MAKEFILE qq!
12 all: ; \@echo This makefile did not clean the dir... good
13 clean: ; $CMD_rmfile $example
14 !;
15 close(MAKEFILE);
16
17 touch($example);
18 run_make_with_options($makefile,"",&get_logfile,0);
19
20 $answer = "This makefile did not clean the dir... good\n";
21 compare_output($answer,&get_logfile(1)) || error("abort");
22
23
24 $answer = "$CMD_rmfile $example\n";
25 run_make_with_options($makefile,"clean",&get_logfile,0);
26 if (-f $example) {
27 $test_passed = 0;
28 }
29 compare_output($answer,&get_logfile(1)) || error("abort");
30
31 1;