2009-09-24 02:41:44 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
$description = "The following test creates a makefile to test command
|
|
|
|
echoing. It tests that when a command line starts with
|
|
|
|
a '\@', the echoing of that line is suppressed. It also
|
|
|
|
tests the -n option which tells make to ONLY echo the
|
|
|
|
commands and no execution happens. In this case, even
|
|
|
|
the commands with '\@' are printed. Lastly, it tests the
|
|
|
|
-s flag which tells make to prevent all echoing, as if
|
|
|
|
all commands started with a '\@'.";
|
|
|
|
|
|
|
|
$details = "This test is similar to the 'clean' test except that a '\@' has
|
|
|
|
been placed in front of the delete command line. Four tests
|
|
|
|
are run here. First, make is run normally and the first echo
|
|
|
|
command should be executed. In this case there is no '\@' so
|
|
|
|
we should expect make to display the command AND display the
|
|
|
|
echoed message. Secondly, make is run with the clean target,
|
|
|
|
but since there is a '\@' at the beginning of the command, we
|
|
|
|
expect no output; just the deletion of a file which we check
|
|
|
|
for. Third, we give the clean target again except this time
|
|
|
|
we give make the -n option. We now expect the command to be
|
|
|
|
displayed but not to be executed. In this case we need only
|
|
|
|
to check the output since an error message would be displayed
|
|
|
|
if it actually tried to run the delete command again and the
|
|
|
|
file didn't exist. Lastly, we run the first test again with
|
|
|
|
the -s option and check that make did not echo the echo
|
|
|
|
command before printing the message.\n";
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
$example = "EXAMPLE_FILE";
|
|
|
|
|
2009-09-24 02:41:44 +00:00
|
|
|
touch($example);
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
# TEST #1
|
|
|
|
# -------
|
|
|
|
|
2009-09-24 02:41:44 +00:00
|
|
|
run_make_test("
|
|
|
|
all:
|
|
|
|
\techo This makefile did not clean the dir... good
|
|
|
|
clean:
|
2016-12-23 18:33:58 +00:00
|
|
|
\t\@$CMD_rmfile $example\n",
|
2009-09-24 02:41:44 +00:00
|
|
|
'', 'echo This makefile did not clean the dir... good
|
|
|
|
This makefile did not clean the dir... good');
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
# TEST #2
|
|
|
|
# -------
|
|
|
|
|
2009-09-24 02:41:44 +00:00
|
|
|
run_make_test(undef, 'clean', '');
|
2004-05-16 19:16:52 +00:00
|
|
|
if (-f $example) {
|
|
|
|
$test_passed = 0;
|
2009-09-24 02:41:44 +00:00
|
|
|
unlink($example);
|
1999-09-14 02:03:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# TEST #3
|
|
|
|
# -------
|
|
|
|
|
2016-12-23 18:33:58 +00:00
|
|
|
run_make_test(undef, '-n clean', "$CMD_rmfile $example\n");
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
# TEST #4
|
|
|
|
# -------
|
|
|
|
|
2009-09-24 02:41:44 +00:00
|
|
|
run_make_test(undef, '-s', "This makefile did not clean the dir... good\n");
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
1;
|