Просмотр исходного кода

Rename //testing/util to base (#3104)

Renaming per #3100
Jon Ross-Perkins 2 лет назад
Родитель
Сommit
fa857e42be

+ 10 - 10
common/BUILD

@@ -29,7 +29,7 @@ cc_test(
     srcs = ["check_test.cpp"],
     deps = [
         ":check",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -54,8 +54,8 @@ cc_test(
     deps = [
         ":enum_base",
         ":enum_base_test_def",
-        "//testing/util:gtest_main",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:gtest_main",
+        "//testing/base:test_raw_ostream",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -75,8 +75,8 @@ cc_test(
     srcs = ["error_test.cpp"],
     deps = [
         ":error",
-        "//testing/util:gtest_main",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:gtest_main",
+        "//testing/base:test_raw_ostream",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -91,7 +91,7 @@ cc_test(
     srcs = ["indirect_value_test.cpp"],
     deps = [
         ":indirect_value",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -106,7 +106,7 @@ cc_test(
     srcs = ["metaprogramming_test.cpp"],
     deps = [
         ":metaprogramming",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],
@@ -137,7 +137,7 @@ cc_test(
     srcs = ["string_helpers_test.cpp"],
     deps = [
         ":string_helpers",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],
@@ -157,8 +157,8 @@ cc_test(
     srcs = ["vlog_test.cpp"],
     deps = [
         ":vlog",
-        "//testing/util:gtest_main",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:gtest_main",
+        "//testing/base:test_raw_ostream",
         "@com_google_googletest//:gtest",
     ],
 )

+ 1 - 1
common/enum_base_test.cpp

@@ -6,7 +6,7 @@
 
 #include <gtest/gtest.h>
 
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 
 namespace Carbon {
 

+ 1 - 1
common/error_test.cpp

@@ -6,7 +6,7 @@
 
 #include <gtest/gtest.h>
 
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 
 namespace Carbon::Testing {
 namespace {

+ 1 - 1
common/vlog_test.cpp

@@ -7,7 +7,7 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 
 namespace Carbon::Testing {
 namespace {

+ 1 - 1
explorer/BUILD

@@ -48,8 +48,8 @@ cc_library(
     deps = [
         ":main",
         "//common:check",
+        "//testing/base:test_raw_ostream",
         "//testing/file_test:file_test_base",
-        "//testing/util:test_raw_ostream",
         "@com_google_absl//absl/flags:flag",
         "@com_googlesource_code_re2//:re2",
     ],

+ 4 - 4
explorer/ast/BUILD

@@ -82,7 +82,7 @@ cc_test(
         ":ast",
         ":ast_test_matchers",
         "//explorer/base:arena",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -94,7 +94,7 @@ cc_test(
         ":ast",
         ":paren_contents",
         "//explorer/base:arena",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],
@@ -121,7 +121,7 @@ cc_test(
         ":ast",
         ":paren_contents",
         "//explorer/base:arena",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],
@@ -134,7 +134,7 @@ cc_test(
         ":ast",
         ":paren_contents",
         "//explorer/base:arena",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],

+ 6 - 6
explorer/base/BUILD

@@ -18,7 +18,7 @@ cc_test(
     srcs = ["arena_test.cpp"],
     deps = [
         ":arena",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -36,7 +36,7 @@ cc_test(
     srcs = ["decompose_test.cpp"],
     deps = [
         ":decompose",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -56,8 +56,8 @@ cc_test(
     deps = [
         ":error_builders",
         ":source_location",
-        "//testing/util:gtest_main",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:gtest_main",
+        "//testing/base:test_raw_ostream",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -96,7 +96,7 @@ cc_test(
     srcs = ["set_program_phase_raii_test.cpp"],
     deps = [
         ":trace_stream",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -107,7 +107,7 @@ cc_test(
     deps = [
         ":source_location",
         ":trace_stream",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )

+ 1 - 1
explorer/base/error_builders_test.cpp

@@ -7,7 +7,7 @@
 #include <gtest/gtest.h>
 
 #include "explorer/base/source_location.h"
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 
 namespace Carbon::Testing {
 namespace {

+ 1 - 1
explorer/file_test.cpp

@@ -5,8 +5,8 @@
 #include "absl/flags/flag.h"
 #include "explorer/main.h"
 #include "re2/re2.h"
+#include "testing/base/test_raw_ostream.h"
 #include "testing/file_test/file_test_base.h"
-#include "testing/util/test_raw_ostream.h"
 
 ABSL_FLAG(bool, trace, false,
           "Set to true to run tests with tracing enabled, even if they don't "

+ 2 - 2
explorer/fuzzing/BUILD

@@ -46,9 +46,9 @@ cc_test(
     deps = [
         ":ast_to_proto_lib",
         "//explorer/syntax",
+        "//testing/base:test_raw_ostream",
         "//testing/fuzzing:carbon_cc_proto",
         "//testing/fuzzing:proto_to_carbon_lib",
-        "//testing/util:test_raw_ostream",
         "@com_google_googletest//:gtest",
         "@com_google_protobuf//:protobuf_headers",
     ],
@@ -80,8 +80,8 @@ cc_test(
     ],
     deps = [
         ":fuzzer_util",
+        "//testing/base:gtest_main",
         "//testing/fuzzing:proto_to_carbon_lib",
-        "//testing/util:gtest_main",
         "@com_google_googletest//:gtest",
         "@com_google_protobuf//:protobuf_headers",
         "@llvm-project//llvm:Support",

+ 1 - 1
explorer/fuzzing/ast_to_proto_test.cpp

@@ -15,8 +15,8 @@
 #include <variant>
 
 #include "explorer/syntax/parse.h"
+#include "testing/base/test_raw_ostream.h"
 #include "testing/fuzzing/proto_to_carbon.h"
-#include "testing/util/test_raw_ostream.h"
 
 namespace Carbon::Testing {
 namespace {

+ 1 - 1
explorer/parse_and_execute/BUILD

@@ -28,7 +28,7 @@ cc_test(
     srcs = ["parse_and_execute_test.cpp"],
     deps = [
         ":parse_and_execute",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )

+ 2 - 2
explorer/syntax/BUILD

@@ -16,7 +16,7 @@ cc_test(
     deps = [
         ":syntax",
         "//explorer/base:arena",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )
@@ -148,7 +148,7 @@ cc_test(
         ":parse_test_matchers",
         ":syntax",
         "//explorer/ast:ast_test_matchers",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )

+ 1 - 1
migrate_cpp/BUILD

@@ -47,7 +47,7 @@ cc_test(
     srcs = ["rewriter_test.cpp"],
     deps = [
         ":rewriter",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//clang:ast",
         "@llvm-project//clang:frontend",

+ 3 - 3
migrate_cpp/cpp_refactoring/BUILD

@@ -62,7 +62,7 @@ cc_test(
     deps = [
         ":fn_inserter",
         ":matcher_test_base",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//clang:tooling",
     ],
@@ -84,7 +84,7 @@ cc_test(
     deps = [
         ":for_range",
         ":matcher_test_base",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//clang:tooling",
     ],
@@ -108,7 +108,7 @@ cc_test(
     deps = [
         ":matcher_test_base",
         ":var_decl",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//clang:tooling",
     ],

+ 1 - 1
testing/util/BUILD → testing/base/BUILD

@@ -39,7 +39,7 @@ cc_test(
     srcs = ["test_raw_ostream_test.cpp"],
     deps = [
         ":test_raw_ostream",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )

+ 0 - 0
testing/util/gtest_main.cpp → testing/base/gtest_main.cpp


+ 3 - 3
testing/util/test_raw_ostream.h → testing/base/test_raw_ostream.h

@@ -2,8 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-#ifndef CARBON_TESTING_UTIL_TEST_RAW_OSTREAM_H_
-#define CARBON_TESTING_UTIL_TEST_RAW_OSTREAM_H_
+#ifndef CARBON_TESTING_BASE_TEST_RAW_OSTREAM_H_
+#define CARBON_TESTING_BASE_TEST_RAW_OSTREAM_H_
 
 #include <gtest/gtest.h>
 
@@ -39,4 +39,4 @@ class TestRawOstream : public llvm::raw_svector_ostream {
 
 }  // namespace Carbon::Testing
 
-#endif  // CARBON_TESTING_UTIL_TEST_RAW_OSTREAM_H_
+#endif  // CARBON_TESTING_BASE_TEST_RAW_OSTREAM_H_

+ 1 - 1
testing/util/test_raw_ostream_test.cpp → testing/base/test_raw_ostream_test.cpp

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>

+ 1 - 1
testing/fuzzing/BUILD

@@ -52,7 +52,7 @@ cc_test(
         ":carbon_cc_proto",
         ":proto_to_carbon_lib",
         "//common:error",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
     ],
 )

+ 2 - 2
toolchain/diagnostics/BUILD

@@ -21,7 +21,7 @@ cc_test(
     deps = [
         ":diagnostic_emitter",
         ":mocks",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],
@@ -66,7 +66,7 @@ cc_test(
         ":diagnostic_emitter",
         ":mocks",
         ":sorting_diagnostic_consumer",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],

+ 3 - 3
toolchain/driver/BUILD

@@ -45,8 +45,8 @@ cc_test(
     srcs = ["driver_test.cpp"],
     deps = [
         ":driver",
-        "//testing/util:gtest_main",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:gtest_main",
+        "//testing/base:test_raw_ostream",
         "//toolchain/base:yaml_test_helpers",
         "//toolchain/diagnostics:diagnostic_emitter",
         "//toolchain/lexer:tokenized_buffer_test_helpers",
@@ -62,7 +62,7 @@ cc_fuzz_test(
     corpus = glob(["fuzzer_corpus/*"]),
     deps = [
         ":driver",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:test_raw_ostream",
         "@llvm-project//llvm:Support",
     ],
 )

+ 1 - 1
toolchain/driver/driver_fuzzer.cpp

@@ -10,7 +10,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/raw_ostream.h"
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 #include "toolchain/driver/driver.h"
 
 namespace Carbon::Testing {

+ 1 - 1
toolchain/driver/driver_test.cpp

@@ -10,7 +10,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/SourceMgr.h"
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 #include "toolchain/base/yaml_test_helpers.h"
 #include "toolchain/diagnostics/diagnostic_emitter.h"
 

+ 5 - 5
toolchain/lexer/BUILD

@@ -26,7 +26,7 @@ cc_test(
     srcs = ["token_kind_test.cpp"],
     deps = [
         ":token_kind",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],
@@ -95,7 +95,7 @@ cc_test(
         ":test_helpers",
         "//common:check",
         "//common:ostream",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "//toolchain/diagnostics:diagnostic_emitter",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
@@ -148,7 +148,7 @@ cc_test(
         ":test_helpers",
         "//common:check",
         "//common:ostream",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "//toolchain/diagnostics:diagnostic_emitter",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
@@ -208,8 +208,8 @@ cc_test(
     deps = [
         ":tokenized_buffer",
         ":tokenized_buffer_test_helpers",
-        "//testing/util:gtest_main",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:gtest_main",
+        "//testing/base:test_raw_ostream",
         "//toolchain/base:yaml_test_helpers",
         "//toolchain/diagnostics:diagnostic_emitter",
         "//toolchain/diagnostics:mocks",

+ 1 - 1
toolchain/lexer/tokenized_buffer_test.cpp

@@ -15,7 +15,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 #include "toolchain/base/yaml_test_helpers.h"
 #include "toolchain/diagnostics/diagnostic_emitter.h"
 #include "toolchain/diagnostics/mocks.h"

+ 3 - 3
toolchain/parser/BUILD

@@ -63,8 +63,8 @@ cc_test(
         ":parse_node_kind",
         ":parse_tree",
         "//common:ostream",
-        "//testing/util:gtest_main",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:gtest_main",
+        "//testing/base:test_raw_ostream",
         "//toolchain/base:yaml_test_helpers",
         "//toolchain/diagnostics:diagnostic_emitter",
         "//toolchain/diagnostics:mocks",
@@ -112,7 +112,7 @@ cc_test(
     srcs = ["precedence_test.cpp"],
     deps = [
         ":precedence",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "//toolchain/lexer:token_kind",
         "@com_google_googletest//:gtest",
     ],

+ 1 - 1
toolchain/parser/parse_tree_test.cpp

@@ -9,7 +9,7 @@
 
 #include <forward_list>
 
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 #include "toolchain/base/yaml_test_helpers.h"
 #include "toolchain/diagnostics/diagnostic_emitter.h"
 #include "toolchain/diagnostics/mocks.h"

+ 2 - 2
toolchain/semantics/BUILD

@@ -117,8 +117,8 @@ cc_test(
     size = "small",
     srcs = ["semantics_ir_test.cpp"],
     deps = [
-        "//testing/util:gtest_main",
-        "//testing/util:test_raw_ostream",
+        "//testing/base:gtest_main",
+        "//testing/base:test_raw_ostream",
         "//toolchain/base:yaml_test_helpers",
         "//toolchain/driver",
         "@com_google_googletest//:gtest",

+ 1 - 1
toolchain/semantics/semantics_ir_test.cpp

@@ -10,7 +10,7 @@
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/VirtualFileSystem.h"
 #include "llvm/Support/raw_ostream.h"
-#include "testing/util/test_raw_ostream.h"
+#include "testing/base/test_raw_ostream.h"
 #include "toolchain/base/yaml_test_helpers.h"
 #include "toolchain/driver/driver.h"
 

+ 1 - 1
toolchain/source/BUILD

@@ -20,7 +20,7 @@ cc_test(
     srcs = ["source_buffer_test.cpp"],
     deps = [
         ":source_buffer",
-        "//testing/util:gtest_main",
+        "//testing/base:gtest_main",
         "@com_google_googletest//:gtest",
         "@llvm-project//llvm:Support",
     ],