Procházet zdrojové kódy

Use new test framework in toolchain to reduce per-test overhead (#2821)

This builds on #2814 by adding the test framework to the toolchain. On Linux, this is 7s -> 4s for me. #2811 has more detailed timing for the explorer, which also had more dramatic changes because it's about 3x more tests run in 2x as many ways (6x total).

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Jon Ross-Perkins před 3 roky
rodič
revize
e4a04c2936
100 změnil soubory, kde provedl 299 přidání a 276 odebrání
  1. 23 15
      toolchain/diagnostics/diagnostic_emitter.h
  2. 0 2
      toolchain/driver/BUILD
  3. 3 1
      toolchain/driver/driver.cpp
  4. 0 1
      toolchain/driver/testdata/semantics_builtin_nodes.carbon
  5. 0 1
      toolchain/driver/testdata/semantics_verbose.carbon
  6. 24 0
      toolchain/lexer/BUILD
  7. 37 0
      toolchain/lexer/lexer_file_test.cpp
  8. 0 1
      toolchain/lexer/lit_autoupdate.py
  9. 0 27
      toolchain/lexer/testdata/BUILD
  10. 0 1
      toolchain/lexer/testdata/carbon_test.carbon
  11. 0 1
      toolchain/lexer/testdata/lit.cfg.py
  12. 37 0
      toolchain/lowering/BUILD
  13. 0 1
      toolchain/lowering/lit_autoupdate.py
  14. 37 0
      toolchain/lowering/lowering_file_test.cpp
  15. 0 39
      toolchain/lowering/testdata/BUILD
  16. 2 3
      toolchain/lowering/testdata/basics/empty.carbon
  17. 1 2
      toolchain/lowering/testdata/basics/fail_before_lowering.carbon
  18. 2 3
      toolchain/lowering/testdata/basics/zero.carbon
  19. 2 3
      toolchain/lowering/testdata/function/definition/params_one.carbon
  20. 2 3
      toolchain/lowering/testdata/function/definition/params_two.carbon
  21. 2 3
      toolchain/lowering/testdata/function/definition/params_zero.carbon
  22. 0 1
      toolchain/lowering/testdata/lit.cfg.py
  23. 2 3
      toolchain/lowering/testdata/return/no_value.carbon
  24. 2 3
      toolchain/lowering/testdata/return/value.carbon
  25. 36 0
      toolchain/parser/BUILD
  26. 0 1
      toolchain/parser/lit_autoupdate.py
  27. 37 0
      toolchain/parser/parse_tree_file_test.cpp
  28. 0 39
      toolchain/parser/testdata/BUILD
  29. 0 1
      toolchain/parser/testdata/basics/builtin_types.carbon
  30. 0 1
      toolchain/parser/testdata/basics/empty.carbon
  31. 0 1
      toolchain/parser/testdata/basics/empty_declaration.carbon
  32. 3 4
      toolchain/parser/testdata/basics/fail_invalid_designators.carbon
  33. 1 2
      toolchain/parser/testdata/basics/fail_no_intro_with_semi.carbon
  34. 1 2
      toolchain/parser/testdata/basics/fail_no_intro_without_semi.carbon
  35. 3 4
      toolchain/parser/testdata/basics/fail_paren_match_regression.carbon
  36. 0 1
      toolchain/parser/testdata/basics/function_call.carbon
  37. 0 1
      toolchain/parser/testdata/class/basic.carbon
  38. 0 1
      toolchain/parser/testdata/class/fn_definitions.carbon
  39. 0 1
      toolchain/parser/testdata/class/var.carbon
  40. 1 2
      toolchain/parser/testdata/for/fail_colon_instead_of_in.carbon
  41. 1 2
      toolchain/parser/testdata/for/fail_missing_in.carbon
  42. 1 2
      toolchain/parser/testdata/for/fail_missing_var.carbon
  43. 0 1
      toolchain/parser/testdata/for/nested.carbon
  44. 0 1
      toolchain/parser/testdata/for/simple.carbon
  45. 0 1
      toolchain/parser/testdata/function/declaration/addr.carbon
  46. 0 1
      toolchain/parser/testdata/function/declaration/basic.carbon
  47. 0 1
      toolchain/parser/testdata/function/declaration/deduced_empty.carbon
  48. 0 1
      toolchain/parser/testdata/function/declaration/deduced_params.carbon
  49. 1 2
      toolchain/parser/testdata/function/declaration/fail_identifier_instead_of_sig.carbon
  50. 3 4
      toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon
  51. 1 2
      toolchain/parser/testdata/function/declaration/fail_missing_name.carbon
  52. 1 2
      toolchain/parser/testdata/function/declaration/fail_no_sig_or_semi.carbon
  53. 1 2
      toolchain/parser/testdata/function/declaration/fail_only_fn_and_semi.carbon
  54. 1 2
      toolchain/parser/testdata/function/declaration/fail_repeated_fn_and_semi.carbon
  55. 1 2
      toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon
  56. 1 2
      toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon
  57. 1 2
      toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon
  58. 1 2
      toolchain/parser/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon
  59. 1 2
      toolchain/parser/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon
  60. 1 2
      toolchain/parser/testdata/function/declaration/fail_with_identifier_as_param.carbon
  61. 1 2
      toolchain/parser/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon
  62. 0 1
      toolchain/parser/testdata/function/declaration/params.carbon
  63. 0 1
      toolchain/parser/testdata/function/declaration/with_return_type.carbon
  64. 0 1
      toolchain/parser/testdata/function/definition/basic.carbon
  65. 1 2
      toolchain/parser/testdata/function/definition/fail_identifier_in_statements.carbon
  66. 0 1
      toolchain/parser/testdata/function/definition/with_params.carbon
  67. 0 1
      toolchain/parser/testdata/function/definition/with_return_type.carbon
  68. 0 1
      toolchain/parser/testdata/generics/deduced_params/empty.carbon
  69. 4 5
      toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon
  70. 0 1
      toolchain/parser/testdata/generics/deduced_params/one.carbon
  71. 0 1
      toolchain/parser/testdata/generics/deduced_params/one_suffix_comma.carbon
  72. 0 1
      toolchain/parser/testdata/generics/deduced_params/six.carbon
  73. 0 1
      toolchain/parser/testdata/generics/deduced_params/two.carbon
  74. 0 1
      toolchain/parser/testdata/generics/deduced_params/two_suffix_comma.carbon
  75. 0 1
      toolchain/parser/testdata/generics/generic_params/basic.carbon
  76. 0 1
      toolchain/parser/testdata/generics/generic_params/template.carbon
  77. 0 1
      toolchain/parser/testdata/generics/generic_params/template_addr.carbon
  78. 0 1
      toolchain/parser/testdata/generics/interface/basic.carbon
  79. 0 1
      toolchain/parser/testdata/generics/interface/declaration.carbon
  80. 0 1
      toolchain/parser/testdata/generics/interface/empty_body.carbon
  81. 1 2
      toolchain/parser/testdata/generics/interface/fail_missing_name.carbon
  82. 2 3
      toolchain/parser/testdata/generics/interface/fail_missing_open_curly.carbon
  83. 1 2
      toolchain/parser/testdata/generics/interface/fail_no_impl_allowed.carbon
  84. 2 3
      toolchain/parser/testdata/generics/interface/fail_self_param_syntax.carbon
  85. 0 1
      toolchain/parser/testdata/generics/interface/non_instance_fn.carbon
  86. 0 1
      toolchain/parser/testdata/generics/interface/self_pointer.carbon
  87. 0 1
      toolchain/parser/testdata/generics/named_constraint/basic.carbon
  88. 1 2
      toolchain/parser/testdata/generics/named_constraint/fail_no_impl_allowed.carbon
  89. 0 1
      toolchain/parser/testdata/generics/params/empty.carbon
  90. 0 1
      toolchain/parser/testdata/generics/params/one.carbon
  91. 0 1
      toolchain/parser/testdata/generics/params/one_suffix_comma.carbon
  92. 0 1
      toolchain/parser/testdata/generics/params/six.carbon
  93. 0 1
      toolchain/parser/testdata/generics/params/two.carbon
  94. 0 1
      toolchain/parser/testdata/generics/params/two_suffix_comma.carbon
  95. 0 1
      toolchain/parser/testdata/if/basic.carbon
  96. 0 1
      toolchain/parser/testdata/if/else.carbon
  97. 4 5
      toolchain/parser/testdata/if/fail_else_unbraced.carbon
  98. 5 6
      toolchain/parser/testdata/if/fail_errors.carbon
  99. 3 4
      toolchain/parser/testdata/if/fail_unbraced.carbon
  100. 0 1
      toolchain/parser/testdata/lit.cfg.py

+ 23 - 15
toolchain/diagnostics/diagnostic_emitter.h

@@ -296,22 +296,30 @@ class DiagnosticEmitter {
   DiagnosticConsumer* consumer_;
 };
 
-inline auto ConsoleDiagnosticConsumer() -> DiagnosticConsumer& {
-  class Consumer : public DiagnosticConsumer {
-    auto HandleDiagnostic(Diagnostic diagnostic) -> void override {
-      Print(diagnostic.message);
-      for (const auto& note : diagnostic.notes) {
-        Print(note);
-      }
-    }
-    auto Print(const DiagnosticMessage& message) -> void {
-      llvm::errs() << message.location.file_name << ":"
-                   << message.location.line_number << ":"
-                   << message.location.column_number << ": "
-                   << message.format_fn(message) << "\n";
+class StreamDiagnosticConsumer : public DiagnosticConsumer {
+ public:
+  explicit StreamDiagnosticConsumer(llvm::raw_ostream& stream)
+      : stream_(&stream) {}
+
+  auto HandleDiagnostic(Diagnostic diagnostic) -> void override {
+    Print(diagnostic.message);
+    for (const auto& note : diagnostic.notes) {
+      Print(note);
     }
-  };
-  static auto* consumer = new Consumer;
+  }
+  auto Print(const DiagnosticMessage& message) -> void {
+    *stream_ << message.location.file_name << ":"
+             << message.location.line_number << ":"
+             << message.location.column_number << ": "
+             << message.format_fn(message) << "\n";
+  }
+
+ private:
+  llvm::raw_ostream* stream_;
+};
+
+inline auto ConsoleDiagnosticConsumer() -> DiagnosticConsumer& {
+  static auto* consumer = new StreamDiagnosticConsumer(llvm::errs());
   return *consumer;
 }
 

+ 0 - 2
toolchain/driver/BUILD

@@ -7,8 +7,6 @@ load("//bazel/fuzzing:rules.bzl", "cc_fuzz_test")
 
 package(default_visibility = ["//visibility:public"])
 
-exports_files(["lit.cfg.py"])
-
 cc_library(
     name = "driver",
     srcs = ["driver.cpp"],

+ 3 - 1
toolchain/driver/driver.cpp

@@ -13,6 +13,7 @@
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Format.h"
+#include "toolchain/diagnostics/diagnostic_emitter.h"
 #include "toolchain/diagnostics/sorting_diagnostic_consumer.h"
 #include "toolchain/lexer/tokenized_buffer.h"
 #include "toolchain/lowering/lower_to_llvm.h"
@@ -40,7 +41,8 @@ auto GetSubcommand(llvm::StringRef name) -> Subcommand {
 }  // namespace
 
 auto Driver::RunFullCommand(llvm::ArrayRef<llvm::StringRef> args) -> bool {
-  DiagnosticConsumer* consumer = &ConsoleDiagnosticConsumer();
+  StreamDiagnosticConsumer stream_consumer(error_stream_);
+  DiagnosticConsumer* consumer = &stream_consumer;
   std::unique_ptr<SortingDiagnosticConsumer> sorting_consumer;
   // TODO: Figure out a command-line support library, this is temporary.
   if (!args.empty() && args[0] == "-v") {

+ 0 - 1
toolchain/semantics/testdata/basics/builtin_nodes.carbon → toolchain/driver/testdata/semantics_builtin_nodes.carbon

@@ -2,7 +2,6 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// NOAUTOUPDATE
 // RUN: %{carbon} dump semantics-ir --include_builtins %s | \
 // RUN:   %{FileCheck-strict}
 // CHECK:STDOUT: cross_reference_irs_size: 1

+ 0 - 1
toolchain/semantics/testdata/basics/verbose.carbon → toolchain/driver/testdata/semantics_verbose.carbon

@@ -2,7 +2,6 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// NOAUTOUPDATE
 // RUN: %{carbon} -v dump semantics-ir %s | %{FileCheck-allow-unmatched}
 //
 // Only checks a couple statements in order to minimize manual update churn.

+ 24 - 0
toolchain/lexer/BUILD

@@ -3,6 +3,8 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("//bazel/fuzzing:rules.bzl", "cc_fuzz_test")
+load("//bazel/sh_run:rules.bzl", "glob_sh_run")
+load("//testing/file_test:rules.bzl", "file_test")
 
 package(default_visibility = ["//visibility:public"])
 
@@ -228,3 +230,25 @@ cc_fuzz_test(
         "@llvm-project//llvm:Support",
     ],
 )
+
+file_test(
+    name = "lexer_file_test",
+    srcs = ["lexer_file_test.cpp"],
+    tests = glob(["testdata/**/*.carbon"]),
+    deps = [
+        "//testing/file_test:file_test_base",
+        "//toolchain/driver",
+        "@com_google_googletest//:gtest",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+glob_sh_run(
+    args = [
+        "$(location //toolchain/driver:carbon)",
+        "dump",
+        "tokens",
+    ],
+    data = ["//toolchain/driver:carbon"],
+    file_exts = ["carbon"],
+)

+ 37 - 0
toolchain/lexer/lexer_file_test.cpp

@@ -0,0 +1,37 @@
+// 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
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <vector>
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/raw_ostream.h"
+#include "testing/file_test/file_test_base.h"
+#include "toolchain/driver/driver.h"
+
+namespace Carbon::Testing {
+namespace {
+
+class LexerFileTest : public FileTestBase {
+ public:
+  explicit LexerFileTest(llvm::StringRef path) : FileTestBase(path) {}
+
+  auto RunOverFile(llvm::raw_ostream& stdout, llvm::raw_ostream& stderr)
+      -> bool override {
+    Driver driver(stdout, stderr);
+    return driver.RunFullCommand({"dump", "tokens", path()});
+  }
+};
+
+}  // namespace
+
+auto RegisterFileTests(const std::vector<llvm::StringRef>& paths) -> void {
+  LexerFileTest::RegisterTests(
+      "LexerFileTest", paths,
+      [](llvm::StringRef path) { return new LexerFileTest(path); });
+}
+
+}  // namespace Carbon::Testing

+ 0 - 1
toolchain/lexer/lit_autoupdate.py

@@ -36,7 +36,6 @@ def main() -> None:
         "--line_number_delta_prefix={{ *}}",
         "--line_number_pattern="
         r"(?P<prefix> line: )(?P<line> *\d+)(?P<suffix>,)",
-        "--lit_run=%{carbon-run-tokens}",
         "--testdata=toolchain/lexer/testdata",
     ] + sys.argv[1:]
     os.execv(actual_py, args)

+ 0 - 27
toolchain/lexer/testdata/BUILD

@@ -1,27 +0,0 @@
-# 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("//bazel/sh_run:rules.bzl", "glob_sh_run")
-load("//bazel/testing:lit.bzl", "glob_lit_tests")
-
-glob_lit_tests(
-    data = [
-        "//bazel/testing:merge_output",
-        "//toolchain/driver:carbon",
-        "@llvm-project//llvm:FileCheck",
-        "@llvm-project//llvm:not",
-    ],
-    driver = "lit.cfg.py",
-    test_file_exts = ["carbon"],
-)
-
-glob_sh_run(
-    args = [
-        "$(location //toolchain/driver:carbon)",
-        "dump",
-        "tokens",
-    ],
-    data = ["//toolchain/driver:carbon"],
-    file_exts = ["carbon"],
-)

+ 0 - 1
toolchain/lexer/testdata/carbon_test.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-tokens}
 // CHECK:STDOUT: [
 
 // CHECK:STDOUT: { index:  0, kind:                'Fn', line: {{ *}}[[@LINE+7]], column:  1, indent: 1, spelling: 'fn', has_trailing_space: true },

+ 0 - 1
toolchain/lexer/testdata/lit.cfg.py

@@ -1 +0,0 @@
-../../../bazel/testing/lit.cfg.py

+ 37 - 0
toolchain/lowering/BUILD

@@ -2,6 +2,9 @@
 # Exceptions. See /LICENSE for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("//bazel/sh_run:rules.bzl", "glob_sh_run")
+load("//testing/file_test:rules.bzl", "file_test")
+
 package(default_visibility = ["//visibility:public"])
 
 cc_library(
@@ -29,3 +32,37 @@ cc_library(
         "@llvm-project//llvm:Support",
     ],
 )
+
+file_test(
+    name = "lowering_file_test",
+    srcs = ["lowering_file_test.cpp"],
+    tests = glob(["testdata/**/*.carbon"]),
+    deps = [
+        "//testing/file_test:file_test_base",
+        "//toolchain/driver",
+        "@com_google_googletest//:gtest",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+glob_sh_run(
+    args = [
+        "$(location //toolchain/driver:carbon)",
+        "dump",
+        "llvm-ir",
+    ],
+    data = ["//toolchain/driver:carbon"],
+    file_exts = ["carbon"],
+)
+
+glob_sh_run(
+    args = [
+        "$(location //toolchain/driver:carbon)",
+        "-v",
+        "dump",
+        "llvm-ir",
+    ],
+    data = ["//toolchain/driver:carbon"],
+    file_exts = ["carbon"],
+    run_ext = "verbose",
+)

+ 0 - 1
toolchain/lowering/lit_autoupdate.py

@@ -26,7 +26,6 @@ def main() -> None:
         "--tool=carbon",
         "--autoupdate_arg=dump",
         "--autoupdate_arg=llvm-ir",
-        "--lit_run=%{carbon-run-lowering}",
         "--testdata=toolchain/lowering/testdata",
     ] + sys.argv[1:]
     os.execv(actual_py, args)

+ 37 - 0
toolchain/lowering/lowering_file_test.cpp

@@ -0,0 +1,37 @@
+// 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
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <vector>
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/raw_ostream.h"
+#include "testing/file_test/file_test_base.h"
+#include "toolchain/driver/driver.h"
+
+namespace Carbon::Testing {
+namespace {
+
+class LoweringFileTest : public FileTestBase {
+ public:
+  explicit LoweringFileTest(llvm::StringRef path) : FileTestBase(path) {}
+
+  auto RunOverFile(llvm::raw_ostream& stdout, llvm::raw_ostream& stderr)
+      -> bool override {
+    Driver driver(stdout, stderr);
+    return driver.RunFullCommand({"dump", "llvm-ir", path()});
+  }
+};
+
+}  // namespace
+
+auto RegisterFileTests(const std::vector<llvm::StringRef>& paths) -> void {
+  LoweringFileTest::RegisterTests(
+      "LoweringFileTest", paths,
+      [](llvm::StringRef path) { return new LoweringFileTest(path); });
+}
+
+}  // namespace Carbon::Testing

+ 0 - 39
toolchain/lowering/testdata/BUILD

@@ -1,39 +0,0 @@
-# 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("//bazel/sh_run:rules.bzl", "glob_sh_run")
-load("//bazel/testing:lit.bzl", "glob_lit_tests")
-
-glob_lit_tests(
-    data = [
-        "//bazel/testing:merge_output",
-        "//toolchain/driver:carbon",
-        "@llvm-project//llvm:FileCheck",
-        "@llvm-project//llvm:not",
-    ],
-    driver = "lit.cfg.py",
-    test_file_exts = ["carbon"],
-)
-
-glob_sh_run(
-    args = [
-        "$(location //toolchain/driver:carbon)",
-        "dump",
-        "llvm-ir",
-    ],
-    data = ["//toolchain/driver:carbon"],
-    file_exts = ["carbon"],
-)
-
-glob_sh_run(
-    args = [
-        "$(location //toolchain/driver:carbon)",
-        "-v",
-        "dump",
-        "llvm-ir",
-    ],
-    data = ["//toolchain/driver:carbon"],
-    file_exts = ["carbon"],
-    run_ext = "verbose",
-)

+ 2 - 3
toolchain/lowering/testdata/basics/empty.carbon

@@ -3,6 +3,5 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-lowering}
-// CHECK:STDOUT: ; ModuleID = '{{.*}}/toolchain/lowering/testdata/basics/empty.carbon'
-// CHECK:STDOUT: source_filename = "{{.*}}/toolchain/lowering/testdata/basics/empty.carbon"
+// CHECK:STDOUT: ; ModuleID = 'toolchain/lowering/testdata/basics/empty.carbon'
+// CHECK:STDOUT: source_filename = "toolchain/lowering/testdata/basics/empty.carbon"

+ 1 - 2
toolchain/lowering/testdata/basics/fail_before_lowering.carbon

@@ -4,7 +4,6 @@
 //
 // This validates that earlier errors prevent lowering, without crashing.
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-lowering}
 
-// CHECK:STDERR: {{.*}}/toolchain/lowering/testdata/basics/fail_before_lowering.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
+// CHECK:STDERR: toolchain/lowering/testdata/basics/fail_before_lowering.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
 a;

+ 2 - 3
toolchain/lowering/testdata/basics/zero.carbon

@@ -3,9 +3,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-lowering}
-// CHECK:STDOUT: ; ModuleID = '{{.*}}/toolchain/lowering/testdata/basics/zero.carbon'
-// CHECK:STDOUT: source_filename = "{{.*}}/toolchain/lowering/testdata/basics/zero.carbon"
+// CHECK:STDOUT: ; ModuleID = 'toolchain/lowering/testdata/basics/zero.carbon'
+// CHECK:STDOUT: source_filename = "toolchain/lowering/testdata/basics/zero.carbon"
 // CHECK:STDOUT:
 // CHECK:STDOUT: define i32 @Main() {
 // CHECK:STDOUT: entry:

+ 2 - 3
toolchain/lowering/testdata/function/definition/params_one.carbon

@@ -3,9 +3,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-lowering}
-// CHECK:STDOUT: ; ModuleID = '{{.*}}/toolchain/lowering/testdata/function/definition/params_one.carbon'
-// CHECK:STDOUT: source_filename = "{{.*}}/toolchain/lowering/testdata/function/definition/params_one.carbon"
+// CHECK:STDOUT: ; ModuleID = 'toolchain/lowering/testdata/function/definition/params_one.carbon'
+// CHECK:STDOUT: source_filename = "toolchain/lowering/testdata/function/definition/params_one.carbon"
 // CHECK:STDOUT:
 // CHECK:STDOUT: define void @Foo(i32 %a) {
 // CHECK:STDOUT: entry:

+ 2 - 3
toolchain/lowering/testdata/function/definition/params_two.carbon

@@ -3,9 +3,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-lowering}
-// CHECK:STDOUT: ; ModuleID = '{{.*}}/toolchain/lowering/testdata/function/definition/params_two.carbon'
-// CHECK:STDOUT: source_filename = "{{.*}}/toolchain/lowering/testdata/function/definition/params_two.carbon"
+// CHECK:STDOUT: ; ModuleID = 'toolchain/lowering/testdata/function/definition/params_two.carbon'
+// CHECK:STDOUT: source_filename = "toolchain/lowering/testdata/function/definition/params_two.carbon"
 // CHECK:STDOUT:
 // CHECK:STDOUT: define void @Foo(i32 %a, i32 %b) {
 // CHECK:STDOUT: entry:

+ 2 - 3
toolchain/lowering/testdata/function/definition/params_zero.carbon

@@ -3,9 +3,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-lowering}
-// CHECK:STDOUT: ; ModuleID = '{{.*}}/toolchain/lowering/testdata/function/definition/params_zero.carbon'
-// CHECK:STDOUT: source_filename = "{{.*}}/toolchain/lowering/testdata/function/definition/params_zero.carbon"
+// CHECK:STDOUT: ; ModuleID = 'toolchain/lowering/testdata/function/definition/params_zero.carbon'
+// CHECK:STDOUT: source_filename = "toolchain/lowering/testdata/function/definition/params_zero.carbon"
 // CHECK:STDOUT:
 // CHECK:STDOUT: define void @Foo() {
 // CHECK:STDOUT: entry:

