summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2012-04-04 20:46:49 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2012-04-04 20:46:49 +0000
commit75c3c92f197406d14eb213e30a07955928517399 (patch)
tree6ec908c62bfc2115e32c3e747e90ad14f3552744 /tools
parent02e0b847f15c5045bbf15b13d555c619fc8b36c9 (diff)
downloadwireshark-75c3c92f197406d14eb213e30a07955928517399.tar.gz
Add a "-build" argument to checkAPIs.pl. Use that argument when building
from makefiles (and thus from the buildbot). The intention is to be able to tell when a human is running the tool so we can provide more code-review guidance. As a starter, enable the "too many proto_tree_add_text() calls" check when a human is running the tool. svn path=/trunk/; revision=41943
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkAPIs.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index a31f3d5be6..536fc910c5 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -1324,7 +1324,7 @@ sub checkAddTextCalls($$)
$okay_add_text_count++;
}
# Then count how many proto_tree_add_*() calls there are
- while (${$fileContentsRef} =~ m/ \W proto_tree_add_[a-z]+ \W* \( /gox) {
+ while (${$fileContentsRef} =~ m/ \W proto_tree_add_[a-z0-9]+ \W* \( /gox) {
$add_xxx_count++;
}
@@ -1633,6 +1633,7 @@ my $check_value_string_array_null_termination = 1; # default: enabled
my $machine_readable_output = 0; # default: disabled
my $check_hf = 1; # default: enabled
my $debug_flag = 0;
+my $buildbot_flag = 0;
my $result = GetOptions(
'group=s' => \@apiGroups,
@@ -1640,6 +1641,7 @@ my $result = GetOptions(
'check-value-string-array-null-termination!' => \$check_value_string_array_null_termination,
'Machine-readable' => \$machine_readable_output,
'nohf' => \$check_hf,
+ 'build' => \$buildbot_flag,
'debug' => \$debug_flag
);
if (!$result) {
@@ -1730,7 +1732,9 @@ while ($_ = $ARGV[0])
# print STDERR "Found APIs with embedded tvb_get_ptr() calls in ".$filename.": ".join(',', @foundAPIs)."\n"
#}
- #checkAddTextCalls(\$fileContents, $filename);
+ if (! $buildbot_flag) {
+ checkAddTextCalls(\$fileContents, $filename);
+ }
# Brute force check for value_string arrays which are missing {0, NULL} as the final (terminating) array entry
if ($check_value_string_array_null_termination) {