summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-01-08 14:56:37 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-08 20:08:44 +0000
commit625de446907e8720f0114422683b78a898dd6878 (patch)
treeaa978281f02ac33cdfb841e41fa445c9d2028aac /testing
parent0c53b008b4f2f7a790f756d706a00e8de98dfedd (diff)
downloadpdfium-625de446907e8720f0114422683b78a898dd6878.tar.xz
Make api_check.py warning more informative about what needs to be fixed.
Currently the warning does not mention that fpdfview_c_api_test.c needs to be updated, and someone unfamiliar with the code needs to ask of dig into the warning script to find what went wrong. Change-Id: I56848438959ec64b0eab978d2e3638d4d4dc8e49 Reviewed-on: https://pdfium-review.googlesource.com/22430 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'testing')
-rwxr-xr-xtesting/tools/api_check.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/testing/tools/api_check.py b/testing/tools/api_check.py
index 29754e4b56..ee769bcda5 100755
--- a/testing/tools/api_check.py
+++ b/testing/tools/api_check.py
@@ -101,7 +101,8 @@ def main():
src_path = os.path.dirname(os.path.dirname(os.path.dirname(script_abspath)))
public_functions = _GetFunctionsFromPublicHeaders(src_path)
- api_test_path = os.path.join(src_path, 'fpdfsdk', 'fpdfview_c_api_test.c')
+ api_test_relative_path = os.path.join('fpdfsdk', 'fpdfview_c_api_test.c')
+ api_test_path = os.path.join(src_path, api_test_relative_path)
test_functions = _GetFunctionsFromTest(api_test_path)
result = True
@@ -124,7 +125,13 @@ def main():
check = _CheckAndPrintFailures(non_existent, 'Tested functions do not exist')
result = result and check
- return 0 if result else 1
+ if not result:
+ print ('Some checks failed. Make sure %s is in sync with the public API '
+ 'headers.'
+ % api_test_relative_path);
+ return 1
+
+ return 0
if __name__ == '__main__':