aboutsummaryrefslogtreecommitdiff
path: root/tests/disable-scan.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-11-11 17:16:04 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-11-12 09:35:39 +0100
commitcbaaae44fee13767a2436cc358348236342fbb9c (patch)
tree7aed9b0c3f5b40afc5c03ce04fed02614a5f1baa /tests/disable-scan.pl
parent13182b33f727cf5a56a5a13419904369f7f3baad (diff)
CURL-DISABLE: initial docs for the CURL_DISABLE_* defines
The disable-scan script used in test 1165 is extended to also verify that the docs cover all used defines and all defines offered by configure. Reported-by: SLDiggie on github Fixes #4545 Closes #4587
Diffstat (limited to 'tests/disable-scan.pl')
-rwxr-xr-xtests/disable-scan.pl37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/disable-scan.pl b/tests/disable-scan.pl
index e57fdc697..45373ca40 100755
--- a/tests/disable-scan.pl
+++ b/tests/disable-scan.pl
@@ -29,9 +29,12 @@ use warnings;
my %disable;
# the DISABLE options that are used in C files
my %file;
+# the DISABLE options that are documented
+my %docs;
# we may get the dir root pointed out
my $root=$ARGV[0] || ".";
+my $DOCS="CURL-DISABLE.md";
sub scan_configure {
open S, "<$root/configure.ac";
@@ -73,8 +76,22 @@ sub scan_sources {
scan_dir("$root/lib/vauth");
}
+sub scan_docs {
+ open F, "<$root/docs/$DOCS";
+ my $line = 0;
+ while(<F>) {
+ $line++;
+ if(/^## (CURL_DISABLE_[A-Z_]+)/g) {
+ my ($sym)=($1);
+ $docs{$sym} = $line;
+ }
+ }
+ close F;
+}
+
scan_configure();
scan_sources();
+scan_docs();
my $error = 0;
@@ -84,6 +101,10 @@ for my $s (sort keys %disable) {
printf "Present in configure.ac, not used by code: %s\n", $s;
$error++;
}
+ if(!$docs{$s}) {
+ printf "Present in configure.ac, not documented in $DOCS: %s\n", $s;
+ $error++;
+ }
}
# Check the code symbols for use in configure
@@ -92,6 +113,22 @@ for my $s (sort keys %file) {
printf "Not set by configure: %s (%s)\n", $s, $file{$s};
$error++;
}
+ if(!$docs{$s}) {
+ printf "Used in code, not documented in $DOCS: %s\n", $s;
+ $error++;
+ }
+}
+
+# Check the documented symbols
+for my $s (sort keys %docs) {
+ if(!$disable{$s}) {
+ printf "Documented but not in configure: %s\n", $s;
+ $error++;
+ }
+ if(!$file{$s}) {
+ printf "Documented, but not used by code: %s\n", $s;
+ $error++;
+ }
}
exit $error;