summaryrefslogtreecommitdiff
path: root/tests/symbol-scan.pl
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2010-11-19 15:54:21 -0800
committerDan Fandrich <dan@coneharvesters.com>2010-11-19 15:54:21 -0800
commit1bb05ac16f0c2df768061d8c32d5ae827acd2946 (patch)
treed1defc563830f62ddf44784a023b699a185b6ff2 /tests/symbol-scan.pl
parent091c52fef7636020522334f7eff58701f5fd8489 (diff)
downloadcurl-1bb05ac16f0c2df768061d8c32d5ae827acd2946.tar.gz
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.
Diffstat (limited to 'tests/symbol-scan.pl')
-rw-r--r--tests/symbol-scan.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/symbol-scan.pl b/tests/symbol-scan.pl
index f12660339..dea1f73b8 100644
--- a/tests/symbol-scan.pl
+++ b/tests/symbol-scan.pl
@@ -28,6 +28,10 @@
# we may get the dir root pointed out
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 $mh = "$root/include/curl/multi.h";
@@ -35,7 +39,7 @@ my $verbose=0;
my $summary=0;
my $misses=0;
-open H_IN, "-|", "cpp " . $h;
+open H_IN, "-|", "cpp $i$h" || die "Cannot preprocess curl.h";
while ( <H_IN> ) {
if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
s/^\s+//;
@@ -45,7 +49,8 @@ while ( <H_IN> ) {
push @syms, $_;
}
}
-close H_IN;
+close H_IN || die "Error preprocessing curl.h";
+
sub scanheader {
my ($f)=@_;
open H, "<$f";