aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-02-08 01:21:03 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-02-08 01:21:03 +0000
commitce1649564c3dc5efc0d8958f77d9cbc6fb2f742d (patch)
treebbfd8570ac0c67dd3800b04abcce91995b96ced8 /tests
parentd76a74cc5e6256b7f6e396a12bf7be9ce2169cdc (diff)
Added tests 1022 and 1023 to validate output of curl-config --version and
--vernum
Diffstat (limited to 'tests')
-rw-r--r--tests/data/Makefile.am2
-rw-r--r--tests/libtest/Makefile.am2
-rwxr-xr-xtests/libtest/test1013.pl5
-rwxr-xr-xtests/libtest/test1022.pl45
4 files changed, 50 insertions, 4 deletions
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index 7a976f9d3..826b557a6 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -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; \
diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
index a808a673f..65c987d1e 100644
--- a/tests/libtest/Makefile.am
+++ b/tests/libtest/Makefile.am
@@ -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
diff --git a/tests/libtest/test1013.pl b/tests/libtest/test1013.pl
index b46e5ae3a..6127df82a 100755
--- a/tests/libtest/test1013.pl
+++ b/tests/libtest/test1013.pl
@@ -1,8 +1,9 @@
#!/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;
}
diff --git a/tests/libtest/test1022.pl b/tests/libtest/test1022.pl
new file mode 100755
index 000000000..73bfc5fc3
--- /dev/null
+++ b/tests/libtest/test1022.pl
@@ -0,0 +1,45 @@
+#!/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;
+}