Commit ce164956 authored by Dan Fandrich's avatar Dan Fandrich
Browse files

Added tests 1022 and 1023 to validate output of curl-config --version and

--vernum
parent d76a74cc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6,6 +6,10 @@

                                  Changelog

Daniel Fandrich (7 Feb 2007)
- Added tests 1022 and 1023 to validate output of curl-config --version and
  --vernum

Daniel S (7 Feb 2008)
- Refactored a lot of timeout code into a few functions in an attempt to make
  them all use the same (hopefully correct) logic to make it less error-prone
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
 test2000 test2001 test2002 test2003 test35 test544 test545 test2004	   \
 test546 test1013 test1014 test1015 test547 test548 test549 test550	   \
 test551 test552 test1016 test1017 test1018 test1019 test1020 test553      \
 test1021
 test1021 test1022 test1023

filecheck:
	@mkdir test-place; \
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ INCLUDES = -I$(top_srcdir)/include/curl \

LIBDIR = $(top_builddir)/lib

EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.pl
EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.pl test1022.pl

# files used only in some libcurl test programs
TESTUTIL = testutil.c testutil.h
+3 −2
Original line number Diff line number Diff line
#!/usr/bin/env perl
# Determine if curl-config --protocols matches the curl --version protocols
# Determine if curl-config --protocols/--features matches the
# curl --version protocols/features
if ( $#ARGV != 2 ) 
{
	print "Usage: $0 curl-config-script curl-features-file features|protocols\n";
	print "Usage: $0 curl-config-script curl-version-output-file features|protocols\n";
	exit 3;
}

+45 −0
Original line number Diff line number Diff line
#!/usr/bin/env perl
# Determine if curl-config --version matches the curl --version
if ( $#ARGV != 2 ) 
{
	print "Usage: $0 curl-config-script curl-version-output-file version|vernum\n";
	exit 3;
}

my $what=$ARGV[2];

# Read the output of curl --version
open(CURL, "$ARGV[1]") || die "Can't open curl --version list in $ARGV[1]\n";
$_ = <CURL>;
chomp;
/libcurl\/([\.\d]+(-CVS)?)/;
my $version = $1;
close CURL;

my $curlconfigversion;

# Read the output of curl-config --version/--vernum
open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config --$what list\n";
$_ = <CURLCONFIG>;
chomp;
if ( $what eq "version" ) {
	/^libcurl ([\.\d]+(-CVS)?)$/ ;
	$curlconfigversion = $1;
}
else {
	# Convert hex version to decimal for comparison's sake
	/^([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{2})$/ ;
	$curlconfigversion = hex($1) . "." . hex($2) . "." . hex($3);

	# Strip off the -CVS from the curl version if it's there
	$version =~ s/-CVS$//;
}
close CURLCONFIG;

my $different = $version ne $curlconfigversion;
if ($different || !$version) {
	print "Mismatch in --version:\n";
	print "curl:        $version\n";
	print "curl-config: $curlconfigversion\n";
	exit 1;
}