2 $description = "Test the word, words, and wordlist functions.\n";
5 Produce a variable with a large number of words in it,
6 determine the number of words, and then read each one back.\n";
8 open(MAKEFILE,"> $makefile");
10 # The Contents of the MAKEFILE ...
12 print MAKEFILE <<'EOF';
13 string := word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl
14 string2 := $(string) $(string) $(string) $(string) $(string) $(string) $(string)
15 string3 := $(string2) $(string2) $(string2) $(string2) $(string2) $(string2) $(string2)
16 string4 := $(string3) $(string3) $(string3) $(string3) $(string3) $(string3) $(string3)
18 @echo $(words $(string))
19 @echo $(words $(string4))
20 @echo $(word 1, $(string))
21 @echo $(word 100, $(string))
22 @echo $(word 1, $(string))
23 @echo $(word 1000, $(string3))
24 @echo $(wordlist 3, 4, $(string))
25 @echo $(wordlist 4, 3, $(string))
26 @echo $(wordlist 1, 6, $(string))
27 @echo $(wordlist 5, 7, $(string))
28 @echo $(wordlist 100, 110, $(string))
29 @echo $(wordlist 7, 10, $(string2))
34 # END of Contents of MAKEFILE
38 &run_make_with_options($makefile, "", &get_logfile);
40 # Create the answer to what should be produced by this Makefile
51 ."word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl\n"
52 ."generic_test.perl MAKEFILES_variable.pl\n"
54 ."word.pl general_test2.pl FORCE.pl word.pl\n"
57 # In this call to compare output, you should use the call &get_logfile(1)
58 # to send the name of the last logfile created. You may also use
59 # the special call &get_logfile(1) which returns the same as &get_logfile(1).
61 &compare_output($answer, &get_logfile(1));
63 # This tells the test driver that the perl test script executed properly.