Paul Smith fdcaaed8d7 * tests/scripts/*: Switch TAB chars to #TAB# markup
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.
2025-08-24 14:29:11 -04:00

60 lines
1.4 KiB
Perl

# -*-Perl-*-
$description = "\
The following test creates a makefile to test the warning function.";
$details = "";
run_make_test(q!ifdef WARNING1
$(warning warning is $(WARNING1))
endif
ifdef WARNING2
$(warning warning is $(WARNING2))
endif
ifdef WARNING3
all: some; @echo hi $(warning warning is $(WARNING3))
endif
ifdef WARNING4
all: some; @echo hi
#TAB#@echo there $(warning warning is $(WARNING4))
endif
some: ; @echo Some stuff
!,
"WARNING1=yes", "#MAKEFILE#:2: warning is yes\nSome stuff\n");
run_make_test(undef, "WARNING2=no",
"#MAKEFILE#:6: warning is no\nSome stuff\n");
run_make_test(undef, "WARNING3=maybe",
"Some stuff\n#MAKEFILE#:10: warning is maybe\nhi\n");
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
#TAB#$(warning in $@ line 3)
#TAB#@true
#TAB#$(warning in $@ line 5)
one two:
#TAB#$(warning in $@ line 8)
#TAB#@true
#TAB#$(warning in $@ line 10)
!,
'', "#MAKEFILE#:8: in one line 8
#MAKEFILE#:10: in one line 10
#MAKEFILE#:8: in two line 8
#MAKEFILE#:10: in two line 10
#MAKEFILE#:3: in all line 3
#MAKEFILE#:5: in all line 5\n");
# This tells the test driver that the perl test script executed properly.
1;