~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/3rdparty/qmake/tests/scripts/functions/wildcard

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                                                    -*-perl-*-
 
2
 
 
3
$description = "The following test creates a makefile to test wildcard\n"
 
4
              ."expansions and the ability to put a command on the same\n"
 
5
              ."line as the target name separated by a semi-colon.";
 
6
 
 
7
$details = "This test creates 4 files by the names of 1.example, \n"
 
8
          ."two.example and 3.example.  We execute three tests.  The first\n"
 
9
          ."executes the print1 target which tests the '*' wildcard by \n"
 
10
          ."echoing all filenames by the name of '*.example'.  The second\n"
 
11
          ."test echo's all files which match '?.example' and \n"
 
12
          ."[a-z0-9].example.  Lastly we clean up all of the files using\n"
 
13
          ."the '*' wildcard as in the first test";
 
14
 
 
15
if ($vos)
 
16
{
 
17
   $delete_command = "delete_file -no_ask";
 
18
}
 
19
else
 
20
{
 
21
   $delete_command = "rm";
 
22
}
 
23
 
 
24
 
 
25
open(MAKEFILE,"> $makefile");
 
26
 
 
27
# The Contents of the MAKEFILE ...
 
28
 
 
29
print MAKEFILE <<EOM;
 
30
print1: ;\@echo \$(wildcard example.*)
 
31
print2:
 
32
\t\@echo \$(wildcard example.?)
 
33
\t\@echo \$(wildcard example.[a-z0-9])
 
34
\t\@echo \$(wildcard example.[!A-Za-z_\\!])
 
35
clean:
 
36
\t$delete_command \$(wildcard example.*)
 
37
EOM
 
38
 
 
39
# END of Contents of MAKEFILE
 
40
 
 
41
close(MAKEFILE);
 
42
 
 
43
&touch("example.1");
 
44
&touch("example.two");
 
45
&touch("example.3");
 
46
&touch("example.for");
 
47
&touch("example._");
 
48
 
 
49
# TEST #1
 
50
# -------
 
51
 
 
52
$answer = "example.1 example.3 example._ example.for example.two\n";
 
53
 
 
54
&run_make_with_options($makefile,"print1",&get_logfile);
 
55
 
 
56
&compare_output($answer,&get_logfile(1));
 
57
 
 
58
 
 
59
# TEST #2
 
60
# -------
 
61
 
 
62
$answer = "example.1 example.3 example._\n"
 
63
         ."example.1 example.3\n"
 
64
         ."example.1 example.3\n";
 
65
 
 
66
&run_make_with_options($makefile,"print2",&get_logfile);
 
67
 
 
68
&compare_output($answer,&get_logfile(1));
 
69
 
 
70
 
 
71
# TEST #3
 
72
# -------
 
73
 
 
74
$answer = "$delete_command example.1 example.3 example._ example.for example.two";
 
75
if ($vos)
 
76
{
 
77
   $answer .= " \n";
 
78
}
 
79
else
 
80
{
 
81
   $answer .= "\n";
 
82
}
 
83
 
 
84
&run_make_with_options($makefile,"clean",&get_logfile);
 
85
 
 
86
&compare_output($answer,&get_logfile(1));
 
87
 
 
88
if ((-f "example.1")||(-f "example.two")||(-f "example.3")||(-f "example.for"))
 
89
{
 
90
   $test_passed = 0;
 
91
}
 
92
 
 
93
 
 
94
1;
 
95
 
 
96
 
 
97
 
 
98
 
 
99
 
 
100
 
 
101
 
 
102
 
 
103