+ 0 - 1
toolchain/lowering/testdata/lit.cfg.py

@@ -1 +0,0 @@
-../../../bazel/testing/lit.cfg.py

+ 2 - 3
toolchain/lowering/testdata/return/no_value.carbon

@@ -3,9 +3,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-lowering}
-// CHECK:STDOUT: ; ModuleID = '{{.*}}/toolchain/lowering/testdata/return/no_value.carbon'
-// CHECK:STDOUT: source_filename = "{{.*}}/toolchain/lowering/testdata/return/no_value.carbon"
+// CHECK:STDOUT: ; ModuleID = 'toolchain/lowering/testdata/return/no_value.carbon'
+// CHECK:STDOUT: source_filename = "toolchain/lowering/testdata/return/no_value.carbon"
 // CHECK:STDOUT:
 // CHECK:STDOUT: define void @Main() {
 // CHECK:STDOUT: entry:

+ 2 - 3
toolchain/lowering/testdata/return/value.carbon

@@ -3,9 +3,8 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-lowering}
-// CHECK:STDOUT: ; ModuleID = '{{.*}}/toolchain/lowering/testdata/return/value.carbon'
-// CHECK:STDOUT: source_filename = "{{.*}}/toolchain/lowering/testdata/return/value.carbon"
+// CHECK:STDOUT: ; ModuleID = 'toolchain/lowering/testdata/return/value.carbon'
+// CHECK:STDOUT: source_filename = "toolchain/lowering/testdata/return/value.carbon"
 // CHECK:STDOUT:
 // CHECK:STDOUT: define i32 @Main() {
 // CHECK:STDOUT: entry:

