3 $description = "The following test creates a makefile to test wildcard
4 expansions and the ability to put a command on the same
5 line as the target name separated by a semi-colon.";
8 This test creates 4 files by the names of 1.example,
9 two.example and 3.example. We execute three tests. The first
10 executes the print1 target which tests the '*' wildcard by
11 echoing all filenames by the name of '*.example'. The second
12 test echo's all files which match '?.example' and
13 [a-z0-9].example. Lastly we clean up all of the files using
14 the '*' wildcard as in the first test";
16 open(MAKEFILE,"> $makefile");
18 # The Contents of the MAKEFILE ...
21 .PHONY: print1 print2 clean
22 print1: ;\@echo \$(sort \$(wildcard example.*))
24 \t\@echo \$(sort \$(wildcard example.?))
25 \t\@echo \$(sort \$(wildcard example.[a-z0-9]))
26 \t\@echo \$(sort \$(wildcard example.[!A-Za-z_\\!]))
28 \t$delete_command \$(sort \$(wildcard example.*))
31 # END of Contents of MAKEFILE
36 &touch("example.two");
38 &touch("example.for");
44 $answer = "example.1 example.3 example._ example.for example.two\n";
46 &run_make_with_options($makefile,"print1",&get_logfile);
48 &compare_output($answer,&get_logfile(1));
54 $answer = "example.1 example.3 example._\n"
55 ."example.1 example.3\n"
56 ."example.1 example.3\n";
58 &run_make_with_options($makefile,"print2",&get_logfile);
60 &compare_output($answer,&get_logfile(1));
66 $answer = "$delete_command example.1 example.3 example._ example.for example.two";
76 &run_make_with_options($makefile,"clean",&get_logfile);
78 if ((-f "example.1")||(-f "example.two")||(-f "example.3")||(-f "example.for")) {
82 &compare_output($answer,&get_logfile(1));
84 # TEST #4: Verify that failed wildcards don't return the pattern
87 all: ; @echo $(wildcard xz--y*.7)
91 # TEST #5: wildcard used to verify file existence
95 run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!,
96 '', "file=xxx.yyy\n");
100 run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!,