From 02a1cd043ea1b660c926c05dcfb78c81bfa94cb0 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Tue, 10 Nov 2026 17:16:06 -0400 Subject: [PATCH] npu-pack test: the q4nx-container arm removes its fixture directory test_q4nx_container() builds its fixtures under the directory it is given, which is tests/golden when CTest runs it, and never removed them. Every run left tests/golden/q4nx-container/ (container-genre, huge.q4nx, meta.q4nx, short.q4nx, two.q4nx) in the source tree as untracked files. The directory is now cleared on entry and removed on every way out. Co-Authored-By: Claude Fable 5.2 --- tests/npu_pack_import_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/npu_pack_import_test.cpp b/tests/npu_pack_import_test.cpp index ea1437dc9..3aa38a42f 100644 --- a/tests/npu_pack_import_test.cpp +++ b/tests/npu_pack_import_test.cpp @@ -4772,7 +4772,14 @@ void test_q4nx_container(const std::string& root) { namespace fs = std::filesystem; const fs::path dir = fs::path(root) / "q4nx-container"; std::error_code ec; + fs::remove_all(dir, ec); // a directory left by a run that died is not this run's fixture fs::create_directories(dir, ec); + // `root` is the golden directory when CTest runs this, i.e. the source tree: without the removal every run left + // tests/golden/q4nx-container/ behind as untracked files. Removed on every way out of the function. + struct Cleanup { + fs::path p; + ~Cleanup() { std::error_code e; fs::remove_all(p, e); } + } cleanup{dir}; const auto write_container = [&](const std::string& name, const std::string& header_json, int64_t payload, bool truncate_header) {