+ 36 - 0
toolchain/parser/BUILD

@@ -3,6 +3,8 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("//bazel/fuzzing:rules.bzl", "cc_fuzz_test")
+load("//bazel/sh_run:rules.bzl", "glob_sh_run")
+load("//testing/file_test:rules.bzl", "file_test")
 
 package(default_visibility = ["//visibility:public"])
 
@@ -109,3 +111,37 @@ cc_test(
         "@com_google_googletest//:gtest",
     ],
 )
+
+file_test(
+    name = "parse_tree_file_test",
+    srcs = ["parse_tree_file_test.cpp"],
+    tests = glob(["testdata/**/*.carbon"]),
+    deps = [
+        "//testing/file_test:file_test_base",
+        "//toolchain/driver",
+        "@com_google_googletest//:gtest",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+glob_sh_run(
+    args = [
+        "$(location //toolchain/driver:carbon)",
+        "dump",
+        "parse-tree",
+    ],
+    data = ["//toolchain/driver:carbon"],
+    file_exts = ["carbon"],
+)
+
+glob_sh_run(
+    args = [
+        "$(location //toolchain/driver:carbon)",
+        "-v",
+        "dump",
+        "parse-tree",
+    ],
+    data = ["//toolchain/driver:carbon"],
+    file_exts = ["carbon"],
+    run_ext = "verbose",
+)

+ 0 - 1
toolchain/parser/lit_autoupdate.py

@@ -26,7 +26,6 @@ def main() -> None:
         "--tool=carbon",
         "--autoupdate_arg=dump",
         "--autoupdate_arg=parse-tree",
-        "--lit_run=%{carbon-run-parser}",
         "--testdata=toolchain/parser/testdata",
     ] + sys.argv[1:]
     os.execv(actual_py, args)

+ 37 - 0
toolchain/parser/parse_tree_file_test.cpp

@@ -0,0 +1,37 @@
+// 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
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <vector>
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/raw_ostream.h"
+#include "testing/file_test/file_test_base.h"
+#include "toolchain/driver/driver.h"
+
+namespace Carbon::Testing {
+namespace {
+
+class ParserFileTest : public FileTestBase {
+ public:
+  explicit ParserFileTest(llvm::StringRef path) : FileTestBase(path) {}
+
+  auto RunOverFile(llvm::raw_ostream& stdout, llvm::raw_ostream& stderr)
+      -> bool override {
+    Driver driver(stdout, stderr);
+    return driver.RunFullCommand({"dump", "parse-tree", path()});
+  }
+};
+
+}  // namespace
+
+auto RegisterFileTests(const std::vector<llvm::StringRef>& paths) -> void {
+  ParserFileTest::RegisterTests(
+      "ParserFileTest", paths,
+      [](llvm::StringRef path) { return new ParserFileTest(path); });
+}
+
+}  // namespace Carbon::Testing

+ 0 - 39
toolchain/parser/testdata/BUILD

@@ -1,39 +0,0 @@
-# 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("//bazel/sh_run:rules.bzl", "glob_sh_run")
-load("//bazel/testing:lit.bzl", "glob_lit_tests")
-
-glob_lit_tests(
-    data = [
-        "//bazel/testing:merge_output",
-        "//toolchain/driver:carbon",
-        "@llvm-project//llvm:FileCheck",
-        "@llvm-project//llvm:not",
-    ],
-    driver = "lit.cfg.py",
-    test_file_exts = ["carbon"],
-)
-
-glob_sh_run(
-    args = [
-        "$(location //toolchain/driver:carbon)",
-        "dump",
-        "parse-tree",
-    ],
-    data = ["//toolchain/driver:carbon"],
-    file_exts = ["carbon"],
-)
-
-glob_sh_run(
-    args = [
-        "$(location //toolchain/driver:carbon)",
-        "-v",
-        "dump",
-        "parse-tree",
-    ],
-    data = ["//toolchain/driver:carbon"],
-    file_exts = ["carbon"],
-    run_ext = "verbose",
-)

+ 0 - 1
toolchain/parser/testdata/basics/builtin_types.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'VariableIntroducer', text: 'var'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'test_i32'},

+ 0 - 1
toolchain/parser/testdata/basics/empty.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]

+ 0 - 1
toolchain/parser/testdata/basics/empty_declaration.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT: {kind: 'EmptyDeclaration', text: ';'},
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},

+ 3 - 4
toolchain/parser/testdata/basics/fail_invalid_designators.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},
@@ -28,10 +27,10 @@
 
 // NOTE: Move to its own directory when more tests are added.
 fn F() {
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
+  // CHECK:STDERR: toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
   a.;
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
+  // CHECK:STDERR: toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
   a.fn;
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
+  // CHECK:STDERR: toolchain/parser/testdata/basics/fail_invalid_designators.carbon:[[@LINE+1]]:5: Expected identifier after `.`.
   a.42;
 }

+ 1 - 2
toolchain/parser/testdata/basics/fail_no_intro_with_semi.carbon

@@ -3,11 +3,10 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT: {kind: 'EmptyDeclaration', text: ';', has_error: yes},
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_no_intro_with_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
+// CHECK:STDERR: toolchain/parser/testdata/basics/fail_no_intro_with_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
 foo;

+ 1 - 2
toolchain/parser/testdata/basics/fail_no_intro_without_semi.carbon

@@ -3,11 +3,10 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT: {kind: 'EmptyDeclaration', text: 'foo', has_error: yes},
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_no_intro_without_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
+// CHECK:STDERR: toolchain/parser/testdata/basics/fail_no_intro_without_semi.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
 foo bar baz

+ 3 - 4
toolchain/parser/testdata/basics/fail_paren_match_regression.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'VariableIntroducer', text: 'var'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: '=', has_error: yes},
@@ -17,7 +16,7 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+3]]:5: Expected pattern in `var` declaration.
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+2]]:12: Expected `,` or `)`.
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+1]]:15: Expected `;` after expression.
+// CHECK:STDERR: toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+3]]:5: Expected pattern in `var` declaration.
+// CHECK:STDERR: toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+2]]:12: Expected `,` or `)`.
+// CHECK:STDERR: toolchain/parser/testdata/basics/fail_paren_match_regression.carbon:[[@LINE+1]]:15: Expected `;` after expression.
 var = (foo {})

+ 0 - 1
toolchain/parser/testdata/basics/function_call.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},

+ 0 - 1
toolchain/parser/testdata/class/basic.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/class/fn_definitions.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/class/var.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 1 - 2
toolchain/parser/testdata/for/fail_colon_instead_of_in.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'foo'},
@@ -31,7 +30,7 @@
 // CHECK:STDOUT: ]
 
 fn foo() {
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/fail_colon_instead_of_in.carbon:[[@LINE+1]]:19: `:` should be replaced by `in`.
+  // CHECK:STDERR: toolchain/parser/testdata/for/fail_colon_instead_of_in.carbon:[[@LINE+1]]:19: `:` should be replaced by `in`.
   for (var x: i32 : y) {
     Print(x);
   }

+ 1 - 2
toolchain/parser/testdata/for/fail_missing_in.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'foo'},
@@ -31,7 +30,7 @@
 // CHECK:STDOUT: ]
 
 fn foo() {
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/fail_missing_in.carbon:[[@LINE+1]]:19: Expected `in` after loop `var` declaration.
+  // CHECK:STDERR: toolchain/parser/testdata/for/fail_missing_in.carbon:[[@LINE+1]]:19: Expected `in` after loop `var` declaration.
   for (var x: i32 y) {
     Print(x);
   }

+ 1 - 2
toolchain/parser/testdata/for/fail_missing_var.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'foo'},
@@ -26,7 +25,7 @@
 // CHECK:STDOUT: ]
 
 fn foo() {
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/for/fail_missing_var.carbon:[[@LINE+1]]:8: Expected `var` declaration.
+  // CHECK:STDERR: toolchain/parser/testdata/for/fail_missing_var.carbon:[[@LINE+1]]:8: Expected `var` declaration.
   for (x: i32 in y) {
     Print(x);
   }

+ 0 - 1
toolchain/parser/testdata/for/nested.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/for/simple.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/function/declaration/addr.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/function/declaration/basic.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'F'},

+ 0 - 1
toolchain/parser/testdata/function/declaration/deduced_empty.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/function/declaration/deduced_params.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_identifier_instead_of_sig.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},
@@ -11,5 +10,5 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_identifier_instead_of_sig.carbon:[[@LINE+1]]:8: `fn` requires a `(` for parameters.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_identifier_instead_of_sig.carbon:[[@LINE+1]]:8: `fn` requires a `(` for parameters.
 fn foo bar;

+ 3 - 4
toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Div'},
@@ -17,7 +16,7 @@
 // CHECK:STDOUT: ]
 
 // Fix and uncomment this to test error handling.
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+2]]:7: Closing symbol does not match most recent opening symbol.
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+1]]:8: Expected parameter declaration.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+2]]:7: Closing symbol does not match most recent opening symbol.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+1]]:8: Expected parameter declaration.
 fn Div[();
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+0]]:181: A `(` for parameters is required after deduced parameters.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+0]]:174: A `(` for parameters is required after deduced parameters.

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_missing_name.carbon

@@ -3,12 +3,11 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 2},
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_missing_name.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_missing_name.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
 fn ();

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_no_sig_or_semi.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},
@@ -11,5 +10,5 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_no_sig_or_semi.carbon:[[@LINE+1]]:7: `fn` requires a `(` for parameters.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_no_sig_or_semi.carbon:[[@LINE+1]]:7: `fn` requires a `(` for parameters.
 fn foo

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_only_fn_and_semi.carbon

@@ -3,12 +3,11 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 2},
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_only_fn_and_semi.carbon:[[@LINE+1]]:3: `fn` introducer should be followed by a name.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_only_fn_and_semi.carbon:[[@LINE+1]]:3: `fn` introducer should be followed by a name.
 fn;

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_repeated_fn_and_semi.carbon

@@ -3,12 +3,11 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 2},
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_repeated_fn_and_semi.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_repeated_fn_and_semi.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
 fn fn;

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2},
@@ -15,7 +14,7 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon:[[@LINE+1]]:6: `fn` introducer should be followed by a name.
+  // CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon:[[@LINE+1]]:6: `fn` introducer should be followed by a name.
   fn (x,
       y,
       z)

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 2},
@@ -15,7 +14,7 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
 fn (x,
     y,
     z);

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2},
@@ -15,7 +14,7 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
 fn (x,
     y,
     z)

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 2},
@@ -15,6 +14,6 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
 fn ()
 fn F();

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT: {kind: 'EmptyDeclaration', text: 'struct', has_error: yes},
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
@@ -14,6 +13,6 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon:[[@LINE+1]]:1: Unrecognized declaration introducer.
 struct X { fn () }
 fn F();

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_with_identifier_as_param.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},
@@ -16,5 +15,5 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_with_identifier_as_param.carbon:[[@LINE+1]]:11: Expected parameter declaration.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_with_identifier_as_param.carbon:[[@LINE+1]]:11: Expected parameter declaration.
 fn foo(bar);

+ 1 - 2
toolchain/parser/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon

@@ -3,12 +3,11 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 2},
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+1]]:4: `fn` introducer should be followed by a name.
 fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z);

+ 0 - 1
toolchain/parser/testdata/function/declaration/params.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/function/declaration/with_return_type.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/function/definition/basic.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},

+ 1 - 2
toolchain/parser/testdata/function/definition/fail_identifier_in_statements.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},
@@ -19,5 +18,5 @@ fn F() {
   // Note: this might become valid depending on the expression syntax. This test
   // shouldn't be taken as a sign it should remain invalid.
   bar
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/function/definition/fail_identifier_in_statements.carbon:[[@LINE+1]]:1: Expected `;` after expression.
+// CHECK:STDERR: toolchain/parser/testdata/function/definition/fail_identifier_in_statements.carbon:[[@LINE+1]]:1: Expected `;` after expression.
 }

+ 0 - 1
toolchain/parser/testdata/function/definition/with_params.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/function/definition/with_return_type.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/generics/deduced_params/empty.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 4 - 5
toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},
@@ -34,14 +33,14 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon:[[@LINE+1]]:12: A `(` for parameters is required after deduced parameters.
+// CHECK:STDERR: toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon:[[@LINE+1]]:12: A `(` for parameters is required after deduced parameters.
 class Foo[];
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon:[[@LINE+1]]:18: A `(` for parameters is required after deduced parameters.
+// CHECK:STDERR: toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon:[[@LINE+1]]:18: A `(` for parameters is required after deduced parameters.
 class Foo[a: i32];
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon:[[@LINE+1]]:17: A `(` for parameters is required after deduced parameters.
+// CHECK:STDERR: toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon:[[@LINE+1]]:17: A `(` for parameters is required after deduced parameters.
 interface Bar[] {}
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon:[[@LINE+1]]:23: A `(` for parameters is required after deduced parameters.
+// CHECK:STDERR: toolchain/parser/testdata/generics/deduced_params/fail_no_parens.carbon:[[@LINE+1]]:23: A `(` for parameters is required after deduced parameters.
 interface Bar[a: i32] {}

+ 0 - 1
toolchain/parser/testdata/generics/deduced_params/one.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/deduced_params/one_suffix_comma.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/deduced_params/six.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/deduced_params/two.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/deduced_params/two_suffix_comma.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/generic_params/basic.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/generics/generic_params/template.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/generics/generic_params/template_addr.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'foo'},

+ 0 - 1
toolchain/parser/testdata/generics/interface/basic.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/interface/declaration.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/interface/empty_body.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 1 - 2
toolchain/parser/testdata/generics/interface/fail_missing_name.carbon

@@ -3,13 +3,12 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT: {kind: 'InterfaceDeclaration', text: 'interface', has_error: yes, subtree_size: 2},
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/interface/fail_missing_name.carbon:[[@LINE+1]]:11: `interface` introducer should be followed by a name.
+// CHECK:STDERR: toolchain/parser/testdata/generics/interface/fail_missing_name.carbon:[[@LINE+1]]:11: `interface` introducer should be followed by a name.
 interface {
 }

+ 2 - 3
toolchain/parser/testdata/generics/interface/fail_missing_open_curly.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Bar'},
@@ -14,8 +13,8 @@
 // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
 // CHECK:STDOUT: ]
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/interface/fail_missing_open_curly.carbon:[[@LINE+1]]:15: `interface` should either end with a `;` for a declaration or have a `{ ... }` block for a definition.
+// CHECK:STDERR: toolchain/parser/testdata/generics/interface/fail_missing_open_curly.carbon:[[@LINE+1]]:15: `interface` should either end with a `;` for a declaration or have a `{ ... }` block for a definition.
 interface Bar Baz {}
 
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/interface/fail_missing_open_curly.carbon:[[@LINE+1]]:14: `interface` should either end with a `;` for a declaration or have a `{ ... }` block for a definition.
+// CHECK:STDERR: toolchain/parser/testdata/generics/interface/fail_missing_open_curly.carbon:[[@LINE+1]]:14: `interface` should either end with a `;` for a declaration or have a `{ ... }` block for a definition.
 interface Foo

