mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
In explorer, we already support parsing a string_view, so use that. In toolchain, we need to build support, probably using vfs, so that's a todo. bazel test //explorer:file_test --runs_per_test=5 - branch: Stats over 250 runs: max = 18.3s, min = 5.2s, avg = 11.2s, dev = 2.9s - trunk: Stats over 250 runs: max = 22.3s, min = 5.9s, avg = 12.1s, dev = 2.8s Not a dramatic improvement, but maybe more effective long-term, and this'd been requested on #2876
36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
// 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 <filesystem>
|
|
#include <string>
|
|
|
|
#include "llvm/ADT/SmallVector.h"
|
|
#include "llvm/ADT/StringRef.h"
|
|
#include "toolchain/driver/driver_file_test_base.h"
|
|
|
|
namespace Carbon::Testing {
|
|
namespace {
|
|
|
|
class SemanticsFileTest : public DriverFileTestBase {
|
|
public:
|
|
using DriverFileTestBase::DriverFileTestBase;
|
|
|
|
auto MakeArgs(const llvm::SmallVector<llvm::StringRef>& test_files)
|
|
-> llvm::SmallVector<llvm::StringRef> override {
|
|
llvm::SmallVector<llvm::StringRef> args({"dump", "semantics-ir"});
|
|
args.insert(args.end(), test_files.begin(), test_files.end());
|
|
return args;
|
|
}
|
|
};
|
|
|
|
} // namespace
|
|
|
|
auto RegisterFileTests(const llvm::SmallVector<std::filesystem::path>& paths)
|
|
-> void {
|
|
SemanticsFileTest::RegisterTests<SemanticsFileTest>("SemanticsFileTest",
|
|
paths);
|
|
}
|
|
|
|
} // namespace Carbon::Testing
|