@@ -12,6 +12,13 @@ code and message.'
12
12
13
13
. ./gitweb-lib.sh
14
14
15
+ #
16
+ # Gitweb only provides the functionality tested by the 'modification times'
17
+ # tests if it can access a date parser from one of these modules:
18
+ #
19
+ perl -MHTTP::Date -e 0 > /dev/null 2>&1 && test_set_prereq DATE_PARSER
20
+ perl -MTime::ParseDate -e 0 > /dev/null 2>&1 && test_set_prereq DATE_PARSER
21
+
15
22
# ----------------------------------------------------------------------
16
23
# snapshot settings
17
24
@@ -115,53 +122,53 @@ test_debug 'cat gitweb.output'
115
122
# ----------------------------------------------------------------------
116
123
# modification times (Last-Modified and If-Modified-Since)
117
124
118
- test_expect_success ' modification: feed last-modified' '
125
+ test_expect_success DATE_PARSER ' modification: feed last-modified' '
119
126
gitweb_run "p=.git;a=atom;h=master" &&
120
127
grep "Status: 200 OK" gitweb.headers &&
121
128
grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
122
129
'
123
130
test_debug ' cat gitweb.headers'
124
131
125
- test_expect_success ' modification: feed if-modified-since (modified)' '
132
+ test_expect_success DATE_PARSER ' modification: feed if-modified-since (modified)' '
126
133
export HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
127
134
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
128
135
gitweb_run "p=.git;a=atom;h=master" &&
129
136
grep "Status: 200 OK" gitweb.headers
130
137
'
131
138
test_debug ' cat gitweb.headers'
132
139
133
- test_expect_success ' modification: feed if-modified-since (unmodified)' '
140
+ test_expect_success DATE_PARSER ' modification: feed if-modified-since (unmodified)' '
134
141
export HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
135
142
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
136
143
gitweb_run "p=.git;a=atom;h=master" &&
137
144
grep "Status: 304 Not Modified" gitweb.headers
138
145
'
139
146
test_debug ' cat gitweb.headers'
140
147
141
- test_expect_success ' modification: snapshot last-modified' '
148
+ test_expect_success DATE_PARSER ' modification: snapshot last-modified' '
142
149
gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
143
150
grep "Status: 200 OK" gitweb.headers &&
144
151
grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
145
152
'
146
153
test_debug ' cat gitweb.headers'
147
154
148
- test_expect_success ' modification: snapshot if-modified-since (modified)' '
155
+ test_expect_success DATE_PARSER ' modification: snapshot if-modified-since (modified)' '
149
156
export HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
150
157
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
151
158
gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
152
159
grep "Status: 200 OK" gitweb.headers
153
160
'
154
161
test_debug ' cat gitweb.headers'
155
162
156
- test_expect_success ' modification: snapshot if-modified-since (unmodified)' '
163
+ test_expect_success DATE_PARSER ' modification: snapshot if-modified-since (unmodified)' '
157
164
export HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
158
165
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
159
166
gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
160
167
grep "Status: 304 Not Modified" gitweb.headers
161
168
'
162
169
test_debug ' cat gitweb.headers'
163
170
164
- test_expect_success ' modification: tree snapshot' '
171
+ test_expect_success DATE_PARSER ' modification: tree snapshot' '
165
172
ID=`git rev-parse --verify HEAD^{tree}` &&
166
173
export HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
167
174
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
0 commit comments