summaryrefslogtreecommitdiff
path: root/tests/scripts/features
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-09-14 02:03:19 +0000
committerPaul Smith <psmith@gnu.org>1999-09-14 02:03:19 +0000
commit0d366b668244112846554c42045ff1d9956276ed (patch)
tree3802242fe18a5e90d889f5d1ac66fb487361888b /tests/scripts/features
parent4121dea6a59367b4431cbe7a3c43d74fec9fd832 (diff)
downloadgunmake-0d366b668244112846554c42045ff1d9956276ed.tar.gz
* Added the test suite to the main distribution.
Diffstat (limited to 'tests/scripts/features')
-rw-r--r--tests/scripts/features/comments35
-rw-r--r--tests/scripts/features/conditionals67
-rw-r--r--tests/scripts/features/default_names63
-rw-r--r--tests/scripts/features/double_colon48
-rw-r--r--tests/scripts/features/echoing90
-rw-r--r--tests/scripts/features/errors93
-rw-r--r--tests/scripts/features/escape38
-rw-r--r--tests/scripts/features/include58
-rw-r--r--tests/scripts/features/mult_rules78
-rw-r--r--tests/scripts/features/mult_targets46
-rw-r--r--tests/scripts/features/override34
-rw-r--r--tests/scripts/features/parallelism76
-rw-r--r--tests/scripts/features/patspecific_vars40
-rw-r--r--tests/scripts/features/quoting32
-rw-r--r--tests/scripts/features/recursion61
-rw-r--r--tests/scripts/features/reinvoke90
-rw-r--r--tests/scripts/features/statipattrules71
-rw-r--r--tests/scripts/features/targetvars108
-rw-r--r--tests/scripts/features/varnesting34
-rw-r--r--tests/scripts/features/vpath62
-rw-r--r--tests/scripts/features/vpath245
-rw-r--r--tests/scripts/features/vpathgpath64
-rw-r--r--tests/scripts/features/vpathplus125
23 files changed, 1458 insertions, 0 deletions
diff --git a/tests/scripts/features/comments b/tests/scripts/features/comments
new file mode 100644
index 0000000..9257955
--- /dev/null
+++ b/tests/scripts/features/comments
@@ -0,0 +1,35 @@
+$description = "The following test creates a makefile to test comments\n"
+ ."and comment continuation to the next line using a \n"
+ ."backslash within makefiles.";
+
+$details = "To test comments within a makefile, a semi-colon was placed \n"
+ ."after a comment was started. This should not be reported as\n"
+ ."an error since it is within a comment. We then continue the \n"
+ ."comment to the next line using a backslash. To test whether\n"
+ ."the comment really continued, we place an echo command with some\n"
+ ."text on the line which should never execute since it should be \n"
+ ."within a comment\n";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE <<\EOF;
+# Test comment vs semicolon parsing and line continuation
+target: # this ; is just a comment \
+ @echo This is within a comment.
+ @echo There should be no errors for this makefile.
+EOF
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&run_make_with_options($makefile,"",&get_logfile);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "There should be no errors for this makefile.\n";
+
+# COMPARE RESULTS
+
+&compare_output($answer,&get_logfile(1))
diff --git a/tests/scripts/features/conditionals b/tests/scripts/features/conditionals
new file mode 100644
index 0000000..3557fb5
--- /dev/null
+++ b/tests/scripts/features/conditionals
@@ -0,0 +1,67 @@
+# -*-perl-*-
+$description = "Check GNU make conditionals.";
+
+$details = "Attempt various different flavors of GNU make conditionals.";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE <<'EOMAKE';
+objects = foo.obj
+arg1 = first
+arg2 = second
+arg3 = third
+arg4 = cc
+arg5 = second
+
+all:
+ifeq ($(arg1),$(arg2))
+ @echo arg1 equals arg2
+else
+ @echo arg1 NOT equal arg2
+endif
+
+ifeq '$(arg2)' "$(arg5)"
+ @echo arg2 equals arg5
+else
+ @echo arg2 NOT equal arg5
+endif
+
+ifneq '$(arg3)' '$(arg4)'
+ @echo arg3 NOT equal arg4
+else
+ @echo arg3 equal arg4
+endif
+
+ifndef undefined
+ @echo variable is undefined
+else
+ @echo variable undefined is defined
+endif
+ifdef arg4
+ @echo arg4 is defined
+else
+ @echo arg4 is NOT defined
+endif
+
+EOMAKE
+
+close(MAKEFILE);
+
+&run_make_with_options($makefile,"",&get_logfile,0);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "arg1 NOT equal arg2
+arg2 equals arg5
+arg3 NOT equal arg4
+variable is undefined
+arg4 is defined
+";
+
+# COMPARE RESULTS
+
+&compare_output($answer,&get_logfile(1));
+
+# This tells the test driver that the perl test script executed properly.
+1;
diff --git a/tests/scripts/features/default_names b/tests/scripts/features/default_names
new file mode 100644
index 0000000..824f889
--- /dev/null
+++ b/tests/scripts/features/default_names
@@ -0,0 +1,63 @@
+$description = "This script tests to make sure that Make looks for
+default makefiles in the correct order (GNUmakefile,makefile,Makefile)";
+
+# Create a makefile called "GNUmakefile"
+$makefile = "GNUmakefile";
+
+open(MAKEFILE,"> $makefile");
+
+print MAKEFILE "FIRST: ; \@echo It chose GNUmakefile\n";
+
+close(MAKEFILE);
+
+# DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
+# Just test what we can here (avoid Makefile versus makefile test).
+#
+if ($osname !~ /DOS|Windows/i)
+{
+ # Create another makefile called "makefile"
+ open(MAKEFILE,"> makefile");
+
+ print MAKEFILE "SECOND: ; \@echo It chose makefile\n";
+
+ close(MAKEFILE);
+}
+
+
+# Create another makefile called "Makefile"
+open(MAKEFILE,"> Makefile");
+
+print MAKEFILE "THIRD: ; \@echo It chose Makefile\n";
+
+close(MAKEFILE);
+
+
+&run_make_with_options("","",&get_logfile);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "It chose GNUmakefile\n";
+
+# COMPARE RESULTS
+
+&compare_output($answer,&get_logfile(1)) || &error("abort");
+unlink $makefile;
+
+# DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
+# Just test what we can here (avoid Makefile versus makefile test).
+#
+if ($osname !~ /DOS|Windows/i)
+{
+ $answer = "It chose makefile\n";
+
+ &run_make_with_options("","",&get_logfile);
+
+ &compare_output($answer,&get_logfile(1)) || &error("abort");
+ unlink "makefile";
+}
+
+$answer = "It chose Makefile\n";
+
+&run_make_with_options("","",&get_logfile);
+
+&compare_output($answer,&get_logfile(1)) || &error("abort");
+unlink "Makefile";
diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon
new file mode 100644
index 0000000..096fb33
--- /dev/null
+++ b/tests/scripts/features/double_colon
@@ -0,0 +1,48 @@
+$description = "The following test creates a makefile to test Double-Colon\n"
+ ."Rules. They are rules which are written with '::' instead\n"
+ ."of ':' after the target names. This tells make that each \n"
+ ."of these rules are independent of the others and each rule's\n"
+ ."commands are executed if the target is older than any \n"
+ ."dependencies of that rule.";
+
+$details = "The makefile created by this test contains two double-colon \n"
+ ."rules for foo; each with their own commands. When make is run,\n"
+ ."each command should be executed in the sequence that they are \n"
+ ."found. The command is a simple echo statement.";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "foo:: bar.h \n"
+ ."\t\@echo Executing rule foo FIRST\n"
+ ."foo2: bar.h \n"
+ ."foo:: bar2.h \n"
+ ."\t\@echo Executing rule foo SECOND\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&touch("bar.h","bar2.h");
+
+&run_make_with_options($makefile,
+ "",
+ &get_logfile,
+ 0);
+
+
+$answer = "Executing rule foo FIRST\n"
+ ."Executing rule foo SECOND\n";
+
+&compare_output($answer,&get_logfile(1));
+
+unlink("bar.h","bar2.h");
+
+1;
+
+
+
+
+
+
diff --git a/tests/scripts/features/echoing b/tests/scripts/features/echoing
new file mode 100644
index 0000000..ed1e862
--- /dev/null
+++ b/tests/scripts/features/echoing
@@ -0,0 +1,90 @@
+$description = "The following test creates a makefile to test command \n"
+ ."echoing. It tests that when a command line starts with \n"
+ ."a '\@', the echoing of that line is suppressed. It also \n"
+ ."tests the -n option which tells make to ONLY echo the \n"
+ ."commands and no execution happens. In this case, even \n"
+ ."the commands with '\@' are printed. Lastly, it tests the \n"
+ ."-s flag which tells make to prevent all echoing, as if \n"
+ ."all commands started with a '\@'.";
+
+$details = "This test is similar to the 'clean' test except that a '\@' has\n"
+ ."been placed in front of the delete command line. Four tests \n"
+ ."are run here. First, make is run normally and the first echo\n"
+ ."command should be executed. In this case there is no '\@' so \n"
+ ."we should expect make to display the command AND display the \n"
+ ."echoed message. Secondly, make is run with the clean target, \n"
+ ."but since there is a '\@' at the beginning of the command, we\n"
+ ."expect no output; just the deletion of a file which we check \n"
+ ."for. Third, we give the clean target again except this time\n"
+ ."we give make the -n option. We now expect the command to be \n"
+ ."displayed but not to be executed. In this case we need only \n"
+ ."to check the output since an error message would be displayed\n"
+ ."if it actually tried to run the delete command again and the \n"
+ ."file didn't exist. Lastly, we run the first test again with \n"
+ ."the -s option and check that make did not echo the echo \n"
+ ."command before printing the message.";
+
+$example = "EXAMPLE_FILE";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "all: \n";
+print MAKEFILE "\techo This makefile did not clean the dir... good\n";
+print MAKEFILE "clean: \n";
+print MAKEFILE "\t\@$delete_command $example\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&touch($example);
+
+# TEST #1
+# -------
+
+&run_make_with_options($makefile,"",&get_logfile,0);
+$answer = "echo This makefile did not clean the dir... good\n"
+ ."This makefile did not clean the dir... good\n";
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #2
+# -------
+
+&run_make_with_options($makefile,"clean",&get_logfile,0);
+$answer = "";
+&compare_output($answer,&get_logfile(1));
+
+if (-f $example)
+{
+ $test_passed = 0;
+}
+
+# TEST #3
+# -------
+
+&run_make_with_options($makefile,"-n clean",&get_logfile,0);
+$answer = "$delete_command $example\n";
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #4
+# -------
+
+&run_make_with_options($makefile,"-s",&get_logfile,0);
+$answer = "This makefile did not clean the dir... good\n";
+&compare_output($answer,&get_logfile(1));
+
+
+1;
+
+
+
+
+
+
+
+
+
diff --git a/tests/scripts/features/errors b/tests/scripts/features/errors
new file mode 100644
index 0000000..a39064f
--- /dev/null
+++ b/tests/scripts/features/errors
@@ -0,0 +1,93 @@
+$description = "The following tests the -i option and the '-' in front of \n"
+ ."commands to test that make ignores errors in these commands\n"
+ ."and continues processing.";
+
+$details = "This test runs two makes. The first runs on a target with a \n"
+ ."command that has a '-' in front of it (and a command that is \n"
+ ."intended to fail) and then a delete command after that is \n"
+ ."intended to succeed. If make ignores the failure of the first\n"
+ ."command as it is supposed to, then the second command should \n"
+ ."delete a file and this is what we check for. The second make\n"
+ ."that is run in this test is identical except that the make \n"
+ ."command is given with the -i option instead of the '-' in \n"
+ ."front of the command. They should run the same. ";
+
+if ($vos)
+{
+ $delete_command = "delete_file";
+}
+else
+{
+ $delete_command = "rm";
+}
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "clean:\n"
+ ."\t-$delete_command cleanit\n"
+ ."\t$delete_command foo\n"
+ ."clean2: \n"
+ ."\t$delete_command cleanit\n"
+ ."\t$delete_command foo\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&touch("foo");
+
+unlink("cleanit");
+$cleanit_error = `sh -c "$delete_command cleanit 2>&1"`;
+$delete_error_code = $? >> 8;
+
+# TEST #1
+# -------
+
+$answer = "$delete_command cleanit\n"
+ . $cleanit_error
+ ."$make_name: [clean] Error $delete_error_code (ignored)\n"
+ ."$delete_command foo\n";
+
+&run_make_with_options($makefile,"",&get_logfile);
+
+# The output for this on VOS is too hard to replicate, so we only check it
+# on unix.
+if (!$vos)
+{
+ &compare_output($answer,&get_logfile(1));
+}
+
+# If make acted as planned, it should ignore the error from the first
+# command in the target and execute the second which deletes the file "foo"
+# This file, therefore, should not exist if the test PASSES.
+if (-f "foo")
+{
+ $test_passed = 0;
+}
+
+
+&touch("foo");
+
+# TEST #2
+# -------
+
+$answer = "$delete_command cleanit\n"
+ . $cleanit_error
+ ."$make_name: [clean2] Error $delete_error_code (ignored)\n"
+ ."$delete_command foo\n";
+
+&run_make_with_options($makefile,"clean2 -i",&get_logfile);
+
+if (!$vos)
+{
+ &compare_output($answer,&get_logfile(1));
+}
+
+if (-f "foo")
+{
+ $test_passed = 0;
+}
+
+1;
diff --git a/tests/scripts/features/escape b/tests/scripts/features/escape
new file mode 100644
index 0000000..7404387
--- /dev/null
+++ b/tests/scripts/features/escape
@@ -0,0 +1,38 @@
+$description = "Test various types of escaping in makefiles.";
+
+$details = "Make sure that escaping of `:' works in target names.";
+
+open(MAKEFILE,"> $makefile");
+
+print MAKEFILE '$(path)foo : ; @echo cp $^ $@
+';
+
+close(MAKEFILE);
+
+
+# TEST 1
+
+&run_make_with_options($makefile, "", &get_logfile);
+$answer = "cp foo\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST 2: This one should fail, since the ":" is unquoted.
+
+&run_make_with_options($makefile, "path=p:", &get_logfile, 512);
+$answer = "$makefile:1: *** target pattern contains no `%'. Stop.\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST 3: This one should work, since we escape the ":".
+
+&run_make_with_options($makefile, "'path=p\\:'", &get_logfile, 0);
+$answer = "cp p:foo\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST 4: This one should fail, since the escape char is escaped.
+
+&run_make_with_options($makefile, "'path=p\\\\:'", &get_logfile, 512);
+$answer = "$makefile:1: *** target pattern contains no `%'. Stop.\n";
+&compare_output($answer,&get_logfile(1));
+
+# This tells the test driver that the perl test script executed properly.
+1;
diff --git a/tests/scripts/features/include b/tests/scripts/features/include
new file mode 100644
index 0000000..2a48fbd
--- /dev/null
+++ b/tests/scripts/features/include
@@ -0,0 +1,58 @@
+# -*-mode: perl; rm-trailing-spaces: nil-*-
+
+$description = "Test various forms of the GNU make `include' command.";
+
+$details = "Test include, -include, sinclude and various regressions involving them.
+Test extra whitespace at the end of the include, multiple -includes and
+sincludes (should not give an error) and make sure that errors are reported
+for targets that were also -included.";
+
+$makefile2 = &get_tmpfile;
+
+open(MAKEFILE,"> $makefile");
+
+# The contents of the Makefile ...
+
+print MAKEFILE <<EOF;
+\#Extra space at the end of the following file name
+include $makefile2
+all: ; \@echo There should be no errors for this makefile.
+
+-include nonexistent.mk
+-include nonexistent.mk
+sinclude nonexistent.mk
+sinclude nonexistent-2.mk
+-include makeit.mk
+sinclude makeit.mk
+
+error: makeit.mk
+EOF
+
+close(MAKEFILE);
+
+
+open(MAKEFILE,"> $makefile2");
+
+print MAKEFILE "ANOTHER: ; \@echo This is another included makefile\n";
+
+close(MAKEFILE);
+
+# Create the answer to what should be produced by this Makefile
+&run_make_with_options($makefile, "all", &get_logfile);
+$answer = "There should be no errors for this makefile.\n";
+&compare_output($answer, &get_logfile(1));
+
+&run_make_with_options($makefile, "ANOTHER", &get_logfile);
+$answer = "This is another included makefile\n";
+&compare_output($answer, &get_logfile(1));
+
+# Try to build the "error" target; this will fail since we don't know
+# how to create makeit.mk, but we should also get a message (even though
+# the -include suppressed it during the makefile read phase, we should
+# see one during the makefile run phase).
+
+&run_make_with_options($makefile, "error", &get_logfile, 512);
+$answer = "$make_name: *** No rule to make target `makeit.mk', needed by `error'.\n";
+&compare_output($answer, &get_logfile(1));
+
+1;
diff --git a/tests/scripts/features/mult_rules b/tests/scripts/features/mult_rules
new file mode 100644
index 0000000..6f120f1
--- /dev/null
+++ b/tests/scripts/features/mult_rules
@@ -0,0 +1,78 @@
+$description = "\
+The following test creates a makefile to test the presence
+of multiple rules for one target. One file can be the
+target of several rules if at most one rule has commands;
+the other rules can only have dependencies.";
+
+$details = "\
+The makefile created in this test contains two hardcoded rules
+for foo.o and bar.o. It then gives another multiple target rule
+with the same names as above but adding more dependencies.
+Additionally, another variable extradeps is listed as a
+dependency but is defined to be null. It can however be defined
+on the make command line as extradeps=extra.h which adds yet
+another dependency to the targets.";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE <<EOF;
+objects = foo.o bar.o
+foo.o : defs.h
+bar.o : defs.h test.h
+extradeps =
+\$(objects) : config.h \$(extradeps)
+\t\@echo EXTRA EXTRA
+EOF
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&touch("defs.h","test.h","config.h");
+
+if ($vos)
+{
+ $error_code = 3307;
+}
+else
+{
+ $error_code = 512;
+}
+
+&run_make_with_options($makefile,
+ "extradeps=extra.h",
+ &get_logfile,
+ $error_code);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "$make_name: *** No rule to make target `extra.h', needed by `foo.o'. Stop.\n";
+
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #2
+# -------
+
+&touch("extra.h");
+
+&run_make_with_options($makefile,
+ "extradeps=extra.h",
+ &get_logfile,
+ 0);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "EXTRA EXTRA\n";
+
+&compare_output($answer,&get_logfile(1));
+
+unlink("defs.h","test.h","config.h","extra.h");
+
+1;
+
+
+
+
+
+
diff --git a/tests/scripts/features/mult_targets b/tests/scripts/features/mult_targets
new file mode 100644
index 0000000..c8ff418
--- /dev/null
+++ b/tests/scripts/features/mult_targets
@@ -0,0 +1,46 @@
+$description = "The following test creates a makefile to test that a \n "
+ ."rule with multiple targets is equivalent to writing \n"
+ ."many rules, each with one target, and all identical aside\n"
+ ."from that.";
+
+$details = "A makefile is created with one rule and two targets. Make \n"
+ ."is called twice, once for each target, and the output which \n"
+ ."contains the target name with \$@ is looked at for the changes.\n"
+ ."This test also tests the substitute function by replacing \n"
+ ."the word output with nothing in the target name giving either\n"
+ ."an output of \"I am little\" or \"I am big\"";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "bigoutput littleoutput: test.h\n";
+print MAKEFILE "\t\@echo I am \$(subst output,,\$@)\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&touch("test.h");
+
+&run_make_with_options($makefile,"bigoutput",&get_logfile);
+
+
+# Create the answer to what should be produced by this Makefile
+$answer = "I am big\n";
+
+&compare_output($answer,&get_logfile(1));
+
+&run_make_with_options($makefile,"littleoutput",&get_logfile);
+$answer = "I am little\n";
+&compare_output($answer,&get_logfile(1));
+
+unlink "test.h";
+
+1;
+
+
+
+
+
+
diff --git a/tests/scripts/features/override b/tests/scripts/features/override
new file mode 100644
index 0000000..23e4f2b
--- /dev/null
+++ b/tests/scripts/features/override
@@ -0,0 +1,34 @@
+$description = "The following test creates a makefile to ...";
+
+$details = "";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "override define foo\n"
+ ."\@echo First comes the definition.\n"
+ ."\@echo Then comes the override.\n"
+ ."endef\n"
+ ."all: \n"
+ ."\t\$(foo)\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&run_make_with_options($makefile,"foo=Hello",&get_logfile);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "First comes the definition.\n"
+ ."Then comes the override.\n";
+
+&compare_output($answer,&get_logfile(1));
+
+1;
+
+
+
+
+
+
diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
new file mode 100644
index 0000000..17e800c
--- /dev/null
+++ b/tests/scripts/features/parallelism
@@ -0,0 +1,76 @@
+# -*-perl-*-
+
+$description = "Test parallelism (-j) option.";
+
+
+$details = "This test creates a makefile with three double-colon default
+rules. The first rule has a series of sleep and echo commands
+intended to run in series. The second and third have just an
+echo statement. When make is called in this test, it is given
+the -j option with a value of 4. This tells make that it may
+start up to four jobs simultaneously. In this case, since the
+first command is a sleep command, the output of the second
+and third commands will appear before the first if indeed
+make is running all of these commands in parallel.";
+
+if (!$parallel_jobs) {
+ return -1;
+}
+
+if ($vos) {
+ $delete_command = "delete_file -no_ask";
+ $sleep_command = "sleep -seconds";
+}
+else {
+ $delete_command = "rm -f";
+ $sleep_command = "sleep";
+}
+
+open(MAKEFILE,"> $makefile");
+
+print MAKEFILE <<"EOF";
+all : def_1 def_5 def_6
+def_1 :
+\t\@$sleep_command 3 ; echo ONE
+\t\@echo TWO
+\t\@$sleep_command 1 ; echo THREE
+\t\@echo FOUR
+def_5 :
+\t\@echo FIVE
+def_6 :
+\t\@$sleep_command 1 ; echo SIX
+
+EOF
+
+close(MAKEFILE);
+
+&run_make_with_options($makefile, "-j 4", &get_logfile);
+$answer = "FIVE\nSIX\nONE\nTWO\nTHREE\nFOUR\n";
+&compare_output($answer, &get_logfile(1));
+
+
+# Test parallelism with included files
+
+$makefile2 = &get_tmpfile;
+
+open(MAKEFILE,"> $makefile2");
+
+print MAKEFILE <<'EOF';
+all: 1 2 3; @echo success
+
+-include 1.inc 2.inc 3.inc
+
+ 1.inc: ; @sleep 1; echo 1; echo "1: ; @echo $@ has been included" > $@
+2.inc: ; @sleep 2; echo 2; echo "2: ; @echo $@ has been included" > $@
+3.inc: ; @echo 3; echo "3: ; @echo $@ has been included" > $@
+EOF
+
+close(MAKEFILE);
+
+&run_make_with_options("$makefile2", "-j 4", &get_logfile);
+$answer = "3\n1\n2\n1.inc has been included\n2.inc has been included\n3.inc has been included\nsuccess\n";
+&compare_output($answer, &get_logfile(1));
+
+unlink('1.inc', '2.inc', '3.inc');
+
+1;
diff --git a/tests/scripts/features/patspecific_vars b/tests/scripts/features/patspecific_vars
new file mode 100644
index 0000000..0684a80
--- /dev/null
+++ b/tests/scripts/features/patspecific_vars
@@ -0,0 +1,40 @@
+# -*-perl-*-
+$description = "Test pattern-specific variable settings.";
+
+$details = "\
+Create a makefile containing various flavors of pattern-specific variable
+settings, override and non-override, and using various variable expansion
+rules, semicolon interference, etc.";
+
+open(MAKEFILE,"> $makefile");
+
+print MAKEFILE <<'EOF';
+all: one.x two.x three.x
+FOO = foo
+BAR = bar
+BAZ = baz
+thr% : override BAZ = three
+t%.x: BAR = four
+%.x: BAR = two
+%.x: override BAZ = three
+one.x: override FOO = one
+one.x two.x three.x: ; @echo $(FOO) $(BAR) $(BAZ)
+EOF
+
+close(MAKEFILE);
+
+
+# TEST #1 -- basics
+
+&run_make_with_options($makefile, "", &get_logfile);
+$answer = "one two three\nfoo four baz\nfoo bar three\n";
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #2 -- try the override feature
+
+&run_make_with_options($makefile, "BAZ=five", &get_logfile);
+$answer = "one two three\nfoo four five\nfoo bar three\n";
+&compare_output($answer,&get_logfile(1));
+
+1;
diff --git a/tests/scripts/features/quoting b/tests/scripts/features/quoting
new file mode 100644
index 0000000..916681c
--- /dev/null
+++ b/tests/scripts/features/quoting
@@ -0,0 +1,32 @@
+# -*-perl-*-
+
+$description = "The following test creates a makefile to test using \n" .
+ "quotes within makefiles.";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE <<'EOM';
+SHELL = /bin/sh
+TEXFONTS = NICEFONT
+DEFINES = -DDEFAULT_TFM_PATH=\".:$(TEXFONTS)\"
+test: ; @"echo" 'DEFINES = $(DEFINES)'
+EOM
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+
+&run_make_with_options($makefile,"",&get_logfile);
+
+
+# Create the answer to what should be produced by this Makefile
+$answer = 'DEFINES = -DDEFAULT_TFM_PATH=\".:NICEFONT\"' . "\n";
+
+# COMPARE RESULTS
+
+&compare_output($answer,&get_logfile(1));
+
+1;
diff --git a/tests/scripts/features/recursion b/tests/scripts/features/recursion
new file mode 100644
index 0000000..444f7ce
--- /dev/null
+++ b/tests/scripts/features/recursion
@@ -0,0 +1,61 @@
+# -*-perl-*-
+$description = "The following test creates a makefile to ...\n";
+
+$details = "DETAILS";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "all: \n"
+ ."\t\$(MAKE) -f $makefile foo \n"
+ ."foo: \n"
+ ."\t\@echo \$(MAKE) \n"
+ ."\t\@echo MAKELEVEL = \$(MAKELEVEL)\n"
+ ."\t\$(MAKE) -f $makefile last \n"
+ ."last: \n"
+ ."\t\@echo \$(MAKE) \n"
+ ."\t\@echo MAKELEVEL = \$(MAKELEVEL) \n"
+ ."\t\@echo THE END\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+if ($vos)
+{
+ $answer = "$make_name: Entering directory \`$pwd\'\n"
+ ."make 'CFLAGS=-O' -f $makefile foo \n"
+ ."make CFLAGS=-O\n"
+ ."MAKELEVEL = 0\n"
+ ."make 'CFLAGS=-O' -f $makefile last \n"
+ ."make CFLAGS=-O\n"
+ ."MAKELEVEL = 0\n"
+ ."THE END\n"
+ ."$make_name: Leaving directory `$pwd'\n";
+}
+else
+{
+ $answer = "$make_name: Entering directory `$pwd'\n"
+ ."$mkpath -f $makefile foo \n"
+ ."${make_name}[1]: Entering directory `$pwd'\n"
+ ."$mkpath\n"
+ ."MAKELEVEL = 1\n"
+ ."$mkpath -f $makefile last \n"
+ ."${make_name}[2]: Entering directory `$pwd'\n"
+ ."$mkpath\n"
+ ."MAKELEVEL = 2\n"
+ ."THE END\n"
+ ."${make_name}[2]: Leaving directory `$pwd'\n"
+ ."${make_name}[1]: Leaving directory `$pwd'\n"
+ ."$make_name: Leaving directory `$pwd'\n";
+}
+
+$mkoptions = "CFLAGS=-O -w";
+$mkoptions .= " -j 2" if ($parallel_jobs);
+
+&run_make_with_options($makefile,$mkoptions,&get_logfile,0);
+
+&compare_output($answer,&get_logfile(1));
+
+1;
diff --git a/tests/scripts/features/reinvoke b/tests/scripts/features/reinvoke
new file mode 100644
index 0000000..1047d0e
--- /dev/null
+++ b/tests/scripts/features/reinvoke
@@ -0,0 +1,90 @@
+# -*-mode: perl-*-
+
+$description = "Test GNU make's auto-reinvocation feature.";
+
+$details = "\
+If the makefile or one it includes can be rebuilt then it is, and make
+is reinvoked. We create a rule to rebuild the makefile from a temp
+file, then touch the temp file to make it newer than the makefile.";
+
+$makefile2 = &get_tmpfile;
+$makefile_orig = &get_tmpfile;
+
+open(MAKEFILE,"> $makefile");
+
+print MAKEFILE <<EOM;
+SHELL = /bin/sh
+
+all: ; \@echo 'running rules.'
+
+$makefile $makefile2: $makefile_orig
+ \@echo 'rebuilding \$\@.'
+ \@touch \$\@
+
+include $makefile2
+
+EOM
+
+close(MAKEFILE);
+
+&touch($makefile2);
+
+# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
+# granularity of file times.
+sleep(2);
+
+&touch("$makefile_orig");
+
+&run_make_with_options($makefile, "", &get_logfile, 0);
+
+# Create the answer to what should be produced by this Makefile
+
+$answer = "rebuilding $makefile2.\nrebuilding $makefile.\nrunning rules.\n";
+
+&compare_output($answer,&get_logfile(1))
+ && unlink "$makefile_orig";
+
+# In this test we create an included file that's out-of-date, but then
+# the rule doesn't update it. Make shouldn't re-exec.
+
+$makefile3 = &get_tmpfile;
+
+open(MAKEFILE, "> $makefile3");
+print MAKEFILE <<'EOM';
+all: ; @echo hello
+
+a : b ; touch $@
+
+b : c ; [ -f $@ ] || touch $@
+
+c: ; touch $@
+
+include $(F)
+EOM
+
+close(MAKEFILE);
+
+&touch('a','b');
+sleep(2);
+&touch('c');
+
+# First try with the file that's not updated "once removed" from the
+# file we're including.
+
+&run_make_with_options($makefile3, "F=a", &get_logfile, 0);
+
+$answer = "[ -f b ] || touch b\nhello\n";
+&compare_output($answer,&get_logfile(1));
+
+# Now try with the file we're not updating being the actual file we're
+# including: this and the previous one test different parts of the code.
+
+&run_make_with_options($makefile3, "F=b", &get_logfile, 0);
+
+$answer = "[ -f b ] || touch b\nhello\n";
+&compare_output($answer,&get_logfile(1));
+
+unlink('a','b','c');
+
+# This tells the test driver that the perl test script executed properly.
+1;
diff --git a/tests/scripts/features/statipattrules b/tests/scripts/features/statipattrules
new file mode 100644
index 0000000..bf2eae7
--- /dev/null
+++ b/tests/scripts/features/statipattrules
@@ -0,0 +1,71 @@
+$description = "The following test creates a makefile to test static \n"
+ ."pattern rules. Static pattern rules are rules which \n"
+ ."specify multiple targets and construct the dependency \n"
+ ."names for each target based on the target name. ";
+
+$details = "The makefile created in this test has three targets. The \n"
+ ."filter command is used to get those target names ending in \n"
+ .".o and statically creates a compile command with the target\n"
+ ."name and the target name with .c. It also does the same thing\n"
+ ."for another target filtered with .elc and creates a command\n"
+ ."to emacs a .el file";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "files = foo.elc bar.o lose.o \n\n"
+ ."\$(filter %.o,\$(files)): %.o: %.c\n"
+ ."\t\@echo CC -c \$(CFLAGS) \$< -o \$@ \n"
+ ."\$(filter %.elc,\$(files)): %.elc: %.el \n"
+ ."\t\@echo emacs \$< \n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&touch("bar.c","lose.c");
+
+# TEST #1
+# -------
+
+&run_make_with_options($makefile,
+ "",
+ &get_logfile,
+ 0);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "CC -c bar.c -o bar.o\n";
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #2
+# -------
+&run_make_with_options($makefile,"lose.o",&get_logfile);
+
+$answer = "CC -c lose.c -o lose.o\n";
+
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #3
+# -------
+&touch("foo.el");
+
+&run_make_with_options($makefile,"foo.elc",&get_logfile);
+
+$answer = "emacs foo.el\n";
+
+&compare_output($answer,&get_logfile(1));
+
+
+
+unlink("foo.el","bar.c","lose.c");
+
+1;
+
+
+
+
+
+
diff --git a/tests/scripts/features/targetvars b/tests/scripts/features/targetvars
new file mode 100644
index 0000000..e9fe092
--- /dev/null
+++ b/tests/scripts/features/targetvars
@@ -0,0 +1,108 @@
+# -*-perl-*-
+$description = "Test target-specific variable settings.";
+
+$details = "\
+Create a makefile containing various flavors of target-specific variable
+values, override and non-override, and using various variable expansion
+rules, semicolon interference, etc.";
+
+open(MAKEFILE,"> $makefile");
+
+print MAKEFILE <<'EOF';
+SHELL = /bin/sh
+export FOO = foo
+export BAR = bar
+one: override FOO = one
+one two: ; @echo $(FOO) $(BAR)
+two: BAR = two
+three: ; BAR=1000
+ @echo $(FOO) $(BAR)
+# Some things that shouldn't be target vars
+funk : override
+funk : override adelic
+adelic override : ; echo $@
+# Test per-target recursive variables
+four:FOO=x
+four:VAR$(FOO)=ok
+four: ; @echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx)'
+five:FOO=x
+five six : VAR$(FOO)=good
+five six: ;@echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx) $(VARfoo)'
+# Test per-target variable inheritance
+seven: eight
+seven eight: ; @echo $@: $(FOO) $(BAR)
+seven: BAR = seven
+seven: FOO = seven
+eight: BAR = eight
+# Test the export keyword with per-target variables
+nine: ; @echo $(FOO) $(BAR) $$FOO $$BAR
+nine: FOO = wallace
+# Test = escaping
+EQ = =
+ten: one\=two
+ten: one \= two
+ten one$(EQ)two $(EQ):;@echo $@
+.PHONY: one two three four five six seven eight nine ten $(EQ) one$(EQ)two
+# Test target-specific vars with pattern/suffix rules
+QVAR = qvar
+RVAR = =
+%.q : ; @echo $(QVAR) $(RVAR)
+foo.q : RVAR += rvar
+# Target-specific vars with multiple LHS pattern rules
+%.r %.s %.t: ; @echo $(QVAR) $(RVAR) $(SVAR) $(TVAR)
+foo.r : RVAR += rvar
+foo.t : TVAR := $(QVAR)
+EOF
+
+close(MAKEFILE);
+
+# TEST #1
+
+&run_make_with_options($makefile, "one two three", &get_logfile);
+$answer = "one bar\nfoo two\nBAR=1000\nfoo bar\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST #2
+
+&run_make_with_options($makefile, "one two FOO=1 BAR=2", &get_logfile);
+$answer = "one 2\n1 2\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST #3
+
+&run_make_with_options($makefile, "four", &get_logfile);
+$answer = "x ok ok\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST #4
+
+&run_make_with_options($makefile, "seven", &get_logfile);
+$answer = "eight: seven eight\nseven: seven seven\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST #5
+
+&run_make_with_options($makefile, "nine", &get_logfile);
+$answer = "wallace bar wallace bar\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST #6
+
+&run_make_with_options($makefile, "ten", &get_logfile);
+$answer = "one=two\none bar\n=\nfoo two\nten\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST #6
+
+&run_make_with_options($makefile, "foo.q bar.q", &get_logfile);
+$answer = "qvar = rvar\nqvar =\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST #7
+
+&run_make_with_options($makefile, "foo.t bar.s", &get_logfile);
+$answer = "qvar = qvar\nqvar =\n";
+&compare_output($answer,&get_logfile(1));
+
+
+1;
diff --git a/tests/scripts/features/varnesting b/tests/scripts/features/varnesting
new file mode 100644
index 0000000..15d5071
--- /dev/null
+++ b/tests/scripts/features/varnesting
@@ -0,0 +1,34 @@
+$description = "The following test creates a makefile to ...";
+
+$details = "";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "x = variable1\n"
+ ."variable2 := Hello\n"
+ ."y = \$(subst 1,2,\$(x))\n"
+ ."z = y\n"
+ ."a := \$(\$(\$(z)))\n"
+ ."all: \n"
+ ."\t\@echo \$(a)\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&run_make_with_options($makefile,"",&get_logfile);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "Hello\n";
+
+&compare_output($answer,&get_logfile(1));
+
+1;
+
+
+
+
+
+
diff --git a/tests/scripts/features/vpath b/tests/scripts/features/vpath
new file mode 100644
index 0000000..101a25d
--- /dev/null
+++ b/tests/scripts/features/vpath
@@ -0,0 +1,62 @@
+$description = "The following test creates a makefile to test the \n"
+ ."vpath directive which allows you to specify a search \n"
+ ."path for a particular class of filenames, those that\n"
+ ."match a particular pattern.";
+
+$details = "This tests the vpath directive by specifying search directories\n"
+ ."for one class of filenames with the form: vpath pattern directories"
+ ."\nIn this test, we specify the working directory for all files\n"
+ ."that end in c or h. We also test the variables $@ (which gives\n"
+ ."target name) and $^ (which is a list of all dependencies \n"
+ ."including the directories in which they were found). It also\n"
+ ."uses the function firstword used to extract just the first\n"
+ ."dependency from the entire list.";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "vpath %.c foo\n";
+print MAKEFILE "vpath %.c $workdir\n";
+print MAKEFILE "vpath %.h $workdir\n";
+print MAKEFILE "objects = main.o kbd.o commands.o display.o insert.o\n";
+print MAKEFILE "edit: \$(objects)\n";
+print MAKEFILE "\t\@echo cc -o \$@ \$^\n";
+print MAKEFILE "main.o : main.c defs.h\n";
+print MAKEFILE "\t\@echo cc -c \$(firstword \$^)\n";
+print MAKEFILE "kbd.o : kbd.c defs.h command.h\n";
+print MAKEFILE "\t\@echo cc -c kbd.c\n";
+print MAKEFILE "commands.o : command.c defs.h command.h\n";
+print MAKEFILE "\t\@echo cc -c commands.c\n";
+print MAKEFILE "display.o : display.c defs.h buffer.h\n";
+print MAKEFILE "\t\@echo cc -c display.c\n";
+print MAKEFILE "insert.o : insert.c defs.h buffer.h\n";
+print MAKEFILE "\t\@echo cc -c insert.c\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+
+@files_to_touch = ("$workdir${pathsep}main.c","$workdir${pathsep}defs.h",
+ "$workdir${pathsep}kbd.c","$workdir${pathsep}command.h",
+ "$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
+ "$workdir${pathsep}buffer.h","$workdir${pathsep}insert.c",
+ "$workdir${pathsep}command.c");
+
+&touch(@files_to_touch);
+
+&run_make_with_options($makefile,"",&get_logfile);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "cc -c $workdir${pathsep}main.c\ncc -c kbd.c\ncc -c commands.c\n"
+ ."cc -c display.c\n"
+ ."cc -c insert.c\ncc -o edit main.o kbd.o commands.o display.o "
+ ."insert.o\n";
+
+if (&compare_output($answer,&get_logfile(1)))
+{
+ unlink @files_to_touch;
+}
+
+1;
diff --git a/tests/scripts/features/vpath2 b/tests/scripts/features/vpath2
new file mode 100644
index 0000000..7e970a7
--- /dev/null
+++ b/tests/scripts/features/vpath2
@@ -0,0 +1,45 @@
+$description = "This is part 2 in a series to test the vpath directive\n"
+ ."It tests the three forms of the directive:\n"
+ ." vpath pattern directive\n"
+ ." vpath pattern (clears path associated with pattern)\n"
+ ." vpath (clears all paths specified with vpath)\n";
+
+$details = "This test simply adds many search paths using various vpath\n"
+ ."directive forms and clears them afterwards. It has a simple\n"
+ ."rule to print a message at the end to confirm that the makefile\n"
+ ."ran with no errors.\n";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "VPATH = $workdir:$sourcedir\n";
+print MAKEFILE "vpath %.c foo\n";
+print MAKEFILE "vpath %.c $workdir\n";
+print MAKEFILE "vpath %.c $sourcedir\n";
+print MAKEFILE "vpath %.h $workdir\n";
+print MAKEFILE "vpath %.c\n";
+print MAKEFILE "vpath\n";
+print MAKEFILE "all:\n";
+print MAKEFILE "\t\@echo ALL IS WELL\n";
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&run_make_with_options($makefile,"",&get_logfile);
+
+# Create the answer to what should be produced by this Makefile
+$answer = "ALL IS WELL\n";
+
+&compare_output($answer,&get_logfile(1));
+
+1;
+
+
+
+
+
+
+
+
+
diff --git a/tests/scripts/features/vpathgpath b/tests/scripts/features/vpathgpath
new file mode 100644
index 0000000..581d16d
--- /dev/null
+++ b/tests/scripts/features/vpathgpath
@@ -0,0 +1,64 @@
+# -*-perl-*-
+$description = "Tests VPATH+/GPATH functionality.";
+
+$details = "";
+
+$VP = "$workdir$pathsep";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "VPATH = $VP\n";
+
+print MAKEFILE <<'EOMAKE';
+
+GPATH = $(VPATH)
+
+.SUFFIXES: .a .b .c .d
+.PHONY: general rename notarget intermediate
+
+%.a:
+%.b:
+%.c:
+%.d:
+
+%.a : %.b ; cat $^ > $@
+%.b : %.c ; cat $^ > $@
+%.c :: %.d ; cat $^ > $@
+
+# General testing info:
+
+general: foo.b
+foo.b: foo.c bar.c
+
+EOMAKE
+
+close(MAKEFILE);
+
+@touchedfiles = ();
+
+sub touchfiles {
+ foreach (@_) {
+ ($f = $_) =~ s,VP/,$VP,g;
+ &touch($f);
+ push(@touchedfiles, $f);
+ sleep(1);
+ }
+}
+
+# Run the general-case test
+
+&touchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
+
+&run_make_with_options($makefile,"general",&get_logfile());
+
+push(@touchedfiles, "bar.c");
+
+$answer = "$make_name: Nothing to be done for `general'.\n";
+
+&compare_output($answer,&get_logfile(1));
+
+unlink(@touchedfiles) unless $keep;
+
+1;
diff --git a/tests/scripts/features/vpathplus b/tests/scripts/features/vpathplus
new file mode 100644
index 0000000..6c9a2a0
--- /dev/null
+++ b/tests/scripts/features/vpathplus
@@ -0,0 +1,125 @@
+# -*-perl-*-
+$description = "Tests the new VPATH+ functionality added in 3.76.";
+
+$details = "";
+
+$VP = "$workdir$pathsep";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "VPATH = $VP\n";
+
+print MAKEFILE <<'EOMAKE';
+
+SHELL = /bin/sh
+
+.SUFFIXES: .a .b .c .d
+.PHONY: general rename notarget intermediate
+
+%.a:
+%.b:
+%.c:
+%.d:
+
+%.a : %.b
+ cat $^ > $@
+%.b : %.c
+ cat $^ > $@ 2>/dev/null || exit 1
+%.c :: %.d
+ cat $^ > $@
+
+# General testing info:
+
+general: foo.b
+foo.b: foo.c bar.c
+
+# Rename testing info:
+
+rename: $(VPATH)/foo.c foo.d
+
+# Target not made testing info:
+
+notarget: notarget.b
+notarget.c: notarget.d
+ -@echo "not creating $@ from $^"
+
+# Intermediate files:
+
+intermediate: inter.a
+
+EOMAKE
+
+close(MAKEFILE);
+
+@touchedfiles = ();
+
+sub touchfiles {
+ foreach (@_) {
+ ($f = $_) =~ s,VP/,$VP,g;
+ &touch($f);
+ push(@touchedfiles, $f);
+ # Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
+ # granularity of file times.
+ sleep(2);
+ }
+}
+
+# Run the general-case test
+
+&touchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
+
+&run_make_with_options($makefile,"general",&get_logfile);
+
+push(@touchedfiles, "bar.c");
+
+$answer = "cat bar.d > bar.c
+cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
+";
+&compare_output($answer,&get_logfile(1));
+
+# Test rules that don't make the target correctly
+
+&touchfiles("VP/notarget.c", "notarget.b", "notarget.d");
+
+&run_make_with_options($makefile,"notarget",&get_logfile,512);
+
+$answer = "not creating notarget.c from notarget.d
+cat notarget.c > notarget.b 2>/dev/null || exit 1
+$make_name: *** [notarget.b] Error 1
+";
+
+&compare_output($answer,&get_logfile(1));
+
+# Test intermediate file handling (part 1)
+
+&touchfiles("VP/inter.d");
+
+&run_make_with_options($makefile,"intermediate",&get_logfile);
+
+push(@touchedfiles, "inter.a", "inter.b");
+
+$answer = "cat ${VP}inter.d > inter.c
+cat inter.c > inter.b 2>/dev/null || exit 1
+cat inter.b > inter.a
+rm inter.b inter.c
+";
+&compare_output($answer,&get_logfile(1));
+
+# Test intermediate file handling (part 2)
+
+&touchfiles("VP/inter.b", "VP/inter.d");
+
+&run_make_with_options($makefile,"intermediate",&get_logfile);
+
+$answer = "cat ${VP}inter.d > inter.c
+cat inter.c > inter.b 2>/dev/null || exit 1
+cat inter.b > inter.a
+rm inter.c
+";
+&compare_output($answer,&get_logfile(1));
+
+unlink @touchedfiles unless $keep;
+
+1;