mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
I'm refactoring logic to try to make these files more manageable, particularly as I'm looking at ways to use more threads. I'm renaming FileTestBase::TestContext to TestFile and FileTestBase::TestFile to TestFile::Split to try to be more consistent in how we talk about test files and file splits in general. This change is not expected to change any behavior, it's just refactoring. This PR has two commits: - Copying files for viewing deltas in GH - Moving logic The delta of the two commits is the main PR. The second commit can be viewed on its own to see the delta versus file_test_base.* files where the logic currently rests (there's still a reordering in run_test.cpp as part of making one function static).
68 lines
1.6 KiB
Python
68 lines
1.6 KiB
Python
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
load("rules.bzl", "file_test")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
cc_library(
|
|
name = "autoupdate",
|
|
testonly = 1,
|
|
srcs = ["autoupdate.cpp"],
|
|
hdrs = [
|
|
"autoupdate.h",
|
|
"line.h",
|
|
],
|
|
deps = [
|
|
"//common:check",
|
|
"//common:ostream",
|
|
"//common:raw_string_ostream",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/strings:string_view",
|
|
"@llvm-project//llvm:Support",
|
|
"@re2",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "file_test_base",
|
|
testonly = 1,
|
|
srcs = [
|
|
"file_test_base.cpp",
|
|
"run_test.cpp",
|
|
"run_test.h",
|
|
"test_file.cpp",
|
|
"test_file.h",
|
|
],
|
|
hdrs = ["file_test_base.h"],
|
|
deps = [
|
|
":autoupdate",
|
|
"//common:check",
|
|
"//common:error",
|
|
"//common:exe_path",
|
|
"//common:init_llvm",
|
|
"//common:ostream",
|
|
"//common:raw_string_ostream",
|
|
"//testing/base:file_helpers",
|
|
"@abseil-cpp//absl/flags:flag",
|
|
"@abseil-cpp//absl/flags:parse",
|
|
"@googletest//:gtest",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
file_test(
|
|
name = "file_test_base_test",
|
|
size = "small",
|
|
srcs = ["file_test_base_test.cpp"],
|
|
tests = glob(["testdata/**"]),
|
|
deps = [
|
|
":file_test_base",
|
|
"//common:ostream",
|
|
"@googletest//:gtest",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|