]> granicus.if.org Git - curl/commitdiff
Added test case 1013 to check that curl-config --protocols matches the
authorDan Fandrich <dan@coneharvesters.com>
Thu, 1 Nov 2007 00:36:55 +0000 (00:36 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 1 Nov 2007 00:36:55 +0000 (00:36 +0000)
protocols listed in curl --version

CHANGES
tests/data/Makefile.am
tests/data/test1013 [new file with mode: 0644]
tests/libtest/Makefile.am
tests/libtest/test1013.pl [new file with mode: 0755]

diff --git a/CHANGES b/CHANGES
index 4a5814a4e785a6de261c9513575c3130aedabeef..afb163e550bf06b6284b902188f9804740c17719 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,9 @@ Dan F (31 October 2007)
 - Fixed the output of curl-config --protocols which showed SCP and SFTP
   always, except when --without-libssh2 was given
 
+- Added test case 1013 to check that curl-config --protocols matches the
+  protocols listed in curl --version
+
 Dan F (30 October 2007)
 - Fixed an OOM problem with file: URLs
 
index ff296f2b91b26070a6c5569b16c5567cbbb117ac..2dbb9ce249a90574e688c77428c3d29b0c973b50 100644 (file)
@@ -46,7 +46,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46           \
  test231 test1000 test1001 test1002 test1003 test1004 test1005 test1006    \
  test615 test1007 test541 test1010 test1011 test1012 test542 test543       \
  test536 test1008 test1009 test2000 test2001 test2002 test2003 test35      \
- test544 test545 test2004 test546
+ test544 test545 test2004 test546 test1013
 
 filecheck:
        @mkdir test-place; \
diff --git a/tests/data/test1013 b/tests/data/test1013
new file mode 100644 (file)
index 0000000..32b4bfe
--- /dev/null
@@ -0,0 +1,31 @@
+<testcase>
+#
+# Server-side
+<reply>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+none
+</server>
+ <name>
+Compare curl --version with curl-config --features
+ </name>
+ <command>
+--version
+</command>
+<postcheck>
+%SRCDIR/libtest/test1013.pl ../curl-config log/stdout1013
+</postcheck>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+2
+</errorcode>
+</verify>
+</testcase>
index 3137e9e063a7e5e769d60bcb1e094f84a5a00226..af21d6da3af9ff9b25fea9ac5f67455cd939c7eb 100644 (file)
@@ -35,7 +35,7 @@ INCLUDES = -I$(top_srcdir)/include/curl \
 
 LIBDIR = $(top_builddir)/lib
 
-EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl
+EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.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
new file mode 100755 (executable)
index 0000000..8e5c736
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/env perl
+# Determine if curl-config --protocols matches the curl --version protocols
+if ( $#ARGV != 1 ) 
+{
+       print "Usage: $0 curl-config-script curl-features-file\n";
+       exit 3;
+}
+
+my $curl_protocols="";
+open(CURL, "@ARGV[1]") || die "Can't get curl protocols list\n";
+while( <CURL> )
+{
+    $curl_protocols = $_ if ( /Protocols:/ );
+}
+close CURL;
+
+$curl_protocols =~ /Protocols: (.*)$/;
+@curl = split / /,$1;
+@curl = sort @curl;
+
+my @curl_config;
+open(CURLCONFIG, "sh @ARGV[0] --protocols|") || die "Can't get curl-config protocols list\n";
+while( <CURLCONFIG> )
+{
+    chomp;
+    push @curl_config, lc($_);
+}
+close CURLCONFIG;
+
+@curl_config = sort @curl_config;
+
+my $curlproto = join ' ', @curl;
+my $curlconfigproto = join ' ', @curl_config;
+
+my $different = $curlproto ne $curlconfigproto;
+if ($different) {
+       print "Mismatch in protocol lists:\n";
+       print "curl:        $curlproto\n";
+       print "curl-config: $curlconfigproto\n";
+}
+exit $different;