Changeset 501 in kBuild for vendor/gnumake/current/tests/scripts/features/reinvoke
- Timestamp:
- Sep 15, 2006 2:30:32 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/tests/scripts/features/reinvoke
r53 r501 8 8 file, then touch the temp file to make it newer than the makefile."; 9 9 10 $makefile2 = &get_tmpfile; 11 $makefile_orig = &get_tmpfile; 10 $omkfile = $makefile; 12 11 13 open(MAKEFILE,"> $makefile"); 12 &utouch(-600, 'incl.mk'); 13 # For some reason if we don't do this then the test fails for systems 14 # with sub-second timestamps, maybe + NFS? Not sure. 15 &utouch(-1, 'incl-1.mk'); 14 16 15 print MAKEFILE <<EOM; 17 run_make_test(' 18 all: ; @echo running rules. 16 19 17 all: ; \@echo 'running rules.' 20 #MAKEFILE# incl.mk: incl-1.mk 21 @echo rebuilding $@ 22 @echo >> $@ 18 23 19 $makefile $makefile2: $makefile_orig 20 \@echo 'rebuilding \$\@.' 21 \@echo >> \$\@ 24 include incl.mk', 25 '', "rebuilding incl.mk\nrunning rules.\n"); 22 26 23 include $makefile2 27 # Make sure updating the makefile itself also works 24 28 25 EOM 29 &utouch(-600, $omkfile); 26 30 27 close(MAKEFILE);31 run_make_test(undef, '', "rebuilding #MAKEFILE#\nrunning rules.\n"); 28 32 29 &utouch(-10, $makefile, $makefile2); 30 &touch($makefile_orig); 33 &rmfiles('incl.mk', 'incl-1.mk'); 31 34 32 &run_make_with_options($makefile, "", &get_logfile, 0);33 34 # Create the answer to what should be produced by this Makefile35 36 $answer = "rebuilding $makefile2.\nrebuilding $makefile.\nrunning rules.\n";37 38 &compare_output($answer,&get_logfile(1))39 && unlink "$makefile_orig";40 35 41 36 # In this test we create an included file that's out-of-date, but then 42 37 # the rule doesn't update it. Make shouldn't re-exec. 43 38 44 $makefile3 = &get_tmpfile; 39 &utouch(-600, 'b','a'); 40 #&utouch(-10, 'a'); 41 &touch('c'); 45 42 46 open(MAKEFILE, "> $makefile3"); 47 print MAKEFILE <<'EOM'; 43 run_make_test(' 48 44 SHELL = /bin/sh 49 45 … … 56 52 c: ; echo >> $@ 57 53 58 include $(F) 59 EOM 60 61 close(MAKEFILE); 62 63 &utouch(-20, 'b','a'); 64 #&utouch(-10, 'a'); 65 &touch('c'); 66 67 # First try with the file that's not updated "once removed" from the 68 # file we're including. 69 70 &run_make_with_options($makefile3, "F=a", &get_logfile, 0); 71 72 $answer = "[ -f b ] || echo >> b\nhello\n"; 73 &compare_output($answer,&get_logfile(1)); 54 include $(F)', 55 'F=a', "[ -f b ] || echo >> b\nhello\n"); 74 56 75 57 # Now try with the file we're not updating being the actual file we're 76 58 # including: this and the previous one test different parts of the code. 77 59 78 &run_make_with_options($makefile3, "F=b", &get_logfile, 0); 60 run_make_test(undef, "F=b", "[ -f b ] || echo >> b\nhello\n") 79 61 80 $answer = "[ -f b ] || echo >> b\nhello\n"; 81 &compare_output($answer,&get_logfile(1)); 82 83 unlink('a','b','c'); 62 &rmfiles('a','b','c'); 84 63 85 64 # This tells the test driver that the perl test script executed properly.
Note:
See TracChangeset
for help on using the changeset viewer.

