diff options
Diffstat (limited to 'make/make-3.81/tests/scripts/targets')
-rw-r--r-- | make/make-3.81/tests/scripts/targets/DEFAULT | 53 | ||||
-rw-r--r-- | make/make-3.81/tests/scripts/targets/FORCE | 40 | ||||
-rw-r--r-- | make/make-3.81/tests/scripts/targets/INTERMEDIATE | 108 | ||||
-rw-r--r-- | make/make-3.81/tests/scripts/targets/PHONY | 54 | ||||
-rw-r--r-- | make/make-3.81/tests/scripts/targets/SECONDARY | 125 | ||||
-rw-r--r-- | make/make-3.81/tests/scripts/targets/SILENT | 42 | ||||
-rw-r--r-- | make/make-3.81/tests/scripts/targets/clean | 50 |
7 files changed, 0 insertions, 472 deletions
diff --git a/make/make-3.81/tests/scripts/targets/DEFAULT b/make/make-3.81/tests/scripts/targets/DEFAULT deleted file mode 100644 index 0cabde9..0000000 --- a/make/make-3.81/tests/scripts/targets/DEFAULT +++ /dev/null @@ -1,53 +0,0 @@ -$description = "The following test creates a makefile to override part\n" - ."of one Makefile with Another Makefile with the .DEFAULT\n" - ."rule."; - -$details = "This tests the use of the .DEFAULT special target to say that \n" - ."to remake any target that cannot be made fram the information\n" - ."in the containing makefile, make should look in another makefile\n" - ."This test gives this makefile the target bar which is not \n" - ."defined here but passes the target bar on to another makefile\n" - ."which does have the target bar defined.\n"; - -$makefile2 = &get_tmpfile; - -open(MAKEFILE,"> $makefile"); - -# The Contents of the MAKEFILE ... - -print MAKEFILE "foo:\n"; -print MAKEFILE "\t\@echo Executing rule FOO\n\n"; -print MAKEFILE ".DEFAULT:\n"; -print MAKEFILE "\t\@\$(MAKE) -f $makefile2 \$\@ \n"; - -# END of Contents of MAKEFILE - -close(MAKEFILE); - - -open(MAKEFILE,"> $makefile2"); - -print MAKEFILE "bar:\n"; -print MAKEFILE "\t\@echo Executing rule BAR\n\n"; - -close(MAKEFILE); - -&run_make_with_options($makefile,'bar',&get_logfile); - -# Create the answer to what should be produced by this Makefile -$answer = "${make_name}[1]: Entering directory `$pwd'\n" - . "Executing rule BAR\n" - . "${make_name}[1]: Leaving directory `$pwd'\n"; - -# COMPARE RESULTS - -&compare_output($answer,&get_logfile(1)); - -# This tells the test driver that the perl test script executed properly. -1; - - - - - - diff --git a/make/make-3.81/tests/scripts/targets/FORCE b/make/make-3.81/tests/scripts/targets/FORCE deleted file mode 100644 index eb8f251..0000000 --- a/make/make-3.81/tests/scripts/targets/FORCE +++ /dev/null @@ -1,40 +0,0 @@ -# -*-perl-*- - -$description = "The following tests rules without Commands or Dependencies."; - -$details = "If the rule ...\n"; - -open(MAKEFILE,"> $makefile"); - -# The Contents of the MAKEFILE ... - -print MAKEFILE ".IGNORE :\n"; -print MAKEFILE "clean: FORCE\n"; -print MAKEFILE "\t$delete_command clean\n"; -print MAKEFILE "FORCE:\n"; - -# END of Contents of MAKEFILE - -close(MAKEFILE); - - -# Create a file named "clean". This is the same name as the target clean -# and tricks the target into thinking that it is up to date. (Unless you -# use the .PHONY target. -&touch("clean"); - -$answer = "$delete_command clean\n"; -&run_make_with_options($makefile,"clean",&get_logfile); - -&compare_output($answer,&get_logfile(1)); - -1; - - - - - - - - - diff --git a/make/make-3.81/tests/scripts/targets/INTERMEDIATE b/make/make-3.81/tests/scripts/targets/INTERMEDIATE deleted file mode 100644 index 4fdd7a2..0000000 --- a/make/make-3.81/tests/scripts/targets/INTERMEDIATE +++ /dev/null @@ -1,108 +0,0 @@ -# -*-perl-*- - -$description = "Test the behaviour of the .INTERMEDIATE target."; - -$details = "\ -Test the behavior of the .INTERMEDIATE special target. -Create a makefile where a file would not normally be considered -intermediate, then specify it as .INTERMEDIATE. Build and ensure it's -deleted properly. Rebuild to ensure that it's not created if it doesn't -exist but doesn't need to be built. Change the original and ensure -that the intermediate file and the ultimate target are both rebuilt, and -that the intermediate file is again deleted. - -Try this with implicit rules and explicit rules: both should work.\n"; - -open(MAKEFILE,"> $makefile"); - -print MAKEFILE <<'EOF'; - -.INTERMEDIATE: foo.e bar.e - -# Implicit rule test -%.d : %.e ; cp $< $@ -%.e : %.f ; cp $< $@ - -foo.d: foo.e - -# Explicit rule test -foo.c: foo.e bar.e; cat $^ > $@ -EOF - -close(MAKEFILE); - -# TEST #0 - -&utouch(-20, 'foo.f', 'bar.f'); - -&run_make_with_options($makefile,'foo.d',&get_logfile); -$answer = "cp foo.f foo.e\ncp foo.e foo.d\nrm foo.e\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #1 - -&run_make_with_options($makefile,'foo.d',&get_logfile); -$answer = "$make_name: `foo.d' is up to date.\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #2 - -&utouch(-10, 'foo.d'); -&touch('foo.f'); - -&run_make_with_options($makefile,'foo.d',&get_logfile); -$answer = "cp foo.f foo.e\ncp foo.e foo.d\nrm foo.e\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #3 - -&run_make_with_options($makefile,'foo.c',&get_logfile); -$answer = "cp foo.f foo.e\ncp bar.f bar.e\ncat foo.e bar.e > foo.c\nrm bar.e foo.e\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #4 - -&run_make_with_options($makefile,'foo.c',&get_logfile); -$answer = "$make_name: `foo.c' is up to date.\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #5 - -&utouch(-10, 'foo.c'); -&touch('foo.f'); - -&run_make_with_options($makefile,'foo.c',&get_logfile); -$answer = "cp foo.f foo.e\ncp bar.f bar.e\ncat foo.e bar.e > foo.c\nrm bar.e foo.e\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #6 -- added for PR/1669: don't remove files mentioned on the cmd line. - -&run_make_with_options($makefile,'foo.e',&get_logfile); -$answer = "cp foo.f foo.e\n"; -&compare_output($answer, &get_logfile(1)); - -unlink('foo.f', 'foo.e', 'foo.d', 'foo.c', 'bar.f', 'bar.e', 'bar.d', 'bar.c'); - -# TEST #7 -- added for PR/1423 - -$makefile2 = &get_tmpfile; - -open(MAKEFILE, "> $makefile2"); - -print MAKEFILE <<'EOF'; -all: foo -foo.a: ; touch $@ -%: %.a ; touch $@ -.INTERMEDIATE: foo.a -EOF - -close(MAKEFILE); - -&run_make_with_options($makefile2, '-R', &get_logfile); -$answer = "touch foo.a\ntouch foo\nrm foo.a\n"; -&compare_output($answer, &get_logfile(1)); - -unlink('foo'); - -# This tells the test driver that the perl test script executed properly. -1; diff --git a/make/make-3.81/tests/scripts/targets/PHONY b/make/make-3.81/tests/scripts/targets/PHONY deleted file mode 100644 index c8e2110..0000000 --- a/make/make-3.81/tests/scripts/targets/PHONY +++ /dev/null @@ -1,54 +0,0 @@ -# -*-perl-*- - -$description = "The following tests the use of a PHONY target. It makes\n" - ."sure that the rules under a target get executed even if\n" - ."a filename of the same name of the target exists in the\n" - ."directory.\n"; - -$details = "This makefile in this test declares the target clean to be a \n" - ."PHONY target. We then create a file named \"clean\" in the \n" - ."directory. Although this file exists, the rule under the target\n" - ."clean should still execute because of it's phony status."; - -$example = "EXAMPLE_FILE"; - -open(MAKEFILE,"> $makefile"); - -# The Contents of the MAKEFILE ... - -print MAKEFILE ".PHONY : clean \n"; -print MAKEFILE "all: \n"; -print MAKEFILE "\t\@echo This makefile did not clean the dir ... good\n"; -print MAKEFILE "clean: \n"; -print MAKEFILE "\t$delete_command $example clean\n"; - -# END of Contents of MAKEFILE - -close(MAKEFILE); - -&touch($example); - -# Create a file named "clean". This is the same name as the target clean -# and tricks the target into thinking that it is up to date. (Unless you -# use the .PHONY target. -&touch("clean"); - -$answer = "$delete_command $example clean\n"; -&run_make_with_options($makefile,"clean",&get_logfile); - -if (-f $example) { - $test_passed = 0; -} - -&compare_output($answer,&get_logfile(1)); - -1; - - - - - - - - - diff --git a/make/make-3.81/tests/scripts/targets/SECONDARY b/make/make-3.81/tests/scripts/targets/SECONDARY deleted file mode 100644 index cf580b5..0000000 --- a/make/make-3.81/tests/scripts/targets/SECONDARY +++ /dev/null @@ -1,125 +0,0 @@ -#! -*-perl-*- - -$description = "Test the behaviour of the .SECONDARY target."; - -$details = "\ -Test the behavior of the .SECONDARY special target. -Create a makefile where a file would not normally be considered -intermediate, then specify it as .SECONDARY. Build and note that it's -not automatically deleted. Delete the file. Rebuild to ensure that -it's not created if it doesn't exist but doesn't need to be built. -Change the original and ensure that the secondary file and the ultimate -target are both rebuilt, and that the secondary file is not deleted. - -Try this with implicit rules and explicit rules: both should work.\n"; - -open(MAKEFILE,"> $makefile"); - -print MAKEFILE <<'EOF'; - -.SECONDARY: foo.e - -# Implicit rule test -%.d : %.e ; cp $< $@ -%.e : %.f ; cp $< $@ - -foo.d: foo.e - -# Explicit rule test -foo.c: foo.e ; cp $< $@ -EOF - -close(MAKEFILE); - -# TEST #1 - -&utouch(-20, 'foo.f'); - -&run_make_with_options($makefile,'foo.d',&get_logfile); -$answer = "cp foo.f foo.e\ncp foo.e foo.d\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #2 - -unlink('foo.e'); - -&run_make_with_options($makefile,'foo.d',&get_logfile); -$answer = "$make_name: `foo.d' is up to date.\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #3 - -&utouch(-10, 'foo.d'); -&touch('foo.f'); - -&run_make_with_options($makefile,'foo.d',&get_logfile); -$answer = "cp foo.f foo.e\ncp foo.e foo.d\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #4 - -&run_make_with_options($makefile,'foo.c',&get_logfile); -$answer = "cp foo.e foo.c\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #5 - -unlink('foo.e'); - -&run_make_with_options($makefile,'foo.c',&get_logfile); -$answer = "$make_name: `foo.c' is up to date.\n"; -&compare_output($answer, &get_logfile(1)); - -# TEST #6 - -&utouch(-10, 'foo.c'); -&touch('foo.f'); - -&run_make_with_options($makefile,'foo.c',&get_logfile); -$answer = "cp foo.f foo.e\ncp foo.e foo.c\n"; -&compare_output($answer, &get_logfile(1)); - -unlink('foo.f', 'foo.e', 'foo.d', 'foo.c'); - -# TEST #7 -- test the "global" .SECONDARY, with no targets. - -$makefile2 = &get_tmpfile; - -open(MAKEFILE, "> $makefile2"); - -print MAKEFILE <<'EOF'; -.SECONDARY: - -final: intermediate -intermediate: source - -final intermediate source: - echo $< > $@ -EOF - -close(MAKEFILE); - -&utouch(-10, 'source'); -touch('final'); - -&run_make_with_options($makefile2, '', &get_logfile); -$answer = "$make_name: `final' is up to date.\n"; -&compare_output($answer, &get_logfile(1)); - -unlink('source', 'final', 'intermediate'); - - -# TEST #8 -- test the "global" .SECONDARY, with .PHONY. - -touch('version2'); -run_make_test(' -.PHONY: version -.SECONDARY: -version2: version ; @echo GOOD -all: version2', - 'all', 'GOOD'); - -unlink('version2'); - -# This tells the test driver that the perl test script executed properly. -1; diff --git a/make/make-3.81/tests/scripts/targets/SILENT b/make/make-3.81/tests/scripts/targets/SILENT deleted file mode 100644 index 4bb0a0f..0000000 --- a/make/make-3.81/tests/scripts/targets/SILENT +++ /dev/null @@ -1,42 +0,0 @@ -# -*-perl-*- - -$description = "The following tests the special target .SILENT. By simply\n" - ."mentioning this as a target, it tells make not to print\n" - ."commands before executing them."; - -$details = "This test is the same as the clean test except that it should\n" - ."not echo its command before deleting the specified file.\n"; - -$example = "EXAMPLE_FILE"; - -open(MAKEFILE,"> $makefile"); - -# The Contents of the MAKEFILE ... - -print MAKEFILE ".SILENT : clean\n"; -print MAKEFILE "clean: \n"; -print MAKEFILE "\t$delete_command EXAMPLE_FILE\n"; - -# END of Contents of MAKEFILE - -close(MAKEFILE); - -&touch($example); - -$answer = ""; -&run_make_with_options($makefile,"clean",&get_logfile,0); -if (-f $example) { - $test_passed = 0; -} -&compare_output($answer,&get_logfile(1)); - -1; - - - - - - - - - diff --git a/make/make-3.81/tests/scripts/targets/clean b/make/make-3.81/tests/scripts/targets/clean deleted file mode 100644 index b32c976..0000000 --- a/make/make-3.81/tests/scripts/targets/clean +++ /dev/null @@ -1,50 +0,0 @@ -# -*-perl-*- - -$description = "The following test creates a makefile to delete a \n" - ."file in the directory. It tests to see if make will \n" - ."NOT execute the command unless the rule is given in \n" - ."the make command line."; - -$example = "EXAMPLE_FILE"; - -open(MAKEFILE,"> $makefile"); - -# The Contents of the MAKEFILE ... - -print MAKEFILE "all: \n"; -print MAKEFILE "\t\@echo This makefile did not clean the dir... good\n"; -print MAKEFILE "clean: \n"; -print MAKEFILE "\t$delete_command EXAMPLE_FILE\n"; - -# END of Contents of MAKEFILE - -close(MAKEFILE); - -&touch($example); - - -&run_make_with_options($makefile,"",&get_logfile,0); - -# Create the answer to what should be produced by this Makefile -$answer = "This makefile did not clean the dir... good\n"; - -&compare_output($answer,&get_logfile(1)) || &error ("abort"); - - -$answer = "$delete_command $example\n"; -&run_make_with_options($makefile,"clean",&get_logfile,0); -if (-f $example) { - $test_passed = 0; -} -&compare_output($answer,&get_logfile(1)) || &error ("abort"); - -1; - - - - - - - - - |