test1276: verify lib/optiontable.pl
Checks that it generates an output identical to the file.
This commit is contained in:
Родитель
ea557cfa27
Коммит
3075fdccdd
|
@ -32,10 +32,9 @@ EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl \
|
|||
serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \
|
||||
CMakeLists.txt mem-include-scan.pl valgrind.supp extern-scan.pl \
|
||||
manpage-scan.pl nroff-scan.pl http2-server.pl dictserver.py \
|
||||
negtelnetserver.py smbserver.py util.py \
|
||||
disable-scan.pl manpage-syntax.pl error-codes.pl badsymbols.pl \
|
||||
azure.pm appveyor.pm version-scan.pl options-scan.pl markdown-uppercase.pl \
|
||||
check-deprecated.pl
|
||||
negtelnetserver.py smbserver.py util.py disable-scan.pl manpage-syntax.pl \
|
||||
error-codes.pl badsymbols.pl azure.pm appveyor.pm version-scan.pl \
|
||||
options-scan.pl markdown-uppercase.pl check-deprecated.pl option-check.pl
|
||||
|
||||
DISTCLEANFILES = configurehelp.pm
|
||||
|
||||
|
|
|
@ -153,14 +153,13 @@ test1191 test1192 test1193 test1194 test1195 test1196 test1197 test1198 \
|
|||
test1199 test1200 test1201 test1202 test1203 test1204 test1205 test1206 \
|
||||
test1207 test1208 test1209 test1210 test1211 test1212 test1213 test1214 \
|
||||
test1215 test1216 test1217 test1218 test1219 test1220 test1221 test1222 \
|
||||
test1223 \
|
||||
test1224 test1225 test1226 test1227 test1228 test1229 test1230 test1231 \
|
||||
test1232 test1233 test1234 test1235 test1236 test1237 test1238 test1239 \
|
||||
test1240 test1241 test1242 test1243 test1244 test1245 test1246 test1247 \
|
||||
test1248 test1249 test1250 test1251 test1252 test1253 test1254 test1255 \
|
||||
test1256 test1257 test1258 test1259 test1260 test1261 test1262 test1263 \
|
||||
test1264 test1265 test1266 test1267 test1268 test1269 test1270 test1271 \
|
||||
test1272 test1273 test1274 test1275 \
|
||||
test1223 test1224 test1225 test1226 test1227 test1228 test1229 test1230 \
|
||||
test1231 test1232 test1233 test1234 test1235 test1236 test1237 test1238 \
|
||||
test1239 test1240 test1241 test1242 test1243 test1244 test1245 test1246 \
|
||||
test1247 test1248 test1249 test1250 test1251 test1252 test1253 test1254 \
|
||||
test1255 test1256 test1257 test1258 test1259 test1260 test1261 test1262 \
|
||||
test1263 test1264 test1265 test1266 test1267 test1268 test1269 test1270 \
|
||||
test1271 test1272 test1273 test1274 test1275 test1276 \
|
||||
\
|
||||
test1280 test1281 test1282 test1283 test1284 test1285 test1286 test1287 \
|
||||
test1288 test1289 test1290 test1291 test1292 test1293 test1294 test1295 \
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
source analysis
|
||||
documentation
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
none
|
||||
</server>
|
||||
|
||||
<name>
|
||||
Verify lib/optiontable.pl
|
||||
</name>
|
||||
|
||||
<command type="perl">
|
||||
%SRCDIR/option-check.pl %SRCDIR/..
|
||||
</command>
|
||||
</client>
|
||||
|
||||
</testcase>
|
|
@ -0,0 +1,66 @@
|
|||
#!/usr/bin/env perl
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 2016 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
sub showline {
|
||||
my ($l) = @_;
|
||||
$l =~ s/([^\x20-\x7f])/sprintf "%%%02x", ord $1/eg;
|
||||
return $l;
|
||||
}
|
||||
|
||||
my $root = $ARGV[0];
|
||||
|
||||
open(F, "perl $root/lib/optiontable.pl < $root/include/curl/curl.h|");
|
||||
binmode F;
|
||||
my @gen=<F>;
|
||||
close(F);
|
||||
|
||||
open(F, "<$root/lib/easyoptions.c");
|
||||
binmode F;
|
||||
my @file=<F>;
|
||||
close(F);
|
||||
|
||||
if(join("", @gen) ne join("", @file)) {
|
||||
print "easyoptions.c need to be regenerated!\n";
|
||||
|
||||
printf "easyoptions.c is %u lines\n", scalar(@file);
|
||||
printf "generated file is %u lines\n", scalar(@gen);
|
||||
my $e = 0;
|
||||
for my $i (0 .. $#gen) {
|
||||
# strip CRLFs to unify
|
||||
$gen[$i] =~ s/[\r\n]//g;
|
||||
$file[$i] =~ s/[\r\n]//g;
|
||||
if($gen[$i] ne $file[$i]) {
|
||||
printf "File: %u:%s\nGen: %u:%s\n",
|
||||
$i+1, showline($file[$i]),
|
||||
$i+1, showline($gen[$i]);
|
||||
$e++;
|
||||
if($e > 10) {
|
||||
# only show 10 lines diff
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
exit 1 if($e);
|
||||
}
|
Загрузка…
Ссылка в новой задаче