test1135: verify the CURL_EXTERN order in header files

This commit is contained in:
Daniel Stenberg 2015-02-02 23:32:38 +01:00
parent 6f494c5e34
commit 8f369c53cf
3 changed files with 154 additions and 1 deletions

View File

@ -117,7 +117,7 @@ test1096 test1097 test1098 test1099 test1100 test1101 test1102 test1103 \
test1104 test1105 test1106 test1107 test1108 test1109 test1110 test1111 \
test1112 test1113 test1114 test1115 test1116 test1117 test1118 test1119 \
test1120 test1121 test1122 test1123 test1124 test1125 test1126 test1127 \
test1128 test1129 test1130 test1131 test1132 test1133 test1134 \
test1128 test1129 test1130 test1131 test1132 test1133 test1134 test1135 \
\
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \

93
tests/data/test1135 Normal file
View File

@ -0,0 +1,93 @@
<testcase>
<info>
<keywords>
source analysis
CURL_EXTERN
</keywords>
</info>
#
# Client-side
<client>
<server>
none
</server>
# The VMS and OS/400 builds extract the CURL_EXTERN protos and use in
# the build. We break binary compatibility by changing order. Only add
# new entries last or bump the SONAME.
#
<name>
Verify CURL_EXTERN order
</name>
<command type="perl">
%SRCDIR/extern-scan.pl %SRCDIR/..
</command>
</client>
<verify>
<stdout>
CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);
CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
CURL_EXTERN void curl_formfree(struct curl_httppost *form);
CURL_EXTERN char *curl_getenv(const char *variable);
CURL_EXTERN char *curl_version(void);
CURL_EXTERN char *curl_easy_escape(CURL *handle,
CURL_EXTERN char *curl_escape(const char *string,
CURL_EXTERN char *curl_easy_unescape(CURL *handle,
CURL_EXTERN char *curl_unescape(const char *string,
CURL_EXTERN void curl_free(void *p);
CURL_EXTERN CURLcode curl_global_init(long flags);
CURL_EXTERN CURLcode curl_global_init_mem(long flags,
CURL_EXTERN void curl_global_cleanup(void);
CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
CURL_EXTERN CURLSH *curl_share_init(void);
CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
CURL_EXTERN const char *curl_easy_strerror(CURLcode);
CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
CURL_EXTERN CURL *curl_easy_init(void);
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
CURL_EXTERN void curl_easy_reset(CURL *curl);
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
CURL_EXTERN int curl_mprintf(const char *format, ...);
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
CURL_EXTERN char *curl_maprintf(const char *format, ...);
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
CURL_EXTERN CURLM *curl_multi_init(void);
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
</stdout>
</verify>
</testcase>

60
tests/extern-scan.pl Executable file
View File

@ -0,0 +1,60 @@
#!/usr/bin/env perl
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2010-2015, 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 http://curl.haxx.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.
#
###########################################################################
#
#
use strict;
use warnings;
# we may get the dir root pointed out
my $root=$ARGV[0] || ".";
my @incs = (
"$root/include/curl/curl.h",
"$root/include/curl/easy.h",
"$root/include/curl/mprintf.h",
"$root/include/curl/multi.h",
);
my $verbose=0;
my $summary=0;
my $misses=0;
my @syms;
my %doc;
my %rem;
sub scanheader {
my ($f)=@_;
open H, "<$f" || die;
while(<H>) {
if (/^(CURL_EXTERN.*)/) {
print "$1\n";
}
}
close H;
}
foreach my $i (@incs) {
scanheader($i);
}