|
@@ -37,6 +37,7 @@
|
|
|
#include "absl/flags/flag.h"
|
|
#include "absl/flags/flag.h"
|
|
|
#include "absl/flags/parse.h"
|
|
#include "absl/flags/parse.h"
|
|
|
#include "absl/strings/str_join.h"
|
|
#include "absl/strings/str_join.h"
|
|
|
|
|
+#include "common/build_data.h"
|
|
|
#include "common/check.h"
|
|
#include "common/check.h"
|
|
|
#include "common/error.h"
|
|
#include "common/error.h"
|
|
|
#include "common/exe_path.h"
|
|
#include "common/exe_path.h"
|
|
@@ -138,7 +139,7 @@ static auto CompareFailPrefix(llvm::StringRef filename, bool success) -> void {
|
|
|
auto FileTestBase::GetBazelCommand(BazelMode mode) -> std::string {
|
|
auto FileTestBase::GetBazelCommand(BazelMode mode) -> std::string {
|
|
|
RawStringOstream args;
|
|
RawStringOstream args;
|
|
|
args << "bazel " << ((mode == BazelMode::Test) ? "test" : "run") << " "
|
|
args << "bazel " << ((mode == BazelMode::Test) ? "test" : "run") << " "
|
|
|
- << GetBazelLabel() << " ";
|
|
|
|
|
|
|
+ << BuildData::TargetName << " ";
|
|
|
|
|
|
|
|
switch (mode) {
|
|
switch (mode) {
|
|
|
case BazelMode::Autoupdate:
|
|
case BazelMode::Autoupdate:
|
|
@@ -159,11 +160,6 @@ auto FileTestBase::GetBazelCommand(BazelMode mode) -> std::string {
|
|
|
return args.TakeStr();
|
|
return args.TakeStr();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-auto FileTestBase::GetBazelLabel() -> std::string {
|
|
|
|
|
- const char* target = getenv("TEST_TARGET");
|
|
|
|
|
- return target ? target : "<target>";
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// Runs the FileTestAutoupdater, returning the result.
|
|
// Runs the FileTestAutoupdater, returning the result.
|
|
|
static auto RunAutoupdater(FileTestBase* test_base, const TestFile& test_file,
|
|
static auto RunAutoupdater(FileTestBase* test_base, const TestFile& test_file,
|
|
|
bool dry_run) -> bool {
|
|
bool dry_run) -> bool {
|