summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/functions/addsuffix38
-rw-r--r--tests/scripts/options/general16
2 files changed, 25 insertions, 29 deletions
diff --git a/tests/scripts/functions/addsuffix b/tests/scripts/functions/addsuffix
index d150f07..da4fbb7 100644
--- a/tests/scripts/functions/addsuffix
+++ b/tests/scripts/functions/addsuffix
@@ -1,44 +1,36 @@
-$description = "The following test creates a makefile to test the addsuffix "
- ."function.";
+# -*-perl-*-
+$description = "Test the addsuffix function.";
$details = "";
-# IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
-# THE NAME OF THE MAKEFILE. THIS INSURES CONSISTENCY AND KEEPS TRACK OF
-# HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
-# EXAMPLE: $makefile2 = &get_tmpfile;
-
open(MAKEFILE,"> $makefile");
# The Contents of the MAKEFILE ...
-print MAKEFILE "string := \$(addsuffix .c,src${pathsep}a.b.z.foo hacks) \n"
- ."all: \n"
- ."\t\@echo \$(string) \n";
+print MAKEFILE <<EOMAKE;
+string := \$(addsuffix .c,src${pathsep}a.b.z.foo hacks)
+one: ; \@echo \$(string)
-# END of Contents of MAKEFILE
+two: ; \@echo \$(addsuffix foo,)
+EOMAKE
close(MAKEFILE);
-&run_make_with_options($makefile,"",&get_logfile,0);
-# Create the answer to what should be produced by this Makefile
+# TEST 0
+
+&run_make_with_options($makefile, "", &get_logfile);
$answer = "src${pathsep}a.b.z.foo.c hacks.c\n";
+&compare_output($answer,&get_logfile(1));
-# COMPARE RESULTS
-# In this call to compare output, you should use the call &get_logfile(1)
-# to send the name of the last logfile created. You may also use
-# the special call &get_logfile(1) which returns the same as &get_logfile(1).
+# TEST 1
+&run_make_with_options($makefile, "two", &get_logfile);
+$answer = "\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/options/general b/tests/scripts/options/general
index ec7149a..d35bb35 100644
--- a/tests/scripts/options/general
+++ b/tests/scripts/options/general
@@ -5,17 +5,21 @@ open(MAKEFILE, "> $makefile");
# The Contents of the MAKEFILE ...
-print MAKEFILE "foo 5foo: ; \@echo \$\@\n";
+print MAKEFILE "foo 1foo: ; \@echo \$\@\n";
close(MAKEFILE);
# TEST 0
-&run_make_with_options($makefile, "-j 5foo", &get_logfile);
-$answer = "5foo\n";
-&compare_output($answer, &get_logfile(1));
+&run_make_with_options($makefile, "-j 1foo", &get_logfile);
+if (!$parallel_jobs) {
+ $answer = "$make_name: Parallel jobs (-j) are not supported on this platform.\n$make_name: Resetting to single job (-j1) mode.\n1foo\n";
+}
+else {
+ $answer = "1foo\n";
+}
-# TEST 0
+# TEST 1
# This test prints the usage string; I don't really know a good way to
# test it. I guess I could invoke make with a known-bad option to see
@@ -24,7 +28,7 @@ $answer = "5foo\n";
# If I were always on UNIX, I could invoke it with 2>/dev/null, then
# just check the error code.
-&run_make_with_options($makefile, "-j5foo 2>/dev/null", &get_logfile, 512);
+&run_make_with_options($makefile, "-j1foo 2>/dev/null", &get_logfile, 512);
$answer = "";
&compare_output($answer, &get_logfile(1));