Changeset 2596 in kBuild for vendor/gnumake/current/tests/scripts/features/echoing
- Timestamp:
- Jun 19, 2012 10:44:52 PM (12 years ago)
- Location:
- vendor/gnumake/current
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
tests (modified) (1 prop)
-
tests/scripts/features/echoing (modified) (2 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current
- Property svn:ignore deleted
-
vendor/gnumake/current/tests
- Property svn:ignore deleted
-
vendor/gnumake/current/tests/scripts/features/echoing
-
Property svn:eol-style
changed from
nativetoLF
r280 r2596 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 '\@'."; 1 # -*-perl-*- 2 $description = "The following test creates a makefile to test command 3 echoing. It tests that when a command line starts with 4 a '\@', the echoing of that line is suppressed. It also 5 tests the -n option which tells make to ONLY echo the 6 commands and no execution happens. In this case, even 7 the commands with '\@' are printed. Lastly, it tests the 8 -s flag which tells make to prevent all echoing, as if 9 all commands started with a '\@'."; 9 10 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.";11 $details = "This test is similar to the 'clean' test except that a '\@' has 12 been placed in front of the delete command line. Four tests 13 are run here. First, make is run normally and the first echo 14 command should be executed. In this case there is no '\@' so 15 we should expect make to display the command AND display the 16 echoed message. Secondly, make is run with the clean target, 17 but since there is a '\@' at the beginning of the command, we 18 expect no output; just the deletion of a file which we check 19 for. Third, we give the clean target again except this time 20 we give make the -n option. We now expect the command to be 21 displayed but not to be executed. In this case we need only 22 to check the output since an error message would be displayed 23 if it actually tried to run the delete command again and the 24 file didn't exist. Lastly, we run the first test again with 25 the -s option and check that make did not echo the echo 26 command before printing the message.\n"; 26 27 27 28 $example = "EXAMPLE_FILE"; 28 29 29 open(MAKEFILE,"> $makefile"); 30 31 # The Contents of the MAKEFILE ... 32 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"; 37 38 # END of Contents of MAKEFILE 39 40 close(MAKEFILE); 41 42 &touch($example); 30 touch($example); 43 31 44 32 # TEST #1 45 33 # ------- 46 34 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)); 51 35 run_make_test(" 36 all: 37 \techo This makefile did not clean the dir... good 38 clean: 39 \t\@$delete_command $example\n", 40 '', 'echo This makefile did not clean the dir... good 41 This makefile did not clean the dir... good'); 52 42 53 43 # TEST #2 54 44 # ------- 55 45 56 &run_make_with_options($makefile,"clean",&get_logfile,0);46 run_make_test(undef, 'clean', ''); 57 47 if (-f $example) { 58 48 $test_passed = 0; 49 unlink($example); 59 50 } 60 &compare_output('',&get_logfile(1));61 51 62 52 # TEST #3 63 53 # ------- 64 54 65 &run_make_with_options($makefile,"-n clean",&get_logfile,0); 66 $answer = "$delete_command $example\n"; 67 &compare_output($answer,&get_logfile(1)); 55 run_make_test(undef, '-n clean', "$delete_command $example\n"); 68 56 69 57 … … 71 59 # ------- 72 60 73 &run_make_with_options($makefile,"-s",&get_logfile,0); 74 $answer = "This makefile did not clean the dir... good\n"; 75 &compare_output($answer,&get_logfile(1)); 61 run_make_test(undef, '-s', "This makefile did not clean the dir... good\n"); 76 62 77 63 78 64 1; 79 80 81 82 83 84 85 86 87 -
Property svn:eol-style
changed from
Note:
See TracChangeset
for help on using the changeset viewer.

