Check for errors while preprocessing curl.h in test 1119

This showed a problem when running the test out-of-tree, so
an include path is now being added to pick up the generated
curlbuild.h file.
This commit is contained in:
Dan Fandrich 2010-11-19 15:54:21 -08:00
parent 091c52fef7
commit 1bb05ac16f
2 changed files with 8 additions and 3 deletions

View File

@ -17,7 +17,7 @@ Verify that symbols-in-versions and headers are in sync
</name> </name>
<command type="perl"> <command type="perl">
%SRCDIR/symbol-scan.pl %SRCDIR/.. %SRCDIR/symbol-scan.pl %SRCDIR/.. ../include/curl
</command> </command>
</client> </client>

View File

@ -28,6 +28,10 @@
# we may get the dir root pointed out # we may get the dir root pointed out
my $root=$ARGV[0] || "."; my $root=$ARGV[0] || ".";
# need an include directory when building out-of-tree
my $i=$ARGV[1];
$i="-I$i " if $i;
my $h = "$root/include/curl/curl.h"; my $h = "$root/include/curl/curl.h";
my $mh = "$root/include/curl/multi.h"; my $mh = "$root/include/curl/multi.h";
@ -35,7 +39,7 @@ my $verbose=0;
my $summary=0; my $summary=0;
my $misses=0; my $misses=0;
open H_IN, "-|", "cpp " . $h; open H_IN, "-|", "cpp $i$h" || die "Cannot preprocess curl.h";
while ( <H_IN> ) { while ( <H_IN> ) {
if ( /enum\s+(\S+\s+)?{/ .. /}/ ) { if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
s/^\s+//; s/^\s+//;
@ -45,7 +49,8 @@ while ( <H_IN> ) {
push @syms, $_; push @syms, $_;
} }
} }
close H_IN; close H_IN || die "Error preprocessing curl.h";
sub scanheader { sub scanheader {
my ($f)=@_; my ($f)=@_;
open H, "<$f"; open H, "<$f";