aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/sanity
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-02-21 10:00:45 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-02-21 13:28:26 -0800
commit618a0078aeee488b259123883deeeb403d70a554 (patch)
tree471b8f30cb7160c8368c8dcb88afdd9f81095aa4 /tools/run_tests/sanity
parent5262c087d88123c0f69603f42b6401a4b8fa9282 (diff)
Check sanity of src directory
Diffstat (limited to 'tools/run_tests/sanity')
-rwxr-xr-xtools/run_tests/sanity/check_deprecated_grpc++.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/run_tests/sanity/check_deprecated_grpc++.py b/tools/run_tests/sanity/check_deprecated_grpc++.py
index e0779ba0e5..4ec49fae39 100755
--- a/tools/run_tests/sanity/check_deprecated_grpc++.py
+++ b/tools/run_tests/sanity/check_deprecated_grpc++.py
@@ -170,4 +170,22 @@ for path_file in expected_files:
os.remove(path_file_expected)
+check_extensions = [".h", ".cc", ".c", ".m"]
+
+for root, dirs, files in os.walk('src'):
+ for filename in files:
+ path_file = os.path.join(root, filename)
+ for ext in check_extensions:
+ if path_file.endswith(ext):
+ try:
+ with open(path_file, "r") as fi:
+ content = fi.read()
+ if '#include <grpc++/' in content:
+ print(
+ 'Failed: invalid include of deprecated headers in include/grpc++ in %s'
+ % path_file)
+ errors += 1
+ except IOError:
+ pass
+
sys.exit(errors)