1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

tests: made a couple of prechecks consistent with others

Also removed a TODO suggesting caching the precheck results. Tests
showed this would save about 0.1 sec on the total test run time on a
relatively modern system, an unnoticeable gain at the cost of longer and
more complicated code. There would also be a danger that a cached test
result would be inappropriately returned, such as when other test
dependencies (like environment variables) are different or when the
precheck causes side effects (like filesystem changes).
This commit is contained in:
Dan Fandrich 2017-05-13 19:04:10 +02:00
parent 6d49695bca
commit fa0ac3f4d9
3 changed files with 2 additions and 7 deletions

View File

@ -35,7 +35,7 @@ HTTP with cookie parser and header recording
"http://%HOSTIP:%HTTPPORT/we/want/1105?parm1=this*that/other/thing&parm2=foobar/1105" -c log/cookie1105.txt -d "userid=myname&password=mypassword" "http://%HOSTIP:%HTTPPORT/we/want/1105?parm1=this*that/other/thing&parm2=foobar/1105" -c log/cookie1105.txt -d "userid=myname&password=mypassword"
</command> </command>
<precheck> <precheck>
perl -e 'if ("%HOSTIP" !~ /127\.0\.0\.1$/) {print "Test only works for HOSTIP 127.0.0.1"; exit(1)}' perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
</precheck> </precheck>
</client> </client>

View File

@ -80,7 +80,7 @@ TZ=GMT
http://%HOSTIP:%HTTPPORT/we/want/31 -b none -c log/jar31.txt http://%HOSTIP:%HTTPPORT/we/want/31 -b none -c log/jar31.txt
</command> </command>
<precheck> <precheck>
perl -e 'if ("%HOSTIP" !~ /127\.0\.0\.1$/) {print "Test only works for HOSTIP 127.0.0.1"; exit(1)}' perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
</precheck> </precheck>
</client> </client>

View File

@ -3279,11 +3279,6 @@ sub singletest {
} }
if(!$why) { if(!$why) {
# TODO:
# Add a precheck cache. If a precheck command was already invoked
# exactly like this, then use the previous result to speed up
# successive test invokes!
my @precheck = getpart("client", "precheck"); my @precheck = getpart("client", "precheck");
if(@precheck) { if(@precheck) {
$cmd = $precheck[0]; $cmd = $precheck[0];