]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* tests/scripts/*: Switch TAB chars to #TAB# markup
authorPaul Smith <psmith@gnu.org>
Sun, 24 Aug 2025 18:29:11 +0000 (14:29 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 24 Aug 2025 18:29:11 +0000 (14:29 -0400)
Avoid Emacs local variable settings to disable whitespace cleanup,
by creating markup tokens for TAB characters (#TAB#) and space
characters (#SPACE#) (for end-of-line spaces).  Modify all the
tests that use TABs to use the new markup.  This requires changing
some old-fashioned tests to use the modern run_make_test().  Also
remove some of the comments regarding test numbers now that the
framework keeps track.

22 files changed:
tests/run_make_tests.pl
tests/scripts/features/comments
tests/scripts/features/conditionals
tests/scripts/features/order_only
tests/scripts/features/patspecific_vars
tests/scripts/features/statipattrules
tests/scripts/functions/andor
tests/scripts/functions/call
tests/scripts/functions/error
tests/scripts/functions/eval
tests/scripts/functions/sort
tests/scripts/functions/strip
tests/scripts/functions/warning
tests/scripts/misc/general3
tests/scripts/options/dash-B
tests/scripts/options/dash-W
tests/scripts/targets/ONESHELL
tests/scripts/variables/MAKE
tests/scripts/variables/MAKECMDGOALS
tests/scripts/variables/automatic
tests/scripts/variables/define
tests/scripts/variables/special

index 9565deac2fcbb7a12eefac86fbb03db1ea1090c6..4296e30285fefeff4d3e04b0c3e77db8deb34f91 100644 (file)
@@ -165,6 +165,8 @@ sub subst_make_string
     $makefile and s/#MAKEFILE#/$makefile/g;
     s/#MAKEPATH#/$mkpath/g;
     s/#MAKE#/$make_name/g;
+    s/#TAB#/\t/g;
+    s/#SPACE#/ /g;
     s/#PERL#/$perl_name/g;
     s/#PWD#/$wd/g;
     s/#HELPER#/$perl_name $helptool/g;
index a6458cd6bb081abf9d3576cf659301d80f29ecd0..7cb2c697f00e164aefd1598649f8ac2b745c344e 100644 (file)
@@ -1,3 +1,5 @@
+#                                                                    -*-perl-*-
+
 $description = "The following test creates a makefile to test comments\n"
               ."and comment continuation to the next line using a \n"
               ."backslash within makefiles.";
@@ -15,23 +17,18 @@ 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));
+run_make_test(q!
+# Test comment vs semicolon parsing and line continuation
+target: # this ; is just a comment \
+#TAB#@echo This is within a comment.#SPACE#
+#TAB#@echo There should be no errors for this makefile.
+!,
+              '', "There should be no errors for this makefile.\n");
 
 1;
index c8f142152598fe7d69e6716a60e7120d3431d382..7cef93089d90b2818818a4f90fade39e7ae4731c 100644 (file)
@@ -3,7 +3,7 @@ $description = "Check GNU Make conditionals.";
 
 $details = "Attempt various different flavors of GNU Make conditionals.";
 
-run_make_test('
+run_make_test(q!
 arg1 = first
 arg2 = second
 arg3 = third
@@ -12,33 +12,33 @@ arg5 = second
 
 all:
 ifeq ($(arg1),$(arg2))
-       @echo arg1 equals arg2
+#TAB#@echo arg1 equals arg2
 else
-       @echo arg1 NOT equal arg2
+#TAB#@echo arg1 NOT equal arg2
 endif
 
-ifeq \'$(arg2)\' "$(arg5)"
-       @echo arg2 equals arg5
+ifeq '$(arg2)' "$(arg5)"
+#TAB#@echo arg2 equals arg5
 else
-       @echo arg2 NOT equal arg5
+#TAB#@echo arg2 NOT equal arg5
 endif
 
-ifneq \'$(arg3)\' \'$(arg4)\'
-       @echo arg3 NOT equal arg4
+ifneq '$(arg3)' '$(arg4)'
+#TAB#@echo arg3 NOT equal arg4
 else
-       @echo arg3 equal arg4
+#TAB#@echo arg3 equal arg4
 endif
 
 ifndef undefined
-       @echo variable is undefined
+#TAB#@echo variable is undefined
 else
-       @echo variable undefined is defined
+#TAB#@echo variable undefined is defined
 endif
 ifdef arg4
-       @echo arg4 is defined
+#TAB#@echo arg4 is defined
 else
-       @echo arg4 is NOT defined
-endif',
+#TAB#@echo arg4 is NOT defined
+endif!,
               '',
               'arg1 NOT equal arg2
 arg2 equals arg5
@@ -49,7 +49,7 @@ arg4 is defined');
 
 # Test expansion of variables inside ifdef.
 
-run_make_test('
+run_make_test(q!
 foo = 1
 
 FOO = foo
@@ -73,14 +73,14 @@ ifdef $(call FUNC,DEF)3
   DEF3 = yes
 endif
 
-all:; @echo DEF=$(DEF) DEF2=$(DEF2) DEF3=$(DEF3)',
+all:; @echo DEF=$(DEF) DEF2=$(DEF2) DEF3=$(DEF3)!,
               '',
               'DEF=yes DEF2=yes DEF3=yes');
 
 
 # Test all the different "else if..." constructs
 
-run_make_test('
+run_make_test(q!
 arg1 = first
 arg2 = second
 arg3 = third
@@ -91,9 +91,9 @@ result =
 
 ifeq ($(arg1),$(arg2))
   result += arg1 equals arg2
-else ifeq \'$(arg2)\' "$(arg5)"
+else ifeq '$(arg2)' "$(arg5)"
   result += arg2 equals arg5
-else ifneq \'$(arg3)\' \'$(arg3)\'
+else ifneq '$(arg3)' '$(arg3)'
   result += arg3 NOT equal arg4
 else ifndef arg5
   result += variable is undefined
@@ -104,14 +104,14 @@ else
 endif
 
 
-all: ; @echo $(result)',
+all: ; @echo $(result)!,
               '',
               'success');
 
 
 # Test some random "else if..." construct nesting
 
-run_make_test('
+run_make_test(q!
 arg1 = first
 arg2 = second
 arg3 = third
@@ -120,13 +120,13 @@ arg5 = second
 
 ifeq ($(arg1),$(arg2))
   $(info failed 1)
-else ifeq \'$(arg2)\' "$(arg2)"
+else ifeq '$(arg2)' "$(arg2)"
   ifdef undefined
     $(info failed 2)
   else
     $(info success)
   endif
-else ifneq \'$(arg3)\' \'$(arg3)\'
+else ifneq '$(arg3)' '$(arg3)'
   $(info failed 3)
 else ifdef arg5
   $(info failed 4)
@@ -137,20 +137,20 @@ else
 endif
 
 .PHONY: all
-all: ; @:',
+all: ; @:!,
               '',
               'success');
 
 # SV 47960 : ensure variable assignments in non-taken legs don't cause problems
-run_make_test('
+run_make_test(q!
 ifneq ($(FOO),yes)
 target:
 else
 BAR = bar
 target:
 endif
-       @echo one
-',
+#TAB#@echo one
+!,
               '', "one\n");
 
 # SV 64085: Ensure recipe prefixed conditionals are never considered
@@ -158,7 +158,7 @@ run_make_test(q!
 blah=1
 ifdef blah
 else
-       else
+#TAB#else
 endif
 all:;
 !,
@@ -168,7 +168,7 @@ run_make_test(q!
 blah=1
 ifdef blah
 else
-       endif
+#TAB#endif
 endif
 all:;
 !,
@@ -178,7 +178,7 @@ run_make_test(q!
 blah=1
 ifdef blah
 else
-       ifdef blah
+#TAB#ifdef blah
 endif
 all:;
 !,
@@ -189,7 +189,7 @@ blah=1
 all:;
 foo:
 ifdef blah
-       ifdef blah
+#TAB#ifdef blah
 endif
 !,
     '', "#MAKE#: 'all' is up to date.");
@@ -199,7 +199,7 @@ blah=1
 all:;
 foo:
 ifdef blah
-       endif
+#TAB#endif
 endif
 !,
     '', "#MAKE#: 'all' is up to date.");
@@ -209,7 +209,7 @@ blah=1
 all:;
 foo:
 ifdef blah
-       else
+#TAB#else
 else
 endif
 !,
@@ -255,7 +255,3 @@ all:;
 
 # This tells the test driver that the perl test script executed properly.
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index 4ebdc2b8da86168567ab435b71e8c09c9a90375d..a6b877d05278fd0ebbc70e69d5303a2390a94570 100644 (file)
@@ -5,7 +5,7 @@ $details = "\
 Create makefiles with various combinations of normal and order-only
 prerequisites and ensure they behave properly.  Test the \$| variable.";
 
-# TEST #0 -- Basics
+# Basics
 
 run_make_test('
 %r: | baz ; @echo $< $^ $|
@@ -14,45 +14,45 @@ foo:;@:
 baz:;@:',
               '', "foo foo baz\n");
 
-# TEST #1 -- First try: the order-only prereqs need to be built.
+# First try: the order-only prereqs need to be built.
 
 run_make_test(q!
 foo: bar | baz
-       @echo '$$^ = $^'
-       @echo '$$| = $|'
-       touch $@
+#TAB#@echo '$$^ = $^'
+#TAB#@echo '$$| = $|'
+#TAB#touch $@
 
 .PHONY: baz
 
 bar baz:
-       touch $@!,
+#TAB#touch $@!,
               '', "touch bar\ntouch baz\n\$^ = bar\n\$| = baz\ntouch foo\n");
 
 
-# TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated
+# now we do it again: baz is PHONY but foo should _NOT_ be updated
 
 run_make_test(undef, '', "touch baz\n");
 
 unlink(qw(foo bar baz));
 
-# TEST #3 -- Make sure the order-only prereq was promoted to normal.
+# Make sure the order-only prereq was promoted to normal.
 
 run_make_test(q!
 foo: bar | baz
-       @echo '$$^ = $^'
-       @echo '$$| = $|'
-       touch $@
+#TAB#@echo '$$^ = $^'
+#TAB#@echo '$$| = $|'
+#TAB#touch $@
 
 foo: baz
 
 .PHONY: baz
 
 bar baz:
-       touch $@!,
+#TAB#touch $@!,
               '', "touch bar\ntouch baz\n\$^ = bar baz\n\$| = \ntouch foo\n");
 
 
-# TEST #4 -- now we do it again
+# now we do it again
 
 run_make_test(undef, '', "touch baz\n\$^ = bar baz\n\$| = \ntouch foo\n");
 
@@ -60,21 +60,21 @@ unlink(qw(foo bar baz));
 
 # Test empty normal prereqs
 
-# TEST #5 -- make sure the parser was correct.
+# make sure the parser was correct.
 
 run_make_test(q!
 foo:| baz
-       @echo '$$^ = $^'
-       @echo '$$| = $|'
-       touch $@
+#TAB#@echo '$$^ = $^'
+#TAB#@echo '$$| = $|'
+#TAB#touch $@
 
 .PHONY: baz
 
 baz:
-       touch $@!,
+#TAB#touch $@!,
               '', "touch baz\n\$^ = \n\$| = baz\ntouch foo\n");
 
-# TEST #6 -- now we do it again: this time foo won't be built
+# now we do it again: this time foo won't be built
 
 run_make_test(undef, '', "touch baz\n");
 
@@ -82,29 +82,29 @@ unlink(qw(foo baz));
 
 # Test order-only in pattern rules
 
-# TEST #7 -- make sure the parser was correct.
+# make sure the parser was correct.
 
 run_make_test(q!
 %.w : %.x | baz
-       @echo '$$^ = $^'
-       @echo '$$| = $|'
-       touch $@
+#TAB#@echo '$$^ = $^'
+#TAB#@echo '$$| = $|'
+#TAB#touch $@
 
 all: foo.w
 
 .PHONY: baz
 foo.x baz:
-       touch $@!,
+#TAB#touch $@!,
               '',
               "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n");
 
-# TEST #8 -- now we do it again: this time foo.w won't be built
+# now we do it again: this time foo.w won't be built
 
 run_make_test(undef, '', "touch baz\n");
 
 unlink(qw(foo.w foo.x baz));
 
-# TEST #9 -- make sure that $< is set correctly in the face of order-only
+# make sure that $< is set correctly in the face of order-only
 # prerequisites in pattern rules.
 
 run_make_test('
index a530bba10ac33c3a83dae0fc07bdb6bcbd0e58c9..a7c3c3bc25d70af107c2305e8a49bbbae2ec12bc 100644 (file)
@@ -6,10 +6,9 @@ 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");
+# basics
 
-print MAKEFILE <<'EOF';
-all: one.x two.x three.x
+run_make_test(q!all: one.x two.x three.x
 FOO = foo
 BAR = bar
 BAZ = baz
@@ -29,50 +28,34 @@ a%: BBB += ddd
 %b: AAA += bbb
 .PHONY: ab
 ab: ; @echo $(AAA); echo $(BBB)
-EOF
+!,
+              "", "one.x: one two baz\ntwo.x: foo four baz\nthree.x: foo four three\n");
 
-close(MAKEFILE);
+# try the override feature
 
+run_make_test(undef, "BAZ=five",
+              "one.x: one two five\ntwo.x: foo four five\nthree.x: foo four three\n");
 
-# TEST #1 -- basics
+# make sure patterns are inherited properly
 
-&run_make_with_options($makefile, "", &get_logfile);
-$answer = "one.x: one two baz\ntwo.x: foo four baz\nthree.x: foo four three\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "four.x",
+              "baz: foo two baz\nfour.x: foo two baz\n");
 
+# test multiple patterns matching the same target
 
-# TEST #2 -- try the override feature
+run_make_test(undef, "ab", "aaa bbb\nccc ddd\n");
 
-&run_make_with_options($makefile, "BAZ=five", &get_logfile);
-$answer = "one.x: one two five\ntwo.x: foo four five\nthree.x: foo four three\n";
-&compare_output($answer,&get_logfile(1));
+# test pattern-specific exported variables
 
-
-# TEST #3 -- make sure patterns are inherited properly
-
-&run_make_with_options($makefile, "four.x", &get_logfile);
-$answer = "baz: foo two baz\nfour.x: foo two baz\n";
-&compare_output($answer,&get_logfile(1));
-
-
-# TEST #4 -- test multiple patterns matching the same target
-
-&run_make_with_options($makefile, "ab", &get_logfile);
-$answer = "aaa bbb\nccc ddd\n";
-&compare_output($answer,&get_logfile(1));
-
-# TEST #5 -- test pattern-specific exported variables
-#
 run_make_test('
 /%: export foo := foo
 
 /bar:
-       @echo $(foo) $$foo
+#TAB#@echo $(foo) $$foo
 ', '', 'foo foo');
 
+# test expansion of pattern-specific simple variables
 
-# TEST #6 -- test expansion of pattern-specific simple variables
-#
 run_make_test('
 .PHONY: all
 
@@ -112,15 +95,14 @@ global := new $$t
 'normal: global: original $t pattern:  inherit: ;
 pattern: global: original $t pattern:  inherit: ;');
 
+# test expansion of pattern-specific recursive variables
 
-# TEST #7 -- test expansion of pattern-specific recursive variables
-#
 run_make_test(undef, # reuse previous makefile
 'rec=1',
 'normal: global: new $t pattern: good $t inherit: good $t;
 pattern: global: new $t pattern: good $t inherit: good $t;');
 
-# TEST #8: override in pattern-specific variables
+# override in pattern-specific variables
 
 run_make_test('
 a%: override FOO += f1
@@ -131,7 +113,7 @@ ab: ; @echo "$(FOO)"
 
 run_make_test(undef, 'FOO=C', "C f1\n");
 
-# TEST #9: Test shortest stem selection in pattern-specific variables.
+# Test shortest stem selection in pattern-specific variables.
 
 run_make_test('
 %-mt.x: x := two
index e3b00acb099ee49dfdbf6962403efcd0d3c57eae..a3276594da3b58b9c03ea9e6ac42e9ef7734a41d 100644 (file)
@@ -79,8 +79,8 @@ all.foo.bar: %.foo.bar: %.one
 all.foo.bar: %.bar: %.two
 
 all.foo.bar:
->      @echo $*
->      @echo $^
+>#TAB#@echo $*
+>#TAB#@echo $^
 
 .DEFAULT:;@:
 ',
@@ -102,8 +102,8 @@ all.foo.bar: %.foo.bar: %.one $$*-one
 all.foo.bar: %.bar: %.two $$*-two
 
 all.foo.bar:
->      @echo $*
->      @echo $^
+>#TAB#@echo $*
+>#TAB#@echo $^
 
 .DEFAULT:;@:
 ',
index 62e0c2e02273f9cfa75b9a44919411842ab938f2..806358b404dbd2b5fd51bb1c41c5214ffc378f10 100644 (file)
@@ -12,16 +12,16 @@ f =
 t = true
 
 all:
-       @echo 1 $(and    ,$t)
-       @echo 2 $(and $t)
-       @echo 3 $(and $t,)
-       @echo 4 $(and z,true,$f,false)
-       @echo 5 $(and $t,$f,$(info bad short-circuit))
-       @echo 6 $(and $(call NEQ,a,b),true)
-       @echo 7 $(and $(call NEQ,a,a),true)
-       @echo 8 $(and z,true,fal,se) hi
-       @echo 9 $(and ,true,fal,se)there
-       @echo 10 $(and   $(e) ,$t)',
+#TAB#@echo 1 $(and    ,$t)
+#TAB#@echo 2 $(and $t)
+#TAB#@echo 3 $(and $t,)
+#TAB#@echo 4 $(and z,true,$f,false)
+#TAB#@echo 5 $(and $t,$f,$(info bad short-circuit))
+#TAB#@echo 6 $(and $(call NEQ,a,b),true)
+#TAB#@echo 7 $(and $(call NEQ,a,a),true)
+#TAB#@echo 8 $(and z,true,fal,se) hi
+#TAB#@echo 9 $(and ,true,fal,se)there
+#TAB#@echo 10 $(and   $(e) ,$t)',
               '',
               "1\n2 true\n3\n4\n5\n6 true\n7\n8 se hi\n9 there\n10\n");
 
@@ -33,17 +33,17 @@ f =
 t = true
 
 all:
-       @echo 1 $(or    ,    )
-       @echo 2 $(or $t)
-       @echo 3 $(or ,$t)
-       @echo 4 $(or z,true,$f,false)
-       @echo 5 $(or $t,$(info bad short-circuit))
-       @echo 6 $(or $(info short-circuit),$t)
-       @echo 7 $(or $(call NEQ,a,b),true)
-       @echo 8 $(or $(call NEQ,a,a),true)
-       @echo 9 $(or z,true,fal,se) hi
-       @echo 10 $(or ,true,fal,se)there
-       @echo 11 $(or   $(e) ,$f)',
+#TAB#@echo 1 $(or    ,    )
+#TAB#@echo 2 $(or $t)
+#TAB#@echo 3 $(or ,$t)
+#TAB#@echo 4 $(or z,true,$f,false)
+#TAB#@echo 5 $(or $t,$(info bad short-circuit))
+#TAB#@echo 6 $(or $(info short-circuit),$t)
+#TAB#@echo 7 $(or $(call NEQ,a,b),true)
+#TAB#@echo 8 $(or $(call NEQ,a,a),true)
+#TAB#@echo 9 $(or z,true,fal,se) hi
+#TAB#@echo 10 $(or ,true,fal,se)there
+#TAB#@echo 11 $(or   $(e) ,$f)',
               '',
               "short-circuit\n1\n2 true\n3 true\n4 z\n5 true\n6 true\n7 b\n8 true\n9 z hi\n10 truethere\n11\n");
 
index dc1a6233d35e35e4ae4a01b22ad2c8fc56386fd0..3591524b49dbe6adf32ce6620f851f7ab38a90a8 100644 (file)
@@ -35,7 +35,7 @@ DEP_foo = bar baz quux
 DEP_baz = quux blarp
 rest = $(wordlist 2,$(words ${1}),${1})
 tclose = $(if $1,$(firstword $1)\
-               $(call tclose,$(sort ${DEP_$(firstword $1)} $(call rest,$1))))
+#TAB##TAB#$(call tclose,$(sort ${DEP_$(firstword $1)} $(call rest,$1))))
 
 all: ; @echo '$(call reverse,bar,foo)'; \
         echo '$(call map,origin,MAKE reverse map)'; \
@@ -44,7 +44,7 @@ all: ; @echo '$(call reverse,bar,foo)'; \
         echo '$(call my-foreach,a,,,)'; \
         echo '$(call my-if,a,b,c)'; \
         echo '$(call two,bar,baz)'; \
-       echo '$(call tclose,foo)';
+#TAB#echo '$(call tclose,foo)';
 !,
               "", "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\nfoo bar baz blarp quux \n");
 
@@ -67,10 +67,10 @@ level2 = $(call level1,$1,$2,$3)
 level3 = $(call level2,$1,$2,$3,$4,$5)
 
 all:
-       @echo $(call all,1,2,3,4,5,6,7,8,9,10,11)
-       @echo $(call level1,1,2,3,4,5,6,7,8)
-       @echo $(call level2,1,2,3,4,5,6,7,8)
-       @echo $(call level3,1,2,3,4,5,6,7,8)
+#TAB#@echo $(call all,1,2,3,4,5,6,7,8,9,10,11)
+#TAB#@echo $(call level1,1,2,3,4,5,6,7,8)
+#TAB#@echo $(call level2,1,2,3,4,5,6,7,8)
+#TAB#@echo $(call level3,1,2,3,4,5,6,7,8)
 !,
               "", "1 2 3 4 5 6 7 8 9\n1 2 3 4 5\n1 2 3\n1 2 3\n");
 
@@ -78,15 +78,11 @@ all:
 
 delete $ENV{X123};
 
-run_make_test('
+run_make_test(q!
 tst = $(eval export X123)
 $(call tst)
 all: ; @echo "$${X123-not set}"
-',
+!,
               '', "\n");
 
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index 998afe481476aa02902897df9e45e188846443eb..bb97dbf388aff38ea75180ac1d9519f6959b86c3 100644 (file)
@@ -5,9 +5,9 @@ The following test creates a makefile to test the error function.";
 
 $details = "";
 
-open(MAKEFILE,"> $makefile");
+# Test #1
 
-print MAKEFILE 'err = $(error Error found!)
+run_make_test(q!err = $(error Error found)
 
 ifdef ERROR1
 $(error error is $(ERROR1))
@@ -23,49 +23,33 @@ endif
 
 ifdef ERROR4
 all: some; @echo error is $(ERROR4)
-       @echo $(error error is $(ERROR4))
+#TAB#@echo $(error error is $(ERROR4))
 endif
 
 some: ; @echo Some stuff
 
 testvar: ; @: $(err)
-';
-
-close(MAKEFILE);
-
-# Test #1
-
-&run_make_with_options($makefile, "ERROR1=yes", &get_logfile, 512);
-$answer = "$makefile:4: *** error is yes.  Stop.\n";
-&compare_output($answer,&get_logfile(1));
+!,
+              "ERROR1=yes", "#MAKEFILE#:4: *** error is yes.  Stop.\n", 512);
 
 # Test #2
 
-&run_make_with_options($makefile, "ERROR2=no", &get_logfile, 512);
-$answer = "$makefile:8: *** error is no.  Stop.\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "ERROR2=no", "#MAKEFILE#:8: *** error is no.  Stop.\n", 512);
 
 # Test #3
 
-&run_make_with_options($makefile, "ERROR3=maybe", &get_logfile, 512);
-$answer = "Some stuff\n$makefile:12: *** error is maybe.  Stop.\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "ERROR3=maybe",
+              "Some stuff\n#MAKEFILE#:12: *** error is maybe.  Stop.\n", 512);
 
 # Test #4
 
-&run_make_with_options($makefile, "ERROR4=definitely", &get_logfile, 512);
-$answer = "Some stuff\n$makefile:17: *** error is definitely.  Stop.\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "ERROR4=definitely",
+              "Some stuff\n#MAKEFILE#:17: *** error is definitely.  Stop.\n", 512);
 
 # Test #5
 
-&run_make_with_options($makefile, "testvar", &get_logfile, 512);
-$answer = "$makefile:22: *** Error found!.  Stop.\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "testvar",
+              "#MAKEFILE#:22: *** Error found.  Stop.\n", 512);
 
 # This tells the test driver that the perl test script executed properly.
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index 4a432fe7a360197626ea1345d5fc7ff5462e9e8d..b5a1906300663a3f4ec97c1b18c32964158ca801 100644 (file)
@@ -150,7 +150,7 @@ $(eval $(FOO))
 run_make_test('
 define FOO
 all: ; @echo '."'".'he\llo'."'".'
-       @echo world
+#TAB#@echo world
 endef
 $(eval $(FOO))
 ', '', 'he\llo
index e6e1343d7ce5b16edfcbe8e1d76184b1d8d6bc69..724f6f0f6ff3d079d1038e7fef2cfff9b4b20cf5 100644 (file)
@@ -12,24 +12,24 @@ remove all duplicates\n";
 run_make_test('
 foo := moon_light days
 foo1:= jazz
-bar := captured 
-bar2 = boy end, has rise A midnight 
+bar := captured#SPACE#
+bar2 = boy end, has rise A midnight#SPACE#
 bar3:= $(foo)
 s1  := _by
 s2  := _and_a
 t1  := $(addsuffix $(s1), $(bar) )
 t2  := $(addsuffix $(s2), $(foo1) )
-t3  := $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) 
-t4  := $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) 
-t5  := $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) 
-t6  := $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) 
-t7  := $(t6) $(t6) $(t6) 
+t3  := $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2) $(t2)#SPACE#
+t4  := $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3) $(t3)#SPACE#
+t5  := $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4) $(t4)#SPACE#
+t6  := $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5) $(t5)#SPACE#
+t7  := $(t6) $(t6) $(t6)#SPACE#
 p1  := $(addprefix $(foo1), $(s2) )
-blank:= 
+blank:=#SPACE#
 all:
-       @echo $(sort $(bar2) $(foo)  $(addsuffix $(s1), $(bar) ) $(t2) $(bar2) $(bar3))
-       @echo $(sort $(blank) $(foo) $(bar2) $(t1) $(p1) )
-       @echo $(sort $(foo) $(bar2) $(t1) $(t4) $(t5) $(t7) $(t6) )
+#TAB#@echo $(sort $(bar2) $(foo)  $(addsuffix $(s1), $(bar) ) $(t2) $(bar2) $(bar3))
+#TAB#@echo $(sort $(blank) $(foo) $(bar2) $(t1) $(p1) )
+#TAB#@echo $(sort $(foo) $(bar2) $(t1) $(t4) $(t5) $(t7) $(t6) )
 ',
               '', 'A boy captured_by days end, has jazz_and_a midnight moon_light rise
 A boy captured_by days end, has jazz_and_a midnight moon_light rise
@@ -45,7 +45,3 @@ all: ; \@echo \$(words \$(sort \$(FOO)))\n",
               '', "6\n");
 
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index 8222433f315eef7eba6524033e21af51b6e3b74e..f7987ef4084cec6a6d4b47c2cc7f6e6c16053461 100644 (file)
@@ -7,18 +7,14 @@ $details = "The make file is built with a list of objects that contain white spa
 These are then run through the strip command to remove it. This is then
 verified by echoing the result.\n";
 
-open(MAKEFILE,"> $makefile");
-
-# The Contents of the MAKEFILE ...
-
-print MAKEFILE <<'EOMAKE';
-TEST1 := "Is this TERMINAL fun?                                                               What makes you believe is this terminal fun?                                                                                                                                               JAPAN is a WONDERFUL planet -- I wonder if we will ever reach                                         their level of COMPARATIVE SHOPPING..."
+# Zippy the Pinhead quotes...
+run_make_test(q!TEST1 := "Is this TERMINAL fun?                                                               What makes you believe is this terminal fun?                                                                                                                                               JAPAN is a WONDERFUL planet -- I wonder if we will ever reach                                         their level of COMPARATIVE SHOPPING..."
 E :=
-TEST2 := $E   try this     and         this            $E
+TEST2 := $E   try this     and#TAB##TAB#this     #TAB#$E
 
 define TEST3
 
-and these              test out
+and these#TAB#        test out
 
 
 some
@@ -30,28 +26,18 @@ endef
 
 .PHONY: all
 all:
-       @echo '$(strip  $(TEST1) )'
-       @echo '$(strip  $(TEST2) )'
-       @echo '$(strip  $(TEST3) )'
-
-space: ; @echo '$(strip ) $(strip         )'
-
-EOMAKE
-
-# END of Contents of MAKEFILE
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile,"",&get_logfile);
-$answer = "\"Is this TERMINAL fun? What makes you believe is this terminal fun? JAPAN is a WONDERFUL planet -- I wonder if we will ever reach their level of COMPARATIVE SHOPPING...\"
+#TAB#@echo '$(strip  $(TEST1) )'
+#TAB#@echo '$(strip  $(TEST2) )'
+#TAB#@echo '$(strip  $(TEST3) )'
+!,
+              "", "\"Is this TERMINAL fun? What makes you believe is this terminal fun? JAPAN is a WONDERFUL planet -- I wonder if we will ever reach their level of COMPARATIVE SHOPPING...\"
 try this and this
 and these test out some blank lines
-";
-&compare_output($answer,&get_logfile(1));
-
+");
 
-&run_make_with_options($makefile,"space",&get_logfile);
-$answer = " \n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(q!
+space: ; @echo '$(strip ) $(strip  #TAB#   )'
+!,
+              "", " \n");
 
 1;
index 16eb83bb457fc3e1af1b50e1ef625611d4c1f233..57db2583ecf9ff2b37389ab998522f0b618f1baf 100644 (file)
@@ -5,10 +5,7 @@ The following test creates a makefile to test the warning function.";
 
 $details = "";
 
-open(MAKEFILE,"> $makefile");
-
-print MAKEFILE <<'EOF';
-ifdef WARNING1
+run_make_test(q!ifdef WARNING1
 $(warning warning is $(WARNING1))
 endif
 
@@ -22,51 +19,34 @@ endif
 
 ifdef WARNING4
 all: some; @echo hi
-       @echo there $(warning warning is $(WARNING4))
+#TAB#@echo there $(warning warning is $(WARNING4))
 endif
 
 some: ; @echo Some stuff
+!,
+              "WARNING1=yes", "#MAKEFILE#:2: warning is yes\nSome stuff\n");
 
-EOF
-
-close(MAKEFILE);
-
-# Test #1
-
-&run_make_with_options($makefile, "WARNING1=yes", &get_logfile, 0);
-$answer = "$makefile:2: warning is yes\nSome stuff\n";
-&compare_output($answer,&get_logfile(1));
-
-# Test #2
-
-&run_make_with_options($makefile, "WARNING2=no", &get_logfile, 0);
-$answer = "$makefile:6: warning is no\nSome stuff\n";
-&compare_output($answer,&get_logfile(1));
-
-# Test #3
-
-&run_make_with_options($makefile, "WARNING3=maybe", &get_logfile, 0);
-$answer = "Some stuff\n$makefile:10: warning is maybe\nhi\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "WARNING2=no",
+              "#MAKEFILE#:6: warning is no\nSome stuff\n");
 
-# Test #4
+run_make_test(undef, "WARNING3=maybe",
+              "Some stuff\n#MAKEFILE#:10: warning is maybe\nhi\n");
 
-&run_make_with_options($makefile, "WARNING4=definitely", &get_logfile, 0);
-$answer = "Some stuff\n$makefile:15: warning is definitely\nhi\nthere\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "WARNING4=definitely",
+              "Some stuff\n#MAKEFILE#:15: warning is definitely\nhi\nthere\n");
 
 # Test linenumber offset
 
 run_make_test(q!
 all: one two
-       $(warning in $@ line 3)
-       @true
-       $(warning in $@ line 5)
+#TAB#$(warning in $@ line 3)
+#TAB#@true
+#TAB#$(warning in $@ line 5)
 
 one two:
-       $(warning in $@ line 8)
-       @true
-       $(warning in $@ line 10)
+#TAB#$(warning in $@ line 8)
+#TAB#@true
+#TAB#$(warning in $@ line 10)
 !,
               '', "#MAKEFILE#:8: in one line 8
 #MAKEFILE#:10: in one line 10
@@ -77,7 +57,3 @@ one two:
 
 # This tells the test driver that the perl test script executed properly.
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index 455027aa0dcb32131c41ea31de24cc752896e009..448528514409ae2ee05e6e43d243d113230b04d8 100644 (file)
@@ -5,7 +5,7 @@ This tests random features of the parser that need to be supported, and
 which have either broken at some point in the past or seem likely to
 break.";
 
-run_make_test("
+run_make_test(q!
 # We want to allow both empty commands _and_ commands that resolve to empty.
 EMPTY =
 
@@ -14,18 +14,18 @@ all: a1 a2 a3 a4
 
 a1:;
 a2:
-\t
-a3:;\$(EMPTY)
+#TAB#
+a3:;$(EMPTY)
 a4:
-\t\$(EMPTY)
+#TAB#$(EMPTY)
 
-\# Non-empty lines that expand to nothing should also be ignored.
-STR =     \# Some spaces
-TAB =   \t  \# A TAB and some spaces
+# Non-empty lines that expand to nothing should also be ignored.
+STR =     # Some spaces
+TAB =   #TAB#  # A TAB and some spaces
 
-\$(STR)
+$(STR)
 
-\$(STR) \$(TAB)",
+$(STR) $(TAB)!,
               '', "#MAKE#: Nothing to be done for 'all'.");
 
 # TEST 2
@@ -47,10 +47,10 @@ $answer = "FOO = foo\n";
 
 # Check semicolons in variable references
 
-run_make_test('
+run_make_test(q!
 $(if true,$(info true; true))
 all: ; @:
-',
+!,
               '', 'true; true');
 
 # TEST 4
@@ -59,25 +59,25 @@ all: ; @:
 # Checks Savannah bug # 1332.
 
 # Test the fastpath / no quotes
-run_make_test('
+run_make_test(q!
 all:
-       @echo foo\
+#TAB#@echo foo\
 bar
-       @echo foo\
-       bar
-       @echo foo\
+#TAB#@echo foo\
+#TAB#bar
+#TAB#@echo foo\
     bar
-       @echo foo\
-           bar
-       @echo foo \
+#TAB#@echo foo\
+#TAB#    bar
+#TAB#@echo foo \
 bar
-       @echo foo \
-       bar
-       @echo foo \
+#TAB#@echo foo \
+#TAB#bar
+#TAB#@echo foo \
     bar
-       @echo foo \
-           bar
-',
+#TAB#@echo foo \
+#TAB#    bar
+!,
               '', 'foobar
 foobar
 foo bar
@@ -92,22 +92,22 @@ foo bar');
 if ($port_type ne 'W32') {
     run_make_test(q!
 all:
-       @echo 'foo\
+#TAB#@echo 'foo\
 bar'
-       @echo 'foo\
-       bar'
-       @echo 'foo\
+#TAB#@echo 'foo\
+#TAB#bar'
+#TAB#@echo 'foo\
     bar'
-       @echo 'foo\
-           bar'
-       @echo 'foo \
+#TAB#@echo 'foo\
+#TAB#    bar'
+#TAB#@echo 'foo \
 bar'
-       @echo 'foo \
-       bar'
-       @echo 'foo \
+#TAB#@echo 'foo \
+#TAB#bar'
+#TAB#@echo 'foo \
     bar'
-       @echo 'foo \
-           bar'
+#TAB#@echo 'foo \
+#TAB#    bar'
 !,
               '', 'foo\
 bar
@@ -128,25 +128,25 @@ foo \
 }
 
 # Test the fastpath / double quotes
-run_make_test('
+run_make_test(q!
 all:
-       @echo "foo\
+#TAB#@echo "foo\
 bar"
-       @echo "foo\
-       bar"
-       @echo "foo\
+#TAB#@echo "foo\
+#TAB#bar"
+#TAB#@echo "foo\
     bar"
-       @echo "foo\
-           bar"
-       @echo "foo \
+#TAB#@echo "foo\
+#TAB#    bar"
+#TAB#@echo "foo \
 bar"
-       @echo "foo \
-       bar"
-       @echo "foo \
+#TAB#@echo "foo \
+#TAB#bar"
+#TAB#@echo "foo \
     bar"
-       @echo "foo \
-           bar"
-',
+#TAB#@echo "foo \
+#TAB#    bar"
+!,
               '', 'foobar
 foobar
 foo    bar
@@ -157,25 +157,25 @@ foo     bar
 foo     bar');
 
 # Test the slow path / no quotes
-run_make_test('
+run_make_test(q!
 all:
-       @echo hi; echo foo\
+#TAB#@echo hi; echo foo\
 bar
-       @echo hi; echo foo\
-       bar
-       @echo hi; echo foo\
+#TAB#@echo hi; echo foo\
+#TAB#bar
+#TAB#@echo hi; echo foo\
  bar
-       @echo hi; echo foo\
-        bar
-       @echo hi; echo foo \
+#TAB#@echo hi; echo foo\
+#TAB# bar
+#TAB#@echo hi; echo foo \
 bar
-       @echo hi; echo foo \
-       bar
-       @echo hi; echo foo \
+#TAB#@echo hi; echo foo \
+#TAB#bar
+#TAB#@echo hi; echo foo \
  bar
-       @echo hi; echo foo \
-        bar
-',
+#TAB#@echo hi; echo foo \
+#TAB# bar
+!,
               '', 'hi
 foobar
 hi
@@ -195,25 +195,25 @@ foo bar');
 
 # Test the slow path / no quotes.  This time we put the slow path
 # determination _after_ the backslash-newline handling.
-run_make_test('
+run_make_test(q!
 all:
-       @echo foo\
+#TAB#@echo foo\
 bar; echo hi
-       @echo foo\
-       bar; echo hi
-       @echo foo\
+#TAB#@echo foo\
+#TAB#bar; echo hi
+#TAB#@echo foo\
  bar; echo hi
-       @echo foo\
-        bar; echo hi
-       @echo foo \
+#TAB#@echo foo\
+#TAB# bar; echo hi
+#TAB#@echo foo \
 bar; echo hi
-       @echo foo \
-       bar; echo hi
-       @echo foo \
+#TAB#@echo foo \
+#TAB#bar; echo hi
+#TAB#@echo foo \
  bar; echo hi
-       @echo foo \
-        bar; echo hi
-',
+#TAB#@echo foo \
+#TAB# bar; echo hi
+!,
               '', 'foobar
 hi
 foobar
@@ -234,22 +234,22 @@ hi');
 # Test the slow path / single quotes
 run_make_test(q!
 all:
-       @echo hi; echo 'foo\
+#TAB#@echo hi; echo 'foo\
 bar'
-       @echo hi; echo 'foo\
-       bar'
-       @echo hi; echo 'foo\
+#TAB#@echo hi; echo 'foo\
+#TAB#bar'
+#TAB#@echo hi; echo 'foo\
     bar'
-       @echo hi; echo 'foo\
-           bar'
-       @echo hi; echo 'foo \
+#TAB#@echo hi; echo 'foo\
+#TAB#    bar'
+#TAB#@echo hi; echo 'foo \
 bar'
-       @echo hi; echo 'foo \
-       bar'
-       @echo hi; echo 'foo \
+#TAB#@echo hi; echo 'foo \
+#TAB#bar'
+#TAB#@echo hi; echo 'foo \
     bar'
-       @echo hi; echo 'foo \
-           bar'
+#TAB#@echo hi; echo 'foo \
+#TAB#    bar'
 !,
               '', 'hi
 foo\
@@ -277,25 +277,25 @@ foo \
     bar');
 
 # Test the slow path / double quotes
-run_make_test('
+run_make_test(q!
 all:
-       @echo hi; echo "foo\
+#TAB#@echo hi; echo "foo\
 bar"
-       @echo hi; echo "foo\
-       bar"
-       @echo hi; echo "foo\
+#TAB#@echo hi; echo "foo\
+#TAB#bar"
+#TAB#@echo hi; echo "foo\
     bar"
-       @echo hi; echo "foo\
-           bar"
-       @echo hi; echo "foo \
+#TAB#@echo hi; echo "foo\
+#TAB#    bar"
+#TAB#@echo hi; echo "foo \
 bar"
-       @echo hi; echo "foo \
-       bar"
-       @echo hi; echo "foo \
+#TAB#@echo hi; echo "foo \
+#TAB#bar"
+#TAB#@echo hi; echo "foo \
     bar"
-       @echo hi; echo "foo \
-           bar"
-',
+#TAB#@echo hi; echo "foo \
+#TAB#    bar"
+!,
               '', 'hi
 foobar
 hi
@@ -341,7 +341,3 @@ if ($port_type ne 'W32') {
 }
 
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index 6a36e8d49376e91f0e6249abc68070367fcc4d5d..cd334f9d6391b05cba8b80125b1a5eb608951bd4 100644 (file)
@@ -10,16 +10,16 @@ is built again.";
 
 &touch('bar.x');
 
-run_make_test('
+run_make_test(q!
 .SUFFIXES:
 
 .PHONY: all
 all: foo
 
 foo: bar.x
-       @echo cp $< $@
-       @echo "" > $@
-',
+#TAB#@echo cp $< $@
+#TAB#@echo "" > $@
+!,
               '', 'cp bar.x foo');
 
 run_make_test(undef, '', "#MAKE#: Nothing to be done for 'all'.");
@@ -39,12 +39,12 @@ rmfiles('bar.x', 'foo');
 # Test -B with the re-exec feature: we don't want to re-exec forever
 # Savannah bug # 7566
 
-run_make_test('
+run_make_test(q!
 all: ; @:
 $(info MAKE_RESTARTS=$(MAKE_RESTARTS))
 include foo.x
 foo.x: ; @touch $@
-',
+!,
               '-B', 'MAKE_RESTARTS=
 MAKE_RESTARTS=1');
 
@@ -55,13 +55,13 @@ rmfiles('foo.x');
 
 &touch('blah.x');
 
-run_make_test('
+run_make_test(q!
 all: blah.x ; @echo $@
 $(info MAKE_RESTARTS=$(MAKE_RESTARTS))
 include foo.x
 foo.x: ; @touch $@
 blah.x: ; @echo $@
-',
+!,
               '-B', 'MAKE_RESTARTS=
 MAKE_RESTARTS=1
 blah.x
@@ -82,7 +82,3 @@ x.a: x.b ; @echo $?
 unlink(qw(x.a x.b));
 
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index fe4d235530a5a30e489f5da34399d3d7f90f268b..1e4d3a2cfd3955a454d6cfd4b372865662b3d249 100644 (file)
@@ -4,10 +4,10 @@ $description = "Test make -W (what if) option.\n";
 
 # Basic build
 
-run_make_test('
+run_make_test(q!
 a.x: b.x
 a.x b.x: ; echo >> $@
-',
+!,
               '', "echo >> b.x\necho >> a.x");
 
 # Run it again: nothing should happen
@@ -34,15 +34,15 @@ rmfiles('a.x', 'b.x');
 
 # First set it up with a normal build
 
-run_make_test('
+run_make_test(q!
 all: baz.x ; @:
 include foo.x
 foo.x: bar.x
-       @echo "\$$(info restarts=\$$(MAKE_RESTARTS))" > $@
-       @echo "touch $@"
+#TAB#@echo "\$$(info restarts=\$$(MAKE_RESTARTS))" > $@
+#TAB#@echo "touch $@"
 bar.x: ; echo >> $@
 baz.x: bar.x ; @echo "touch $@"
-',
+!,
               '', 'echo >> bar.x
 touch foo.x
 restarts=1
@@ -66,17 +66,17 @@ mkdir('x-dir', 0777);
 utouch(-20, 'x-dir/x');
 touch('y');
 
-run_make_test('
+run_make_test(q!
 y: x ; @echo cp $< $@
-',
+!,
               '-W x-dir/x VPATH=x-dir',
               'cp x-dir/x y');
 
 # Make sure ./ stripping doesn't interfere with the match.
 
-run_make_test('
+run_make_test(q!
 y: x ; @echo cp $< $@
-',
+!,
               '-W ./x-dir/x VPATH=x-dir',
               'cp x-dir/x y');
 
@@ -88,7 +88,3 @@ unlink(qw(y x-dir/x));
 rmdir('x-dir');
 
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index 0ae9b5b71c9c3dee1fad36b0a62e46daaf1a3913..1ea6e178837a13d0879b0c8b721a7085f4022ddc 100644 (file)
@@ -18,8 +18,8 @@ if ($port_type ne 'W32') {
 run_make_test(q!
 .ONESHELL:
 all:
-       a=$$$$
-       [ 0"$$a" -eq "$$$$" ] || echo fail
+#TAB#a=$$$$
+#TAB#[ 0"$$a" -eq "$$$$" ] || echo fail
 !,
               '', 'a=$$
 [ 0"$a" -eq "$$" ] || echo fail
@@ -32,8 +32,8 @@ if ($multi_ok) {
 .ONESHELL:
 .SHELLFLAGS = -e -c
 all:
-       a=$$$$
-       [ 0"$$a" -eq "$$$$" ] || echo fail
+#TAB#a=$$$$
+#TAB#[ 0"$$a" -eq "$$$$" ] || echo fail
 !,
               '', 'a=$$
 [ 0"$a" -eq "$$" ] || echo fail
@@ -45,8 +45,8 @@ all:
 run_make_test(q!
 .ONESHELL:
 all:
-       a=$$$$
-       @-+    [ 0"$$a" -eq "$$$$" ] || echo fail
+#TAB#a=$$$$
+#TAB#@-+    [ 0"$$a" -eq "$$$$" ] || echo fail
 !,
               '', 'a=$$
 [ 0"$a" -eq "$$" ] || echo fail
@@ -57,8 +57,8 @@ all:
 run_make_test(q!
 .ONESHELL:
 all:
-          @a=$$$$
-           [ 0"$$a" -eq "$$$$" ] || echo fail
+#TAB#   @a=$$$$
+#TAB#    [ 0"$$a" -eq "$$$$" ] || echo fail
 !,
               '', '');
 
@@ -68,8 +68,8 @@ all:
 run_make_test(q!
 .ONESHELL:
 all:
-          @a=$$$$
-           -@     +[ 0"$$a" -eq "$$$$" ] || echo fail
+#TAB#   @a=$$$$
+#TAB#    -@     +[ 0"$$a" -eq "$$$$" ] || echo fail
 !,
               '', '');
 
@@ -83,9 +83,9 @@ if ($port_type ne 'W32') {
 SHELL = #PERL#
 .SHELLFLAGS = -e
 all:
->         @$$a=5
->          +7;
->      @y=qw(a b c);
+>#TAB#   @$$a=5
+>#TAB#    +7;
+>#TAB#@y=qw(a b c);
 >print "a = $$a, y = (@y)\n";
 !,
                   '', "a = 12, y = (a b c)\n");
@@ -137,7 +137,3 @@ all:; @print "it works: $$foo\n"
 
 # This tells the test driver that the perl test script executed properly.
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End:
index dc621606ed3b2bd64a561607e325f4ff2bdd2bec..a9da41e7b6f0985407ba926929453f853803c51f 100644 (file)
@@ -1,4 +1,4 @@
-#                                                                   -*-perl-*-
+#                                                                    -*-perl-*-
 
 $description = "Test proper behavior of the MAKE variable";
 
@@ -8,11 +8,11 @@ run_make_test(q!
 TMP  := $(MAKE)
 MAKE := $(subst X=$(X),,$(MAKE))
 all:
-       @echo $(TMP)
-       $(MAKE) -f #MAKEFILE# foo
+#TAB#@echo $(TMP)
+#TAB#$(MAKE) -f #MAKEFILE# foo
 
 foo:
-       @echo $(MAKE)
+#TAB#@echo $(MAKE)
 !,
               '',
               "#MAKEPATH#\n#MAKEPATH# -f #MAKEFILE# foo\n"
index 879283b056714f52e1e0aa6e8a7e9442dbc52f04..c3b50f5fcc7208d645c03771e7b39835c265e1f5 100644 (file)
@@ -6,47 +6,16 @@ $details = "\
 We construct a makefile with various targets, all of which print out
 \$(MAKECMDGOALS), then call it different ways.";
 
-open(MAKEFILE,"> $makefile");
-print MAKEFILE "\
+run_make_test(q!
 .DEFAULT all:
-       \@echo \$(MAKECMDGOALS)
-";
-close(MAKEFILE);
+#TAB#@echo $(MAKECMDGOALS)
+!,
+                       '', "\n");
 
-# TEST #1
-
-&run_make_with_options($makefile,
-                       "",
-                       &get_logfile,
-                       0);
-$answer = "\n";
-&compare_output($answer,&get_logfile(1));
-
-# TEST #2
-
-&run_make_with_options($makefile,
-                       "all",
-                       &get_logfile,
-                       0);
-$answer = "all\n";
-&compare_output($answer,&get_logfile(1));
-
-
-# TEST #3
-
-&run_make_with_options($makefile,
-                       "foo bar baz yaz",
-                       &get_logfile,
-                       0);
-$answer = "foo bar baz yaz\nfoo bar baz yaz\nfoo bar baz yaz\nfoo bar baz yaz\n";
-&compare_output($answer,&get_logfile(1));
+run_make_test(undef, "all", "all\n");
 
+run_make_test(undef, "foo bar baz yaz",
+              "foo bar baz yaz\nfoo bar baz yaz\nfoo bar baz yaz\nfoo bar baz yaz\n");
 
 # This tells the test driver that the perl test script executed properly.
 1;
-
-
-
-
-
-
index 771bbda8f7beebdffebe82c13e7f3ef4a25f1a97..d64518d83b2b61ff523151a48b66809ffb736739 100644 (file)
@@ -9,51 +9,38 @@ use Cwd;
 $dir = cwd;
 $dir =~ s,.*/([^/]+)$,../$1,;
 
