VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/features/echoing

Last change on this file was 2591, checked in by bird, 13 years ago

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

  • Property svn:eol-style set to LF
File size: 2.0 KB
Line 
1# -*-perl-*-
2$description = "The following test creates a makefile to test command
3echoing. It tests that when a command line starts with
4a '\@', the echoing of that line is suppressed. It also
5tests the -n option which tells make to ONLY echo the
6commands and no execution happens. In this case, even
7the commands with '\@' are printed. Lastly, it tests the
8-s flag which tells make to prevent all echoing, as if
9all commands started with a '\@'.";
10
11$details = "This test is similar to the 'clean' test except that a '\@' has
12been placed in front of the delete command line. Four tests
13are run here. First, make is run normally and the first echo
14command should be executed. In this case there is no '\@' so
15we should expect make to display the command AND display the
16echoed message. Secondly, make is run with the clean target,
17but since there is a '\@' at the beginning of the command, we
18expect no output; just the deletion of a file which we check
19for. Third, we give the clean target again except this time
20we give make the -n option. We now expect the command to be
21displayed but not to be executed. In this case we need only
22to check the output since an error message would be displayed
23if it actually tried to run the delete command again and the
24file didn't exist. Lastly, we run the first test again with
25the -s option and check that make did not echo the echo
26command before printing the message.\n";
27
28$example = "EXAMPLE_FILE";
29
30touch($example);
31
32# TEST #1
33# -------
34
35run_make_test("
36all:
37\techo This makefile did not clean the dir... good
38clean:
39\t\@$delete_command $example\n",
40 '', 'echo This makefile did not clean the dir... good
41This makefile did not clean the dir... good');
42
43# TEST #2
44# -------
45
46run_make_test(undef, 'clean', '');
47if (-f $example) {
48 $test_passed = 0;
49 unlink($example);
50}
51
52# TEST #3
53# -------
54
55run_make_test(undef, '-n clean', "$delete_command $example\n");
56
57
58# TEST #4
59# -------
60
61run_make_test(undef, '-s', "This makefile did not clean the dir... good\n");
62
63
641;
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette