driver_file_test.cpp 956 B

123456789101112131415161718192021222324252627282930313233
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include <string>
  5. #include "llvm/ADT/SmallVector.h"
  6. #include "toolchain/driver/driver_file_test_base.h"
  7. namespace Carbon::Testing {
  8. namespace {
  9. class DriverFileTest : public DriverFileTestBase {
  10. public:
  11. using DriverFileTestBase::DriverFileTestBase;
  12. auto GetDefaultArgs() -> llvm::SmallVector<std::string> override {
  13. CARBON_FATAL() << "ARGS is always set in these tests";
  14. }
  15. auto DoExtraCheckReplacements(std::string& check_line) -> void override {
  16. // TODO: Disable token output, it's not interesting for these tests.
  17. if (llvm::StringRef(check_line).starts_with("// CHECK:STDOUT: {")) {
  18. check_line = "// CHECK:STDOUT: {{.*}}";
  19. }
  20. }
  21. };
  22. } // namespace
  23. CARBON_FILE_TEST_FACTORY(DriverFileTest);
  24. } // namespace Carbon::Testing