xref: /netbsd-src/external/gpl2/gmake/dist/tests/scripts/features/comments (revision 69606e3f5c9388e52aed8c120ad63c049ca45d8f)
1*69606e3fSchristos$description = "The following test creates a makefile to test comments\n"
2*69606e3fSchristos              ."and comment continuation to the next line using a \n"
3*69606e3fSchristos              ."backslash within makefiles.";
4*69606e3fSchristos
5*69606e3fSchristos$details = "To test comments within a makefile, a semi-colon was placed \n"
6*69606e3fSchristos          ."after a comment was started.  This should not be reported as\n"
7*69606e3fSchristos          ."an error since it is within a comment.  We then continue the \n"
8*69606e3fSchristos          ."comment to the next line using a backslash.  To test whether\n"
9*69606e3fSchristos          ."the comment really continued, we place an echo command with some\n"
10*69606e3fSchristos          ."text on the line which should never execute since it should be \n"
11*69606e3fSchristos          ."within a comment\n";
12*69606e3fSchristos
13*69606e3fSchristosopen(MAKEFILE,"> $makefile");
14*69606e3fSchristos
15*69606e3fSchristos# The Contents of the MAKEFILE ...
16*69606e3fSchristos
17*69606e3fSchristosprint MAKEFILE <<\EOF;
18*69606e3fSchristos# Test comment vs semicolon parsing and line continuation
19*69606e3fSchristostarget: # this ; is just a comment \
20*69606e3fSchristos	@echo This is within a comment.
21*69606e3fSchristos	@echo There should be no errors for this makefile.
22*69606e3fSchristosEOF
23*69606e3fSchristos
24*69606e3fSchristos# END of Contents of MAKEFILE
25*69606e3fSchristos
26*69606e3fSchristosclose(MAKEFILE);
27*69606e3fSchristos
28*69606e3fSchristos&run_make_with_options($makefile,"",&get_logfile);
29*69606e3fSchristos
30*69606e3fSchristos# Create the answer to what should be produced by this Makefile
31*69606e3fSchristos$answer = "There should be no errors for this makefile.\n";
32*69606e3fSchristos
33*69606e3fSchristos# COMPARE RESULTS
34*69606e3fSchristos
35*69606e3fSchristos&compare_output($answer,&get_logfile(1))
36