20 os.chdir(os.path.join(os.path.dirname(sys.argv[0]),
'../../..'))
23 "include/grpc++/create_channel_posix.h",
"include/grpc++/server_builder.h",
24 "include/grpc++/resource_quota.h",
"include/grpc++/create_channel.h",
25 "include/grpc++/alarm.h",
"include/grpc++/server.h",
26 "include/grpc++/server_context.h",
"include/grpc++/client_context.h",
27 "include/grpc++/server_posix.h",
"include/grpc++/grpc++.h",
28 "include/grpc++/health_check_service_interface.h",
29 "include/grpc++/completion_queue.h",
"include/grpc++/channel.h",
30 "include/grpc++/support/sync_stream.h",
"include/grpc++/support/status.h",
31 "include/grpc++/support/config.h",
32 "include/grpc++/support/status_code_enum.h",
33 "include/grpc++/support/byte_buffer.h",
34 "include/grpc++/support/error_details.h",
35 "include/grpc++/support/async_unary_call.h",
36 "include/grpc++/support/channel_arguments.h",
37 "include/grpc++/support/async_stream.h",
"include/grpc++/support/slice.h",
38 "include/grpc++/support/stub_options.h",
39 "include/grpc++/support/string_ref.h",
"include/grpc++/support/time.h",
40 "include/grpc++/security/auth_metadata_processor.h",
41 "include/grpc++/security/credentials.h",
42 "include/grpc++/security/server_credentials.h",
43 "include/grpc++/security/auth_context.h",
44 "include/grpc++/impl/rpc_method.h",
45 "include/grpc++/impl/server_builder_option.h",
"include/grpc++/impl/call.h",
46 "include/grpc++/impl/service_type.h",
"include/grpc++/impl/grpc_library.h",
47 "include/grpc++/impl/client_unary_call.h",
48 "include/grpc++/impl/channel_argument_option.h",
49 "include/grpc++/impl/rpc_service_method.h",
50 "include/grpc++/impl/method_handler_impl.h",
51 "include/grpc++/impl/server_builder_plugin.h",
52 "include/grpc++/impl/server_initializer.h",
53 "include/grpc++/impl/serialization_traits.h",
54 "include/grpc++/impl/codegen/sync_stream.h",
55 "include/grpc++/impl/codegen/channel_interface.h",
56 "include/grpc++/impl/codegen/config_protobuf.h",
57 "include/grpc++/impl/codegen/status.h",
58 "include/grpc++/impl/codegen/core_codegen.h",
59 "include/grpc++/impl/codegen/config.h",
60 "include/grpc++/impl/codegen/core_codegen_interface.h",
61 "include/grpc++/impl/codegen/status_code_enum.h",
62 "include/grpc++/impl/codegen/metadata_map.h",
63 "include/grpc++/impl/codegen/rpc_method.h",
64 "include/grpc++/impl/codegen/server_context.h",
65 "include/grpc++/impl/codegen/byte_buffer.h",
66 "include/grpc++/impl/codegen/async_unary_call.h",
67 "include/grpc++/impl/codegen/server_interface.h",
68 "include/grpc++/impl/codegen/call.h",
69 "include/grpc++/impl/codegen/client_context.h",
70 "include/grpc++/impl/codegen/service_type.h",
71 "include/grpc++/impl/codegen/grpc_library.h",
72 "include/grpc++/impl/codegen/async_stream.h",
73 "include/grpc++/impl/codegen/slice.h",
74 "include/grpc++/impl/codegen/client_unary_call.h",
75 "include/grpc++/impl/codegen/proto_utils.h",
76 "include/grpc++/impl/codegen/stub_options.h",
77 "include/grpc++/impl/codegen/rpc_service_method.h",
78 "include/grpc++/impl/codegen/method_handler_impl.h",
79 "include/grpc++/impl/codegen/string_ref.h",
80 "include/grpc++/impl/codegen/completion_queue_tag.h",
81 "include/grpc++/impl/codegen/call_hook.h",
82 "include/grpc++/impl/codegen/completion_queue.h",
83 "include/grpc++/impl/codegen/serialization_traits.h",
84 "include/grpc++/impl/codegen/create_auth_context.h",
85 "include/grpc++/impl/codegen/time.h",
86 "include/grpc++/impl/codegen/security/auth_context.h",
87 "include/grpc++/ext/health_check_service_server_builder_option.h",
88 "include/grpc++/ext/proto_server_reflection_plugin.h",
89 "include/grpc++/generic/async_generic_service.h",
90 "include/grpc++/generic/generic_stub.h",
91 "include/grpc++/test/mock_stream.h",
92 "include/grpc++/test/server_context_test_spouse.h"
97 * Copyright 2018 gRPC authors.
99 * Licensed under the Apache License, Version 2.0 (the "License");
100 * you may not use this file except in compliance with the License.
101 * You may obtain a copy of the License at
103 * http://www.apache.org/licenses/LICENSE-2.0
105 * Unless required by applicable law or agreed to in writing, software
106 * distributed under the License is distributed on an "AS IS" BASIS,
107 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
108 * See the License for the specific language governing permissions and
109 * limitations under the License.
113 // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the
114 // headers in include/grpcpp instead. This header exists only for backwards
117 #ifndef GRPCXX_FILE_PATH_NAME_UPPER
118 #define GRPCXX_FILE_PATH_NAME_UPPER
120 #include <grpcpp/FILE_PATH_NAME_LOWER>
122 #endif // GRPCXX_FILE_PATH_NAME_UPPER
128 for root, dirs, files
in os.walk(
'include/grpc++'):
129 for filename
in files:
130 path_file = os.path.join(root, filename)
131 path_files.append(path_file)
133 if path_files.sort() != expected_files.sort():
134 diff_plus = [file
for file
in path_files
if file
not in expected_files]
135 diff_minus = [file
for file
in expected_files
if file
not in path_files]
136 for file
in diff_minus:
138 for file
in diff_plus:
145 for path_file
in expected_files:
146 relative_path_file = path_file.split(
'/', 2)[2]
148 replace_lower = relative_path_file.replace(
'+',
'p')
150 replace_upper = relative_path_file.replace(
'/',
'_')
151 replace_upper = replace_upper.replace(
'.',
'_')
152 replace_upper = replace_upper.upper().replace(
'+',
'X')
154 expected_content = file_template.replace(
'FILE_PATH_NAME_LOWER',
156 expected_content = expected_content.replace(
'FILE_PATH_NAME_UPPER',
159 path_file_expected = path_file +
'.expected'
160 with open(path_file_expected,
"w")
as fo:
161 fo.write(expected_content)
163 if 0 != os.system(
'diff %s %s' % (path_file_expected, path_file)):
164 print((
'Difference found in file:', path_file))
167 os.remove(path_file_expected)
169 check_extensions = [
".h",
".cc",
".c",
".m"]
171 for root, dirs, files
in os.walk(
'src'):
172 for filename
in files:
173 path_file = os.path.join(root, filename)
174 for ext
in check_extensions:
175 if path_file.endswith(ext):
177 with open(path_file,
"r")
as fi:
179 if '#include <grpc++/' in content:
181 'Failed: invalid include of deprecated headers in include/grpc++ in %s'