Changeset 3140 for trunk/src/kmk/tests/scripts/options
- Timestamp:
- Mar 14, 2018, 10:28:10 PM (7 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 11 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk
-
Property svn:mergeinfo
set to
/vendor/gnumake/current merged eligible
-
Property svn:mergeinfo
set to
-
trunk/src/kmk/tests/scripts/options/dash-B
r2591 r3140 23 23 '', 'cp bar.x foo'); 24 24 25 run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");25 run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'."); 26 26 run_make_test(undef, '-B', 'cp bar.x foo'); 27 27 … … 29 29 30 30 utouch(1000, 'foo'); 31 run_make_test(undef, '', "#MAKE#: Nothing to be done for `all'.");31 run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'."); 32 32 run_make_test(undef, '-B', 'cp bar.x foo'); 33 33 … … 46 46 ', 47 47 '-B', 'MAKE_RESTARTS= 48 #MAKEFILE#:4: foo.x: No such file or directory49 48 MAKE_RESTARTS=1'); 50 49 … … 64 63 ', 65 64 '-B', 'MAKE_RESTARTS= 66 #MAKEFILE#:4: foo.x: No such file or directory67 65 MAKE_RESTARTS=1 68 66 blah.x … … 84 82 85 83 1; 84 85 ### Local Variables: 86 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 87 ### End: -
trunk/src/kmk/tests/scripts/options/dash-C
r969 r3140 35 35 36 36 # Create the answer to what should be produced by this Makefile 37 $answer = "$make_name: Entering directory `$wpath'\n"37 $answer = "$make_name: Entering directory '$wpath'\n" 38 38 . "$delete_command EXAMPLE\n" 39 . "$make_name: Leaving directory `$wpath'\n";39 . "$make_name: Leaving directory '$wpath'\n"; 40 40 41 41 &compare_output($answer,&get_logfile(1)); … … 63 63 64 64 # Create the answer to what should be produced by this Makefile 65 $answer = "$make_name: Entering directory `$wpath'\n"65 $answer = "$make_name: Entering directory '$wpath'\n" 66 66 . "$delete_command EXAMPLEslash\n" 67 . "$make_name: Leaving directory `$wpath'\n";67 . "$make_name: Leaving directory '$wpath'\n"; 68 68 69 69 &compare_output($answer,&get_logfile(1)); -
trunk/src/kmk/tests/scripts/options/dash-I
r969 r3140 52 52 53 53 $answer = "$mkpath ANOTHER -f $makefile 54 ${make_name}[1]: Entering directory `$pwd'54 ${make_name}[1]: Entering directory '$pwd' 55 55 This is another included makefile 56 ${make_name}[1]: Leaving directory `$pwd'\n";56 ${make_name}[1]: Leaving directory '$pwd'\n"; 57 57 58 58 &run_make_with_options($makefile,"-I $workdir recurse",&get_logfile); -
trunk/src/kmk/tests/scripts/options/dash-W
r969 r3140 13 13 # Run it again: nothing should happen 14 14 15 run_make_test(undef, '', "#MAKE#: `a.x' is up to date.");15 run_make_test(undef, '', "#MAKE#: 'a.x' is up to date."); 16 16 17 17 # Now run it with -W b.x: should rebuild a.x … … 22 22 23 23 utouch(1000, 'a.x'); 24 run_make_test(undef, '', "#MAKE#: `a.x' is up to date.");24 run_make_test(undef, '', "#MAKE#: 'a.x' is up to date."); 25 25 run_make_test(undef, '-W b.x', 'echo >> a.x'); 26 26 … … 43 43 baz.x: bar.x ; @echo "touch $@" 44 44 ', 45 '', '#MAKEFILE#:3: foo.x: No such file or directory 46 echo >> bar.x 45 '', 'echo >> bar.x 47 46 touch foo.x 48 47 restarts=1 … … 87 86 88 87 1; 88 89 ### Local Variables: 90 ### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) 91 ### End: -
trunk/src/kmk/tests/scripts/options/dash-k
r1964 r3140 43 43 "$workdir${pathsep}commands.c","$workdir${pathsep}display.c", 44 44 "$workdir${pathsep}buffer.h", 45 45 "$workdir${pathsep}command.c"); 46 46 47 47 &touch(@files_to_touch); … … 58 58 # Create the answer to what should be produced by this Makefile 59 59 $answer = "cc -c main.c 60 $make_name: *** No rule to make target `kbd.c', needed by `kbd.o'.60 $make_name: *** No rule to make target 'kbd.c', needed by 'kbd.o'. 61 61 cc -c commands.c 62 62 cc -c display.c 63 $make_name: Target `edit' not remade because of errors.\n";63 $make_name: Target 'edit' not remade because of errors.\n"; 64 64 65 65 # COMPARE RESULTS … … 93 93 94 94 $answer = "exit 1 95 $make_name: *** [ foo.o] Error 196 $make_name: Target `all' not remade because of errors.\n";95 $make_name: *** [$makefile2:9: foo.o] Error 1 96 $make_name: Target 'all' not remade because of errors.\n"; 97 97 98 98 &compare_output($answer, &get_logfile(1)); … … 107 107 '-k', 108 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'.109 #MAKE#: *** No rule to make target 'no-such-file', needed by 'ifile'. 110 #MAKE#: Failed to remake makefile 'ifile'. 111 111 hi\n", 112 112 512); -
trunk/src/kmk/tests/scripts/options/dash-n
r969 r3140 4 4 $details = "Try various uses of -n and ensure they all give the correct results.\n"; 5 5 6 open(MAKEFILE, "> $makefile");6 touch('orig'); 7 7 8 # The Contents of the MAKEFILE ... 9 10 print MAKEFILE <<'EOMAKE'; 11 8 run_make_test(q! 12 9 final: intermediate ; echo >> $@ 13 10 intermediate: orig ; echo >> $@ 14 15 EOMAKE 16 17 close(MAKEFILE); 18 19 &touch('orig'); 20 21 # TEST 0 22 23 &run_make_with_options($makefile, "", &get_logfile); 24 $answer = "echo >> intermediate\necho >> final\n"; 25 &compare_output($answer, &get_logfile(1)); 11 !, 12 '', "echo >> intermediate\necho >> final\n"); 26 13 27 14 # TEST 1 28 15 29 &run_make_with_options($makefile, "-Worig -n", &get_logfile); 30 $answer = "echo >> intermediate\necho >> final\n"; 31 &compare_output($answer, &get_logfile(1)); 16 run_make_test(undef, '-Worig -n', "echo >> intermediate\necho >> final\n"); 32 17 33 unlink('orig', 'intermediate', 'final');18 rmfiles(qw(orig intermediate final)); 34 19 35 20 # We consider the actual updated timestamp of targets with all 36 # recursive commands, even with -n. 21 # recursive commands, even with -n. Switching this to the new model 22 # is non-trivial because we use a trick below to change the log content 23 # before we compare it ... 37 24 38 25 $makefile2 = &get_tmpfile; … … 57 44 58 45 &run_make_with_options($makefile2, "", &get_logfile); 59 $answer = "$make_name: `a' is up to date.\n";46 $answer = "$make_name: 'a' is up to date.\n"; 60 47 &compare_output($answer, &get_logfile(1)); 61 48 … … 63 50 64 51 &run_make_with_options($makefile2, "-n", &get_logfile); 65 $answer = "$make_name: `a' is up to date.\n";52 $answer = "$make_name: 'a' is up to date.\n"; 66 53 &compare_output($answer, &get_logfile(1)); 67 54 68 unlink('a', 'b', 'c'); 55 # TEST 4 56 57 unlink(qw(a b)); 58 59 &run_make_with_options($makefile2, "-t -n", &get_logfile); 60 61 open(DASH_N_LOG, ">>" . &get_logfile(1)); 62 print DASH_N_LOG "a exists but should not!\n" if -e 'a'; 63 print DASH_N_LOG "b exists but should not!\n" if -e 'b'; 64 close(DASH_N_LOG); 65 66 &compare_output("touch b\ntouch a\n", &get_logfile(1)); 67 68 # CLEANUP 69 70 unlink(qw(a b c)); 71 72 # Ensure -n continues to be included with recursive/re-execed make 73 # See Savannah bug #38051 74 75 $topmake = &get_tmpfile; 76 $submake = &get_tmpfile; 77 78 open(MAKEFILE, "> $topmake"); 79 print MAKEFILE <<"EOF"; 80 foo: ; \@\$(MAKE) -f "$submake" bar 81 EOF 82 close(MAKEFILE); 83 84 85 # The bar target should print what would happen, but not actually run 86 open(MAKEFILE, "> $submake"); 87 print MAKEFILE <<'EOF'; 88 inc: ; touch $@ 89 -include inc 90 bar: ; @echo $(strip $(MAKEFLAGS)) 91 EOF 92 close(MAKEFILE); 93 94 &run_make_with_options($topmake, '-n --no-print-directory', &get_logfile); 95 $answer = "$make_command -f \"$submake\" bar\ntouch inc\necho n --no-print-directory\n"; 96 &compare_output($answer, &get_logfile(1)); 97 98 unlink('inc'); 69 99 70 100 1; -
trunk/src/kmk/tests/scripts/options/dash-q
r969 r3140 6 6 # TEST 0 7 7 8 run_make_test( '8 run_make_test(qq! 9 9 one: 10 10 two: ; 11 11 three: ; : 12 four: ; $(.XY)13 five: ; \ 14 $(.XY)15 six: ; \ 16 $(.XY)17 18 seven: ; \ 19 $(.XY)20 21 22 ',12 four: ; \$(.XY) 13 five: ; \\ 14 \$(.XY) 15 six: ; \\ 16 \$(.XY) 17 \t\$(.XY) 18 seven: ; \\ 19 \$(.XY) 20 \t: foo 21 \t\$(.XY) 22 !, 23 23 '-q one', ''); 24 24 … … 55 55 '-q', '', 256); 56 56 57 # TEST 7 : Savannah bug # 42249 58 # Make sure we exit with 1 even for prerequisite updates 59 run_make_test(' 60 build-stamp: ; echo $@ 61 build-arch: build-stamp 62 build-x: build-arch 63 build-y: build-x 64 ', 65 '-q build-y', '', 256); 66 67 # TEST 8 68 # Make sure we exit with 2 on error even with -q 69 run_make_test(' 70 build-stamp: ; echo $@ 71 build-arch: build-stamp-2 72 build-x: build-arch 73 build-y: build-x 74 ', 75 '-q build-y', "#MAKE#: *** No rule to make target 'build-stamp-2', needed by 'build-arch'. Stop.\n", 512); 76 77 # TEST 9 : Savannah bug # 47151 78 # Make sure we exit with 1 when invoking a recursive make 79 run_make_test(' 80 foo: bar ; echo foo 81 bar: ; @$(MAKE) -f #MAKEFILE# baz 82 baz: ; echo baz 83 ', 84 '-q foo', '', 256); 85 57 86 1; -
trunk/src/kmk/tests/scripts/options/eval
r2591 r3140 17 17 "eval\neval\nall\nrecurse"); 18 18 19 # Make sure that --eval is handled correctly during restarting 20 run_make_test(q! 21 all: ; @echo $@ 22 -include gen.mk 23 gen.mk: ; @echo > $@ 24 !, 25 '--eval=\$\(info\ eval\)', "eval\neval\nall"); 26 27 unlink('gen.mk'); 28 19 29 1; -
trunk/src/kmk/tests/scripts/options/symlinks
r2591 r3140 27 27 # With -L, it should update targ 28 28 run_make_test('targ: sym ; @echo make $@ from $<', '', 29 "#MAKE#: `targ' is up to date.");29 "#MAKE#: 'targ' is up to date."); 30 30 run_make_test(undef, '-L', "make targ from sym"); 31 31 … … 37 37 # Now update targ; in all cases targ should be up to date. 38 38 &touch('targ'); 39 run_make_test(undef, '', "#MAKE#: `targ' is up to date.");40 run_make_test(undef, '-L', "#MAKE#: `targ' is up to date.");39 run_make_test(undef, '', "#MAKE#: 'targ' is up to date."); 40 run_make_test(undef, '-L', "#MAKE#: 'targ' is up to date."); 41 41 42 42 # Add in a new link between sym and dep. Be sure it's newer than targ. … … 47 47 # Without -L, nothing should happen 48 48 # With -L, it should update targ 49 run_make_test(undef, '', "#MAKE#: `targ' is up to date.");49 run_make_test(undef, '', "#MAKE#: 'targ' is up to date."); 50 50 run_make_test(undef, '-L', "make targ from sym"); 51 51 … … 57 57 symlink("../$dirname/dep", 'sym'); 58 58 run_make_test('targ: sym ; @echo make $@ from $<', '', 59 "#MAKE#: *** No rule to make target `sym', needed by `targ'. Stop.", 512);59 "#MAKE#: *** No rule to make target 'sym', needed by 'targ'. Stop.", 512); 60 60 61 61 run_make_test('targ: sym ; @echo make $@ from $<', '-L', -
trunk/src/kmk/tests/scripts/options/warn-undefined-variables
r969 r3140 19 19 # With --warn-undefined-variables, it should warn me 20 20 run_make_test(undef, '--warn-undefined-variables', 21 "#MAKEFILE#:7: warning: undefined variable `UNDEFINED'22 #MAKEFILE#:9: warning: undefined variable `UNDEFINED'21 "#MAKEFILE#:7: warning: undefined variable 'UNDEFINED' 22 #MAKEFILE#:9: warning: undefined variable 'UNDEFINED' 23 23 ref"); 24 24
Note:
See TracChangeset
for help on using the changeset viewer.