commit | 9cbd685304be77439559a18cb180a3156315768c | [log] [tgz] |
---|---|---|
author | Vijay Pai <vpai@google.com> | Tue Nov 19 15:23:18 2019 -0800 |
committer | Vijay Pai <vpai@google.com> | Tue Nov 19 15:26:55 2019 -0800 |
tree | a891beccd4018acdc64a314fa9074cdcea6e5a63 | |
parent | 58e0fc8f0803f9c062e97b7b647d96d560abd61e [diff] |
Prevent use of pthread header
diff --git a/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc b/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc index bfe9eab..e644494 100644 --- a/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc +++ b/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc
@@ -21,7 +21,6 @@ #include <fcntl.h> #include <gmock/gmock.h> #include <netinet/in.h> -#include <pthread.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h>
diff --git a/test/cpp/end2end/time_change_test.cc b/test/cpp/end2end/time_change_test.cc index a42b7bf..0669143 100644 --- a/test/cpp/end2end/time_change_test.cc +++ b/test/cpp/end2end/time_change_test.cc
@@ -34,7 +34,6 @@ #include "test/cpp/util/subprocess.h" #include <gtest/gtest.h> -#include <pthread.h> #include <sys/time.h> #include <thread>
diff --git a/tools/run_tests/sanity/cpp_banned_constructs.sh b/tools/run_tests/sanity/cpp_banned_constructs.sh index 14716f0..89a3da6 100755 --- a/tools/run_tests/sanity/cpp_banned_constructs.sh +++ b/tools/run_tests/sanity/cpp_banned_constructs.sh
@@ -38,3 +38,12 @@ include/grpc include/grpcpp src/core src/cpp | \ egrep -v include/grpcpp/impl/codegen/sync.h | \ diff - /dev/null + +# +# Prevent the include of headers that shouldn't be used in tests. +# + +egrep -Irn \ + '^#include (<pthread.h>)' \ + test | \ + diff - /dev/null