-open(MAKEFILE, "> $makefile");
-print MAKEFILE "dir = $dir\n";
-print MAKEFILE <<'EOF';
+# simple test
+# Touch these into the past
+&utouch(-10, qw(foo.x baz.z));
+
+run_make_test(q!
 .SUFFIXES:
 .SUFFIXES: .x .y .z
 $(dir)/foo.x : baz.z $(dir)/bar.y baz.z
-       @echo '$$@ = $@, $$(@D) = $(@D), $$(@F) = $(@F)'
-       @echo '$$* = $*, $$(*D) = $(*D), $$(*F) = $(*F)'
-       @echo '$$< = $<, $$(<D) = $(<D), $$(<F) = $(<F)'
-       @echo '$$^ = $^, $$(^D) = $(^D), $$(^F) = $(^F)'
-       @echo '$$+ = $+, $$(+D) = $(+D), $$(+F) = $(+F)'
-       @echo '$$? = $?, $$(?D) = $(?D), $$(?F) = $(?F)'
-       touch $@
+#TAB#@echo '$$@ = $@, $$(@D) = $(@D), $$(@F) = $(@F)'
+#TAB#@echo '$$* = $*, $$(*D) = $(*D), $$(*F) = $(*F)'
+#TAB#@echo '$$< = $<, $$(<D) = $(<D), $$(<F) = $(<F)'
+#TAB#@echo '$$^ = $^, $$(^D) = $(^D), $$(^F) = $(^F)'
+#TAB#@echo '$$+ = $+, $$(+D) = $(+D), $$(+F) = $(+F)'
+#TAB#@echo '$$? = $?, $$(?D) = $(?D), $$(?F) = $(?F)'
+#TAB#touch $@
 
 $(dir)/bar.y baz.z : ; touch $@
-EOF
-close(MAKEFILE);
-
-# TEST #0 -- simple test
-# -------
-
-# Touch these into the past
-&utouch(-10, qw(foo.x baz.z));
-
-&run_make_with_options($makefile, "", &get_logfile);
-$answer = "touch $dir/bar.y
+!,
+              "dir=$dir", "touch $dir/bar.y
 \$\@ = $dir/foo.x, \$(\@D) = $dir, \$(\@F) = foo.x
 \$* = $dir/foo, \$(*D) = $dir, \$(*F) = foo
 \$< = baz.z, \$(<D) = ., \$(<F) = baz.z
 \$^ = baz.z $dir/bar.y, \$(^D) = . $dir, \$(^F) = baz.z bar.y
 \$+ = baz.z $dir/bar.y baz.z, \$(+D) = . $dir ., \$(+F) = baz.z bar.y baz.z
 \$? = $dir/bar.y, \$(?D) = $dir, \$(?F) = bar.y
-touch $dir/foo.x\n";
-&compare_output($answer, &get_logfile(1));
+touch $dir/foo.x\n");
 
 unlink(qw(foo.x bar.y baz.z));
 
-# TEST #1 -- test the SysV emulation of $$@ etc.
-# -------
-
-$makefile2 = &get_tmpfile;
+# test the SysV emulation of $$@ etc.
 
-open(MAKEFILE, "> $makefile2");
-print MAKEFILE "dir = $dir\n";
-print MAKEFILE <<'EOF';
+run_make_test(q!
 .SECONDEXPANSION:
 .SUFFIXES:
 .DEFAULT: ; @echo '$@'
@@ -63,21 +50,14 @@ $(dir)/foo $(dir)/bar: $@.x $$@.x $$$@.x $$$$@.x $$(@D).x $$(@F).x
 $(dir)/x.z $(dir)/y.z: $(dir)/%.z : $@.% $$@.% $$$@.% $$$$@.% $$(@D).% $$(@F).%
 
 $(dir)/biz: $$(@).x $${@}.x $${@D}.x $${@F}.x
-EOF
-
-close(MAKEFILE);
-
-&run_make_with_options($makefile2, "$dir/foo $dir/bar", &get_logfile);
-$answer = ".x\n$dir/foo.x\nx\n\$@.x\n$dir.x\nfoo.x\n$dir/bar.x\nbar.x\n";
-&compare_output($answer, &get_logfile(1));
+!,
+              "dir=$dir $dir/foo $dir/bar",
+              ".x\n$dir/foo.x\nx\n\$@.x\n$dir.x\nfoo.x\n$dir/bar.x\nbar.x\n");
 
-&run_make_with_options($makefile2, "$dir/x.z $dir/y.z", &get_logfile);
-$answer = ".x\n$dir/x.z.x\nx\n\$@.x\n$dir.x\nx.z.x\n.y\n$dir/y.z.y\ny\n\$@.y\n$dir.y\ny.z.y\n";
-&compare_output($answer, &get_logfile(1));
+run_make_test(undef, "dir=$dir $dir/x.z $dir/y.z",
+              ".x\n$dir/x.z.x\nx\n\$@.x\n$dir.x\nx.z.x\n.y\n$dir/y.z.y\ny\n\$@.y\n$dir.y\ny.z.y\n");
 
-&run_make_with_options($makefile2, "$dir/biz", &get_logfile);
-$answer = "$dir/biz.x\n$dir.x\nbiz.x\n";
-&compare_output($answer, &get_logfile(1));
+run_make_test(undef, "dir=$dir $dir/biz", "$dir/biz.x\n$dir.x\nbiz.x\n");
 
 # TEST #2 -- test for Savannah bug #12320.
 #
@@ -85,7 +65,7 @@ run_make_test('
 .SUFFIXES: .b .src
 
 mbr.b: mbr.src
-       @echo $*
+#TAB#@echo $*
 
 mbr.src: ; @:',
               '',
@@ -99,7 +79,7 @@ run_make_test('
 
 p:=mbr.src
 mbr.b: $$p
-       @echo $*
+#TAB#@echo $*
 
 mbr.src: ; @:',
               '',
@@ -109,7 +89,7 @@ mbr.src: ; @:',
 
 run_make_test('
 mbr.b: mbr.src
-       @echo star=$*
+#TAB#@echo star=$*
 
 mbr.src: ; @:',
               '',
index eecbd8f3e425db77cb766ff5c1a8bdb77ccba7d4..ad978b9e2ba78ccb5efe4f0be5a9a1e3c18602a5 100644 (file)
@@ -52,10 +52,10 @@ endef
 FOO = there
 
 all: ; $(multi)
-       $(simple)
-       $(posix)
-       $(append)
-       $(cond)
+#TAB#$(simple)
+#TAB#$(posix)
+#TAB#$(append)
+#TAB#$(cond)
 ',
               '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n");
 
@@ -99,11 +99,11 @@ endef
 FOO = there
 
 all: ; $(multi)
-       $(simple)
-       $(posix)
-       $(posixbsd)
-       $(append)
-       $(cond)
+#TAB#$(simple)
+#TAB#$(posix)
+#TAB#$(posixbsd)
+#TAB#$(append)
+#TAB#$(cond)
 !,
               '', "echo hi\nhi\nthere\nfoo\nfoo\nfoo\$bar\na\nb\nfirst\n");
 
index e05f6ab6ce1462d977022ed34e5fdbb9529479ef..c111c1a091f7ce755c0dba4e13edc3fdd657b8f3 100644 (file)
@@ -4,7 +4,7 @@ $description = "Test special GNU Make variables.";
 
 $details = "";
 
-&run_make_test('
+run_make_test(q!
 
 X1 := $(sort $(filter FOO BAR,$(.VARIABLES)))
 
@@ -15,12 +15,12 @@ X2 := $(sort $(filter FOO BAR,$(.VARIABLES)))
 BAR := bar
 
 all: ; @echo X1 = $(X1); echo X2 = $(X2); echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES)))
-',
+!,
                '', "X1 =\nX2 = FOO\nLAST = BAR FOO\n");
 
 # SV 45728: Test that undefining a variable is reflected properly
 
-&run_make_test('
+run_make_test(q!
 FOO := foo
 BAR := bar
 $(info one: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
@@ -28,7 +28,7 @@ undefine BAR
 BAZ := baz
 $(info two: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
 all:;@:
-',
+!,
                '', "one: BAR FOO\ntwo: BAZ FOO\n");
 
 # $makefile2 = &get_tmpfile;
@@ -39,9 +39,9 @@ all:;@:
 # X1 := $(sort $(.TARGETS))
 
 # all: foo
-#      @echo X1 = $(X1)
-#      @echo X2 = $(X2)
-#      @echo LAST = $(sort $(.TARGETS))
+##TAB#@echo X1 = $(X1)
+##TAB#@echo X2 = $(X2)
+##TAB#@echo LAST = $(sort $(.TARGETS))
 
 # X2 := $(sort $(.TARGETS))
 
@@ -59,46 +59,46 @@ all:;@:
 # &compare_output($answer, &get_logfile(1));
 
 # Test the .RECIPEPREFIX variable
-&run_make_test('
+run_make_test(q!
 define foo
 : foo-one\
 foo-two
 : foo-three
-       : foo-four
+#TAB#: foo-four
 endef
 
 orig: ; : orig-one
-       : orig-two \
+#TAB#: orig-two \
 orig-three \
-       orig-four \
-               orig-five \\\\
-       : orig-six
-       $(foo)
+#TAB#orig-four \
+#TAB##TAB#orig-five \\\\
+#TAB#: orig-six
+#TAB#$(foo)
 
 .RECIPEPREFIX = >
 test: ; : test-one
 >: test-two \
 test-three \
 >test-four \
->      test-five \\\\
+>#TAB#test-five \\\\
 >: test-six
 >$(foo)
 
 .RECIPEPREFIX =
 reset: ; : reset-one
-       : reset-two \
+#TAB#: reset-two \
 reset-three \
-       reset-four \
-               reset-five \\\\
-       : reset-six
-       $(foo)
-',
+#TAB#reset-four \
+#TAB##TAB#reset-five \\\\
+#TAB#: reset-six
+#TAB#$(foo)
+!,
                'orig test reset',
                ': orig-one
 : orig-two \
 orig-three \
 orig-four \
-       orig-five \\\\
+#TAB#orig-five \\\\
 : orig-six
 : foo-one foo-two
 : foo-three
@@ -107,7 +107,7 @@ orig-four \
 : test-two \
 test-three \
 test-four \
-       test-five \\\\
+#TAB#test-five \\\\
 : test-six
 : foo-one foo-two
 : foo-three
@@ -116,14 +116,10 @@ test-four \
 : reset-two \
 reset-three \
 reset-four \
-       reset-five \\\\
+#TAB#reset-five \\\\
 : reset-six
 : foo-one foo-two
 : foo-three
 : foo-four');
 
 1;
-
-### Local Variables:
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
-### End: