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

« back to all changes in this revision

Viewing changes to source/3rdparty/qmake/tests/scripts/targets/INTERMEDIATE

  • 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 = "Test the behaviour of the .INTERMEDIATE target.";
 
4
 
 
5
$details = "\
 
6
Test the behavior of the .INTERMEDIATE special target.
 
7
Create a makefile where a file would not normally be considered
 
8
intermediate, then specify it as .INTERMEDIATE.  Build and ensure it's
 
9
deleted properly.  Rebuild to ensure that it's not created if it doesn't
 
10
exist but doesn't need to be built.  Change the original and ensure
 
11
that the intermediate file and the ultimate target are both rebuilt, and
 
12
that the intermediate file is again deleted.
 
13
 
 
14
Try this with implicit rules and explicit rules: both should work.\n";
 
15
 
 
16
open(MAKEFILE,"> $makefile");
 
17
 
 
18
print MAKEFILE <<'EOF';
 
19
 
 
20
.INTERMEDIATE: foo.e bar.e
 
21
 
 
22
# Implicit rule test
 
23
%.d : %.e ; cp $< $@
 
24
%.e : %.f ; cp $< $@
 
25
 
 
26
foo.d: foo.e
 
27
 
 
28
# Explicit rule test
 
29
foo.c: foo.e bar.e; cat $^ > $@
 
30
EOF
 
31
 
 
32
close(MAKEFILE);
 
33
 
 
34
# TEST #0
 
35
 
 
36
&touch('foo.f');
 
37
&touch('bar.f');
 
38
 
 
39
&run_make_with_options($makefile,'foo.d',&get_logfile);
 
40
$answer = "cp foo.f foo.e\ncp foo.e foo.d\nrm foo.e\n";
 
41
&compare_output($answer, &get_logfile(1));
 
42
 
 
43
# TEST #1
 
44
 
 
45
&run_make_with_options($makefile,'foo.d',&get_logfile);
 
46
$answer = "$make_name: `foo.d' is up to date.\n";
 
47
&compare_output($answer, &get_logfile(1));
 
48
 
 
49
# TEST #2
 
50
 
 
51
# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
 
52
# granularity of file times.
 
53
sleep(2);
 
54
&touch('foo.f');
 
55
 
 
56
&run_make_with_options($makefile,'foo.d',&get_logfile);
 
57
$answer = "cp foo.f foo.e\ncp foo.e foo.d\nrm foo.e\n";
 
58
&compare_output($answer, &get_logfile(1));
 
59
 
 
60
# TEST #3
 
61
 
 
62
&run_make_with_options($makefile,'foo.c',&get_logfile);
 
63
$answer = "cp foo.f foo.e\ncp bar.f bar.e\ncat foo.e bar.e > foo.c\nrm foo.e bar.e\n";
 
64
&compare_output($answer, &get_logfile(1));
 
65
 
 
66
# TEST #4
 
67
 
 
68
&run_make_with_options($makefile,'foo.c',&get_logfile);
 
69
$answer = "$make_name: `foo.c' is up to date.\n";
 
70
&compare_output($answer, &get_logfile(1));
 
71
 
 
72
# TEST #5
 
73
 
 
74
# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
 
75
# granularity of file times.
 
76
sleep(2);
 
77
&touch('foo.f');
 
78
 
 
79
&run_make_with_options($makefile,'foo.c',&get_logfile);
 
80
$answer = "cp foo.f foo.e\ncp bar.f bar.e\ncat foo.e bar.e > foo.c\nrm foo.e bar.e\n";
 
81
&compare_output($answer, &get_logfile(1));
 
82
 
 
83
unlink('foo.f', 'foo.e', 'foo.d', 'foo.c', 'bar.f', 'bar.e', 'bar.d', 'bar.c');
 
84
 
 
85
# This tells the test driver that the perl test script executed properly.
 
86
1;