Changeset 284 in kBuild for branches/GNU/src/gmake/tests/scripts/options
- Timestamp:
- May 16, 2005 4:54:08 PM (19 years ago)
- Location:
- branches/GNU/src/gmake/tests/scripts/options
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gmake/tests/scripts/options/dash-B
r53 r284 9 9 is built again."; 10 10 11 open(MAKEFILE,"> $makefile");11 &touch('bar.x'); 12 12 13 print MAKEFILE <<'EOF'; 13 run_make_test(' 14 14 .SUFFIXES: 15 15 … … 20 20 @echo cp $< $@ 21 21 @echo "" > $@ 22 EOF 22 ', 23 '', 'cp bar.x foo'); 23 24 24 close(MAKEFILE); 25 run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'."); 26 run_make_test(undef, '-B', 'cp bar.x foo'); 27 28 # Put the timestamp for foo into the future; it should still be remade. 29 30 utouch(1000, 'foo'); 31 run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'."); 32 run_make_test(undef, '-B', 'cp bar.x foo'); 25 33 26 34 27 &touch('bar.x'); 35 # Clean up 28 36 29 &run_make_with_options($makefile, '', &get_logfile); 30 $answer = "cp bar.x foo\n"; 31 &compare_output($answer, &get_logfile(1)); 32 33 &run_make_with_options($makefile, '', &get_logfile); 34 $answer = "$make_name: Nothing to be done for `all'.\n"; 35 &compare_output($answer, &get_logfile(1)); 36 37 &run_make_with_options($makefile, '-B', &get_logfile); 38 $answer = "cp bar.x foo\n"; 39 &compare_output($answer, &get_logfile(1)); 40 41 unlink('bar.x', 'foo') unless $keep; 37 rmfiles('bar.x', 'foo'); 42 38 43 39 1; -
branches/GNU/src/gmake/tests/scripts/options/dash-C
r53 r284 1 $description = "The following test creates a makefile to test the -C dir \n" 2 ."option in make. This option tells make to change to \n" 3 ."directory dir before reading the makefile."; 1 # -*-perl-*- 4 2 5 $details = "This test is similar to the clean test except that this test\n" 6 ."creates the file to delete in the work directory instead of\n" 7 ."the current directory. Make is called from another directory\n" 8 ."using the -C workdir option so that it can both find the \n" 9 ."makefile and the file to delete in the work directory. "; 3 $description = "Test the -C option to GNU make."; 10 4 11 $example = $workdir . $pathsep . "EXAMPLE_FILE"; 5 $details = "\ 6 This test is similar to the clean test except that this test creates the file 7 to delete in the work directory instead of the current directory. Make is 8 called from another directory using the -C workdir option so that it can both 9 find the makefile and the file to delete in the work directory."; 10 11 $example = $workdir . $pathsep . "EXAMPLE"; 12 12 13 13 open(MAKEFILE,"> $makefile"); 14 15 # The Contents of the MAKEFILE ... 16 17 print MAKEFILE "all: \n"; 18 print MAKEFILE "\t\@echo This makefile did not clean the dir ... good\n"; 19 print MAKEFILE "clean: \n"; 20 print MAKEFILE "\t$delete_command EXAMPLE_FILE\n"; 21 22 # END of Contents of MAKEFILE 23 14 print MAKEFILE <<EOF; 15 all: ; \@echo This makefile did not clean the dir ... good 16 clean: ; $delete_command EXAMPLE\$(ext) 17 EOF 24 18 close(MAKEFILE); 25 19 20 # TEST #1 21 # ------- 26 22 &touch($example); 27 23 … … 34 30 chdir $pwd; 35 31 32 if (-f $example) { 33 $test_passed = 0; 34 } 35 36 36 # Create the answer to what should be produced by this Makefile 37 37 $answer = "$make_name: Entering directory `$wpath'\n" 38 . "$delete_command EXAMPLE _FILE\n"38 . "$delete_command EXAMPLE\n" 39 39 . "$make_name: Leaving directory `$wpath'\n"; 40 40 41 41 &compare_output($answer,&get_logfile(1)); 42 42 43 if (-f $example) 44 { 45 $test_passed = 0; 43 44 # TEST #2 45 # ------- 46 # Do it again with trailing "/"; this should work the same 47 48 $example .= "slash"; 49 50 &touch($example); 51 52 &run_make_with_options("${testname}.mk", 53 "-C $workdir/ clean ext=slash", 54 &get_logfile); 55 56 chdir $workdir; 57 $wpath = &get_this_pwd; 58 chdir $pwd; 59 60 if (-f $example) { 61 $test_passed = 0; 46 62 } 47 63 64 # Create the answer to what should be produced by this Makefile 65 $answer = "$make_name: Entering directory `$wpath'\n" 66 . "$delete_command EXAMPLEslash\n" 67 . "$make_name: Leaving directory `$wpath'\n"; 68 69 &compare_output($answer,&get_logfile(1)); 70 48 71 1; -
branches/GNU/src/gmake/tests/scripts/options/dash-k
r53 r284 98 98 &compare_output($answer, &get_logfile(1)); 99 99 100 # TEST -- make sure we keep the error code if we can't create an included 101 # makefile. 102 103 run_make_test('all: ; @echo hi 104 include ifile 105 ifile: no-such-file; @false 106 ', 107 '-k', 108 "#MAKEFILE#:2: ifile: No such file or directory 109 #MAKE#: *** No rule to make target `no-such-file', needed by `ifile'. 110 #MAKE#: Failed to remake makefile `ifile'. 111 hi\n", 112 512); 113 100 114 1; -
branches/GNU/src/gmake/tests/scripts/options/dash-q
r53 r284 4 4 $details = "Try various uses of -q and ensure they all give the correct results.\n"; 5 5 6 open(MAKEFILE, "> $makefile"); 6 # TEST 0 7 7 8 # The Contents of the MAKEFILE ... 9 10 print MAKEFILE <<'EOMAKE'; 8 run_make_test(' 11 9 one: 12 10 two: ; … … 22 20 : foo 23 21 $(.XY) 24 EOMAKE 25 26 close(MAKEFILE); 27 28 # TEST 0 29 30 &run_make_with_options($makefile, "-q one", &get_logfile); 31 $answer = ""; 32 &compare_output($answer, &get_logfile(1)); 22 ', 23 '-q one', ''); 33 24 34 25 # TEST 1 35 26 36 &run_make_with_options($makefile, "-q two", &get_logfile); 37 $answer = ""; 38 &compare_output($answer, &get_logfile(1)); 27 run_make_test(undef, '-q two', ''); 39 28 40 29 # TEST 2 41 30 42 &run_make_with_options($makefile, "-q three", &get_logfile, 256); 43 $answer = ""; 44 &compare_output($answer, &get_logfile(1)); 31 run_make_test(undef, '-q three', '', 256); 45 32 46 33 # TEST 3 47 34 48 &run_make_with_options($makefile, "-q four", &get_logfile); 49 $answer = ""; 50 &compare_output($answer, &get_logfile(1)); 35 run_make_test(undef, '-q four', ''); 51 36 52 37 # TEST 4 53 38 54 &run_make_with_options($makefile, "-q five", &get_logfile); 55 $answer = ""; 56 &compare_output($answer, &get_logfile(1)); 39 run_make_test(undef, '-q five', ''); 57 40 58 41 # TEST 5 59 42 60 &run_make_with_options($makefile, "-q six", &get_logfile); 61 $answer = ""; 62 &compare_output($answer, &get_logfile(1)); 43 run_make_test(undef, '-q six', ''); 63 44 64 45 # TEST 6 65 46 66 &run_make_with_options($makefile, "-q seven", &get_logfile, 256); 67 $answer = ""; 68 &compare_output($answer, &get_logfile(1)); 47 run_make_test(undef, '-q seven', '', 256); 48 49 # TEST 7 : Savannah bug # 7144 50 51 run_make_test(' 52 one:: ; @echo one 53 one:: ; @echo two 54 ', 55 '-q', '', 256); 69 56 70 57 1;
Note:
See TracChangeset
for help on using the changeset viewer.

