Skip to content

Commit

Permalink
test: Remove TestBase and TestBaseWithParam now that we have a global…
Browse files Browse the repository at this point in the history
… test-method listener. (envoyproxy#5936)

Signed-off-by: Joshua Marantz <[email protected]>
  • Loading branch information
jmarantz authored and mattklein123 committed Feb 17, 2019
1 parent dfd2c0b commit 90a7a3e
Show file tree
Hide file tree
Showing 417 changed files with 851 additions and 743 deletions.
2 changes: 2 additions & 0 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ envoy_cc_test_library(
name = "main",
srcs = [
"main.cc",
"test_listener.cc",
"test_runner.h",
],
hdrs = ["test_listener.h"],
external_deps = [
"abseil_symbolize",
],
Expand Down
2 changes: 1 addition & 1 deletion test/common/access_log/access_log_formatter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include "test/mocks/stream_info/mocks.h"
#include "test/mocks/upstream/mocks.h"
#include "test/test_common/printers.h"
#include "test/test_common/test_base.h"
#include "test/test_common/utility.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"

using testing::_;
using testing::Const;
Expand Down
4 changes: 2 additions & 2 deletions test/common/access_log/access_log_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include "test/mocks/server/mocks.h"
#include "test/mocks/upstream/mocks.h"
#include "test/test_common/printers.h"
#include "test/test_common/test_base.h"
#include "test/test_common/utility.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"

using testing::_;
using testing::NiceMock;
Expand All @@ -48,7 +48,7 @@ envoy::config::filter::accesslog::v2::AccessLog parseAccessLogFromV2Yaml(const s
return access_log;
}

class AccessLogImplTest : public TestBase {
class AccessLogImplTest : public testing::Test {
public:
AccessLogImplTest() : file_(new Filesystem::MockFile()) {
ON_CALL(context_, runtime()).WillByDefault(ReturnRef(runtime_));
Expand Down
2 changes: 1 addition & 1 deletion test/common/access_log/access_log_manager_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include "test/mocks/api/mocks.h"
#include "test/mocks/event/mocks.h"
#include "test/mocks/filesystem/mocks.h"
#include "test/test_common/test_base.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"

using testing::_;
using testing::Return;
Expand Down
3 changes: 2 additions & 1 deletion test/common/buffer/buffer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

#include "test/common/buffer/utility.h"
#include "test/test_common/printers.h"
#include "test/test_common/test_base.h"
#include "test/test_common/utility.h"

#include "gtest/gtest.h"

namespace Envoy {
namespace Buffer {
namespace {
Expand Down
4 changes: 2 additions & 2 deletions test/common/buffer/owned_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#include "common/buffer/buffer_impl.h"

#include "test/mocks/api/mocks.h"
#include "test/test_common/test_base.h"
#include "test/test_common/threadsafe_singleton_injector.h"

#include "absl/strings/str_cat.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

using testing::_;
using testing::Return;
Expand All @@ -15,7 +15,7 @@ namespace Envoy {
namespace Buffer {
namespace {

class OwnedImplTest : public TestBase {
class OwnedImplTest : public testing::Test {
public:
bool release_callback_called_ = false;
};
Expand Down
2 changes: 1 addition & 1 deletion test/common/buffer/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "common/buffer/buffer_impl.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {
namespace Buffer {
Expand Down
4 changes: 2 additions & 2 deletions test/common/buffer/watermark_buffer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#include "common/buffer/buffer_impl.h"
#include "common/buffer/watermark_buffer.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {
namespace Buffer {
namespace {

const char TEN_BYTES[] = "0123456789";

class WatermarkBufferTest : public TestBase {
class WatermarkBufferTest : public testing::Test {
public:
WatermarkBufferTest() { buffer_.setWatermarks(5, 10); }

Expand Down
4 changes: 2 additions & 2 deletions test/common/buffer/zero_copy_input_stream_test.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "common/buffer/buffer_impl.h"
#include "common/buffer/zero_copy_input_stream_impl.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {
namespace Buffer {
namespace {

class ZeroCopyInputStreamTest : public TestBase {
class ZeroCopyInputStreamTest : public testing::Test {
public:
ZeroCopyInputStreamTest() {
Buffer::OwnedImpl buffer{"abcd"};
Expand Down
3 changes: 2 additions & 1 deletion test/common/common/assert_test.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "common/common/assert.h"

#include "test/test_common/logging.h"
#include "test/test_common/test_base.h"

#include "gtest/gtest.h"

namespace Envoy {

Expand Down
3 changes: 2 additions & 1 deletion test/common/common/backoff_strategy_test.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "common/common/backoff_strategy.h"

#include "test/mocks/runtime/mocks.h"
#include "test/test_common/test_base.h"

#include "gtest/gtest.h"

using testing::NiceMock;
using testing::Return;
Expand Down
3 changes: 2 additions & 1 deletion test/common/common/base64_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "common/common/base64.h"

#include "test/test_common/printers.h"
#include "test/test_common/test_base.h"

#include "gtest/gtest.h"

namespace Envoy {
TEST(Base64Test, EmptyBufferEncode) {
Expand Down
5 changes: 2 additions & 3 deletions test/common/common/block_memory_hash_set_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
#include "common/common/hash.h"
#include "common/stats/stats_options_impl.h"

#include "test/test_common/test_base.h"

#include "absl/strings/string_view.h"
#include "gtest/gtest.h"

namespace Envoy {

// Tests BlockMemoryHashSet.
class BlockMemoryHashSetTest : public TestBase {
class BlockMemoryHashSetTest : public testing::Test {
protected:
// TestValue that doesn't define a hash.
struct TestValueBase {
Expand Down
5 changes: 2 additions & 3 deletions test/common/common/callback_impl_test.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#include "common/common/callback_impl.h"

#include "test/test_common/test_base.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"

using testing::InSequence;

namespace Envoy {
namespace Common {

class CallbackManagerTest : public TestBase {
class CallbackManagerTest : public testing::Test {
public:
MOCK_METHOD1(called, void(int arg));
};
Expand Down
2 changes: 1 addition & 1 deletion test/common/common/cleanup_test.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "common/common/cleanup.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {

Expand Down
3 changes: 1 addition & 2 deletions test/common/common/fmt_test.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "common/common/fmt.h"
#include "common/common/logger.h"

#include "test/test_common/test_base.h"

#include "absl/strings/string_view.h"
#include "gtest/gtest.h"

namespace Envoy {

Expand Down
2 changes: 1 addition & 1 deletion test/common/common/hash_test.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "common/common/hash.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {
TEST(Hash, xxHash) {
Expand Down
2 changes: 1 addition & 1 deletion test/common/common/hex_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "common/common/hex.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {
TEST(Hex, SimpleEncode) {
Expand Down
4 changes: 2 additions & 2 deletions test/common/common/lock_guard_test.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "common/common/lock_guard.h"
#include "common/common/thread.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {
namespace Thread {

class ThreadTest : public TestBase {
class ThreadTest : public testing::Test {
protected:
ThreadTest() : a_(0), b_(0) {}
int a_ GUARDED_BY(a_mutex_);
Expand Down
2 changes: 1 addition & 1 deletion test/common/common/log_macros_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#include "test/mocks/http/mocks.h"
#include "test/mocks/network/mocks.h"
#include "test/test_common/test_base.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace Envoy {

Expand Down
2 changes: 1 addition & 1 deletion test/common/common/matchers_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "common/config/metadata.h"
#include "common/protobuf/protobuf.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {
namespace Matcher {
Expand Down
4 changes: 2 additions & 2 deletions test/common/common/mutex_tracer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "common/common/mutex_tracer_impl.h"

#include "test/test_common/contention.h"
#include "test/test_common/test_base.h"

#include "absl/synchronization/mutex.h"
#include "gtest/gtest.h"

namespace Envoy {

class MutexTracerTest : public TestBase {
class MutexTracerTest : public testing::Test {
protected:
void SetUp() override { tracer_.reset(); }

Expand Down
2 changes: 1 addition & 1 deletion test/common/common/perf_annotation_disabled_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "common/common/perf_annotation.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {

Expand Down
4 changes: 2 additions & 2 deletions test/common/common/perf_annotation_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

#include "common/common/perf_annotation.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {

class PerfAnnotationTest : public TestBase {
class PerfAnnotationTest : public testing::Test {
protected:
void TearDown() override { PERF_CLEAR(); }
};
Expand Down
2 changes: 1 addition & 1 deletion test/common/common/phantom_test.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "common/common/phantom.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {

Expand Down
3 changes: 1 addition & 2 deletions test/common/common/stack_array_test.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "common/common/stack_array.h"

#include "test/test_common/test_base.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace Envoy {

Expand Down
2 changes: 1 addition & 1 deletion test/common/common/to_lower_table_test.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "common/common/to_lower_table.h"

#include "test/test_common/test_base.h"
#include "gtest/gtest.h"

namespace Envoy {
TEST(ToLowerTableTest, All) {
Expand Down
5 changes: 3 additions & 2 deletions test/common/common/token_bucket_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
#include "common/common/token_bucket_impl.h"

#include "test/test_common/simulated_time_system.h"
#include "test/test_common/test_base.h"

#include "gtest/gtest.h"

namespace Envoy {

class TokenBucketImplTest : public TestBase {
class TokenBucketImplTest : public testing::Test {
protected:
Event::SimulatedTimeSystem time_system_;
};
Expand Down
2 changes: 1 addition & 1 deletion test/common/common/utility_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

#include "common/common/utility.h"

#include "test/test_common/test_base.h"
#include "test/test_common/test_time.h"
#include "test/test_common/utility.h"

#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

using testing::ContainerEq;

Expand Down
5 changes: 3 additions & 2 deletions test/common/compressor/zlib_compressor_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
#include "common/common/stack_array.h"
#include "common/compressor/zlib_compressor_impl.h"

#include "test/test_common/test_base.h"
#include "test/test_common/utility.h"

#include "gtest/gtest.h"

namespace Envoy {
namespace Compressor {
namespace {

class ZlibCompressorImplTest : public TestBase {
class ZlibCompressorImplTest : public testing::Test {
protected:
void expectValidFlushedBuffer(const Buffer::OwnedImpl& output_buffer) {
uint64_t num_comp_slices = output_buffer.getRawSlices(nullptr, 0);
Expand Down
Loading

0 comments on commit 90a7a3e

Please sign in to comment.