autoupdate: mention in the output tests that would still fail after the update (#7877)

If a test would still fail post-autoupdate due to either mismatched
`fail_` prefix or due to being NOAUTOUPDATE, the test is reported as `?`
instead of `.` in the incremental progress output, and a message is
listed after the progress output describing the problem. For example:

```console
Problems that require manual fixes:
  - `toolchain/check/testdata/basics/zz_prefix_probe.carbon` split `bad_missing_prefix.carbon` failed; if failure is expected, add the `fail_` prefix.
  - `toolchain/driver/testdata/fail_config.carbon` succeeded; if success is expected, remove the `fail_` prefix.
```

This change caused the `NOAUTOUPDATE` test
`toolchain/driver/testdata/fail_config.carbon` to fail, because when run
under autoupdate (or with `bazel run`), the install manifest would be
present, and the test is checking that it's not. Fixed by using the VFS
to look for the manifest, which then required fixing
toolchain/driver:driver_test to set up a real filesystem VFS so that it
*could* find the manifest.

With this change, there should no longer be a reason to manually run
file_test in addition to running autoupdate.

Assisted-by: Claude via Antigravity
This commit is contained in:
Richard Smith authored and GitHub committed 2026-10-01 19:40:30 +00:00
1 parent 3dadff7d01
commit d9106700c6
5 files changed
+136 -63

No files matched your search

+11 -9
View File
@@ -14,7 +14,6 @@
#include "clang/Lex/HeaderSearch.h"
#include "common/check.h"
#include "common/command_line.h"
#include "common/filesystem.h"
#include "common/version.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/STLExtras.h"
@@ -193,22 +192,25 @@ auto ConfigSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
{.key = "VERSION", .value = Version::String.str()},
};
// Try to read the installation digest and include that.
auto read_result = Filesystem::Cwd().ReadFileToString(
driver_env.installation->digest_path());
if (!read_result.ok()) {
// Try to read the installation digest and include that. This goes through the
// driver's filesystem so that tests get consistent results regardless of
// whether the digest happens to exist on the real filesystem.
auto read_result = driver_env.fs->getBufferForFile(
driver_env.installation->digest_path().native());
if (!read_result) {
CARBON_DIAGNOSTIC(ConfigFailedToReadDigest, Error,
"unable to read the installation's digest file: {0}",
std::string);
"unable to read the installation's digest file: {0}: {1}",
std::string, std::string);
driver_env.emitter.Emit(ConfigFailedToReadDigest,
read_result.error().ToString());
driver_env.installation->digest_path().native(),
read_result.getError().message());
// Remember that we encountered an error but continue to give a minimally
// useful `config` output.
result = false;
} else {
data.push_back({.key = "INSTALL_DIGEST",
.value = llvm::StringRef(*read_result).rtrim().str()});
.value = (*read_result)->getBuffer().rtrim().str()});
}
// Compute and print Clang's config entries if we can. This will have been