]>
Commit | Line | Data |
---|---|---|
fcefb14a MT |
1 | diff -up ccache-3.1.9/test.sh~ ccache-3.1.9/test.sh |
2 | --- ccache-3.1.9/test.sh~ 2013-01-06 18:57:59.000000000 +0200 | |
3 | +++ ccache-3.1.9/test.sh 2013-03-31 21:37:24.647552458 +0300 | |
4 | @@ -3,7 +3,7 @@ | |
5 | # A simple test suite for ccache. | |
6 | # | |
7 | # Copyright (C) 2002-2007 Andrew Tridgell | |
8 | -# Copyright (C) 2009-2012 Joel Rosdahl | |
9 | +# Copyright (C) 2009-2013 Joel Rosdahl | |
10 | # | |
11 | # This program is free software; you can redistribute it and/or modify it under | |
12 | # the terms of the GNU General Public License as published by the Free Software | |
13 | @@ -562,6 +562,12 @@ int test3; | |
14 | EOF | |
15 | backdate test1.h test2.h test3.h | |
16 | ||
17 | + $COMPILER -c -Wp,-MD,expected.d test.c | |
18 | + expected_d_content=`cat expected.d` | |
19 | + | |
20 | + $COMPILER -c -Wp,-MMD,expected_mmd.d test.c | |
21 | + expected_mmd_d_content=`cat expected_mmd.d` | |
22 | + | |
23 | ################################################################## | |
24 | # First compilation is a miss. | |
25 | testname="first compilation" | |
26 | @@ -677,7 +683,7 @@ EOF | |
27 | checkstat 'cache hit (direct)' 0 | |
28 | checkstat 'cache hit (preprocessed)' 0 | |
29 | checkstat 'cache miss' 1 | |
30 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
31 | + checkfile other.d "$expected_d_content" | |
32 | ||
33 | rm -f other.d | |
34 | ||
35 | @@ -685,7 +691,7 @@ EOF | |
36 | checkstat 'cache hit (direct)' 1 | |
37 | checkstat 'cache hit (preprocessed)' 0 | |
38 | checkstat 'cache miss' 1 | |
39 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
40 | + checkfile other.d "$expected_d_content" | |
41 | ||
42 | rm -f other.d | |
43 | ||
44 | @@ -698,7 +704,7 @@ EOF | |
45 | checkstat 'cache hit (direct)' 0 | |
46 | checkstat 'cache hit (preprocessed)' 0 | |
47 | checkstat 'cache miss' 1 | |
48 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
49 | + checkfile other.d "$expected_mmd_d_content" | |
50 | ||
51 | rm -f other.d | |
52 | ||
53 | @@ -706,7 +712,7 @@ EOF | |
54 | checkstat 'cache hit (direct)' 1 | |
55 | checkstat 'cache hit (preprocessed)' 0 | |
56 | checkstat 'cache miss' 1 | |
57 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
58 | + checkfile other.d "$expected_mmd_d_content" | |
59 | ||
60 | rm -f other.d | |
61 | ||
62 | @@ -760,7 +766,7 @@ EOF | |
63 | checkstat 'cache hit (direct)' 0 | |
64 | checkstat 'cache hit (preprocessed)' 0 | |
65 | checkstat 'cache miss' 1 | |
66 | - checkfile test.d "test.o: test.c test1.h test3.h test2.h" | |
67 | + checkfile test.d "$expected_d_content" | |
68 | ||
69 | rm -f test.d | |
70 | ||
71 | @@ -768,7 +774,7 @@ EOF | |
72 | checkstat 'cache hit (direct)' 1 | |
73 | checkstat 'cache hit (preprocessed)' 0 | |
74 | checkstat 'cache miss' 1 | |
75 | - checkfile test.d "test.o: test.c test1.h test3.h test2.h" | |
76 | + checkfile test.d "$expected_d_content" | |
77 | ||
78 | ################################################################## | |
79 | # Check the scenario of running a ccache with direct mode on a cache | |
80 | @@ -780,7 +786,7 @@ EOF | |
81 | checkstat 'cache hit (direct)' 0 | |
82 | checkstat 'cache hit (preprocessed)' 0 | |
83 | checkstat 'cache miss' 1 | |
84 | - checkfile test.d "test.o: test.c test1.h test3.h test2.h" | |
85 | + checkfile test.d "$expected_d_content" | |
86 | ||
87 | rm -f test.d | |
88 | ||
89 | @@ -788,7 +794,7 @@ EOF | |
90 | checkstat 'cache hit (direct)' 0 | |
91 | checkstat 'cache hit (preprocessed)' 1 | |
92 | checkstat 'cache miss' 1 | |
93 | - checkfile test.d "test.o: test.c test1.h test3.h test2.h" | |
94 | + checkfile test.d "$expected_d_content" | |
95 | ||
96 | rm -f test.d | |
97 | ||
98 | @@ -796,7 +802,7 @@ EOF | |
99 | checkstat 'cache hit (direct)' 0 | |
100 | checkstat 'cache hit (preprocessed)' 2 | |
101 | checkstat 'cache miss' 1 | |
102 | - checkfile test.d "test.o: test.c test1.h test3.h test2.h" | |
103 | + checkfile test.d "$expected_d_content" | |
104 | ||
105 | rm -f test.d | |
106 | ||
107 | @@ -804,7 +810,7 @@ EOF | |
108 | checkstat 'cache hit (direct)' 1 | |
109 | checkstat 'cache hit (preprocessed)' 2 | |
110 | checkstat 'cache miss' 1 | |
111 | - checkfile test.d "test.o: test.c test1.h test3.h test2.h" | |
112 | + checkfile test.d "$expected_d_content" | |
113 | ||
114 | ################################################################## | |
115 | # Check that -MF works. | |
116 | @@ -815,7 +821,7 @@ EOF | |
117 | checkstat 'cache hit (direct)' 0 | |
118 | checkstat 'cache hit (preprocessed)' 0 | |
119 | checkstat 'cache miss' 1 | |
120 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
121 | + checkfile other.d "$expected_d_content" | |
122 | ||
123 | rm -f other.d | |
124 | ||
125 | @@ -823,7 +829,7 @@ EOF | |
126 | checkstat 'cache hit (direct)' 1 | |
127 | checkstat 'cache hit (preprocessed)' 0 | |
128 | checkstat 'cache miss' 1 | |
129 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
130 | + checkfile other.d "$expected_d_content" | |
131 | ||
132 | ################################################################## | |
133 | # Check that a missing .d file in the cache is handled correctly. | |
134 | @@ -835,13 +841,13 @@ EOF | |
135 | checkstat 'cache hit (direct)' 0 | |
136 | checkstat 'cache hit (preprocessed)' 0 | |
137 | checkstat 'cache miss' 1 | |
138 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
139 | + checkfile other.d "$expected_d_content" | |
140 | ||
141 | $CCACHE $COMPILER -c -MD test.c | |
142 | checkstat 'cache hit (direct)' 1 | |
143 | checkstat 'cache hit (preprocessed)' 0 | |
144 | checkstat 'cache miss' 1 | |
145 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
146 | + checkfile other.d "$expected_d_content" | |
147 | ||
148 | find $CCACHE_DIR -name '*.d' -exec rm -f '{}' \; | |
149 | ||
150 | @@ -849,7 +855,7 @@ EOF | |
151 | checkstat 'cache hit (direct)' 1 | |
152 | checkstat 'cache hit (preprocessed)' 1 | |
153 | checkstat 'cache miss' 1 | |
154 | - checkfile other.d "test.o: test.c test1.h test3.h test2.h" | |
155 | + checkfile other.d "$expected_d_content" | |
156 | ||
157 | ################################################################## | |
158 | # Check that stderr from both the preprocessor and the compiler is emitted |