+ 1 - 2
toolchain/parser/testdata/generics/interface/fail_no_impl_allowed.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},
@@ -28,7 +27,7 @@
 // CHECK:STDOUT: ]
 
 interface Foo {
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/interface/fail_no_impl_allowed.carbon:[[@LINE+1]]:39: Method implementations are not allowed in interfaces.
+  // CHECK:STDERR: toolchain/parser/testdata/generics/interface/fail_no_impl_allowed.carbon:[[@LINE+1]]:39: Method implementations are not allowed in interfaces.
   fn Add[self: Self](b: Self) -> Self {
     print("You can't do that.");
   }

+ 2 - 3
toolchain/parser/testdata/generics/interface/fail_self_param_syntax.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},
@@ -43,9 +42,9 @@
 // CHECK:STDOUT: ]
 
 interface Foo {
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/interface/fail_self_param_syntax.carbon:[[@LINE+1]]:13: Expected parameter declaration.
+  // CHECK:STDERR: toolchain/parser/testdata/generics/interface/fail_self_param_syntax.carbon:[[@LINE+1]]:13: Expected parameter declaration.
   fn Sub[me Self](b: Self) -> Self;
 
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/interface/fail_self_param_syntax.carbon:[[@LINE+1]]:10: Expected parameter declaration.
+  // CHECK:STDERR: toolchain/parser/testdata/generics/interface/fail_self_param_syntax.carbon:[[@LINE+1]]:10: Expected parameter declaration.
   fn Mul[Self](b: Self) -> Self;
 }

+ 0 - 1
toolchain/parser/testdata/generics/interface/non_instance_fn.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/interface/self_pointer.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'InterfaceIntroducer', text: 'interface'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/named_constraint/basic.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'NamedConstraintIntroducer', text: 'constraint'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},

+ 1 - 2
toolchain/parser/testdata/generics/named_constraint/fail_no_impl_allowed.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'NamedConstraintIntroducer', text: 'constraint'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'Foo'},
@@ -28,6 +27,6 @@
 // CHECK:STDOUT: ]
 
 constraint Foo {
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/generics/named_constraint/fail_no_impl_allowed.carbon:[[@LINE+1]]:39: Method implementations are not allowed in interfaces.
+  // CHECK:STDERR: toolchain/parser/testdata/generics/named_constraint/fail_no_impl_allowed.carbon:[[@LINE+1]]:39: Method implementations are not allowed in interfaces.
   fn Add[self: Self](b: Self) -> Self {}
 }

+ 0 - 1
toolchain/parser/testdata/generics/params/empty.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/params/one.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/params/one_suffix_comma.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/params/six.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/params/two.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/generics/params/two_suffix_comma.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:   {kind: 'ClassIntroducer', text: 'class'},
 // CHECK:STDOUT:   {kind: 'DeclaredName', text: 'Foo'},

+ 0 - 1
toolchain/parser/testdata/if/basic.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},

+ 0 - 1
toolchain/parser/testdata/if/else.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},

+ 4 - 5
toolchain/parser/testdata/if/fail_else_unbraced.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},
@@ -62,15 +61,15 @@
 
 fn F() {
   if (a)
-    // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_else_unbraced.carbon:[[@LINE+1]]:5: Expected braced code block.
+    // CHECK:STDERR: toolchain/parser/testdata/if/fail_else_unbraced.carbon:[[@LINE+1]]:5: Expected braced code block.
     if (b)
-      // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_else_unbraced.carbon:[[@LINE+1]]:7: Expected braced code block.
+      // CHECK:STDERR: toolchain/parser/testdata/if/fail_else_unbraced.carbon:[[@LINE+1]]:7: Expected braced code block.
       c;
     else
-      // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_else_unbraced.carbon:[[@LINE+1]]:7: Expected braced code block.
+      // CHECK:STDERR: toolchain/parser/testdata/if/fail_else_unbraced.carbon:[[@LINE+1]]:7: Expected braced code block.
       d;
   else
-    // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_else_unbraced.carbon:[[@LINE+1]]:5: Expected braced code block.
+    // CHECK:STDERR: toolchain/parser/testdata/if/fail_else_unbraced.carbon:[[@LINE+1]]:5: Expected braced code block.
     e;
   if (x) { f; }
   else if (x) { g; }

+ 5 - 6
toolchain/parser/testdata/if/fail_errors.carbon

@@ -3,7 +3,6 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},
@@ -40,13 +39,13 @@
 // CHECK:STDOUT: ]
 
 fn F() {
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:6: Expected `(` after `if`.
+  // CHECK:STDERR: toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:6: Expected `(` after `if`.
   if a {}
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:7: Expected expression.
+  // CHECK:STDERR: toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:7: Expected expression.
   if () {}
-  // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:9: Unexpected tokens before `)`.
+  // CHECK:STDERR: toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:9: Unexpected tokens before `)`.
   if (b c) {}
   if (d)
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+2]]:1: Expected braced code block.
-// CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:1: Expected expression.
+// CHECK:STDERR: toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+2]]:1: Expected braced code block.
+// CHECK:STDERR: toolchain/parser/testdata/if/fail_errors.carbon:[[@LINE+1]]:1: Expected expression.
 }

+ 3 - 4
toolchain/parser/testdata/if/fail_unbraced.carbon

@@ -4,7 +4,6 @@
 //
 // TODO: This should have an error.
 // AUTOUPDATE
-// RUN: %{not} %{carbon-run-parser}
 // CHECK:STDOUT: [
 // CHECK:STDOUT:     {kind: 'FunctionIntroducer', text: 'fn'},
 // CHECK:STDOUT:     {kind: 'DeclaredName', text: 'F'},
@@ -37,10 +36,10 @@
 
 fn F() {
   if (a)
-    // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_unbraced.carbon:[[@LINE+1]]:5: Expected braced code block.
+    // CHECK:STDERR: toolchain/parser/testdata/if/fail_unbraced.carbon:[[@LINE+1]]:5: Expected braced code block.
     if (b)
-      // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_unbraced.carbon:[[@LINE+1]]:7: Expected braced code block.
+      // CHECK:STDERR: toolchain/parser/testdata/if/fail_unbraced.carbon:[[@LINE+1]]:7: Expected braced code block.
       if (c)
-        // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/if/fail_unbraced.carbon:[[@LINE+1]]:9: Expected braced code block.
+        // CHECK:STDERR: toolchain/parser/testdata/if/fail_unbraced.carbon:[[@LINE+1]]:9: Expected braced code block.
         d;
 }

+ 0 - 1
toolchain/parser/testdata/lit.cfg.py

@@ -1 +0,0 @@
-../../../bazel/testing/lit.cfg.py

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů