From 12e5a74d017dd4d79fb06204a8941ce0a30e4090 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 21 Jul 2026 16:15:32 -0400 Subject: [PATCH] tools: Report pack include-only updates Return the combined header and include write result from make_pack_header. This ensures callers observe repairs that modify only the generated include. Replace the existing bug characterization with a regression test for the correct return contract. Generated file contents remain unchanged. --- tools/make_pack_header.py | 2 +- tools/make_pack_header_test.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/make_pack_header.py b/tools/make_pack_header.py index c7a300c41..91f39837f 100644 --- a/tools/make_pack_header.py +++ b/tools/make_pack_header.py @@ -167,7 +167,7 @@ def write_pack_header(out_header_file, out_inc_file, inputs): sys.exit(1) retval2 = write_file_if_changed(out_file, result) - return retval1 #or retval2 + return retval1 or retval2 def main(argv): diff --git a/tools/make_pack_header_test.py b/tools/make_pack_header_test.py index 7deee1a09..c267fb06a 100644 --- a/tools/make_pack_header_test.py +++ b/tools/make_pack_header_test.py @@ -34,7 +34,7 @@ class MakePackHeaderTest(unittest.TestCase): read_golden('make_pack_header', 'cef_resources.inc')) self.assertEqual(_get_cpp_var_name(include_path), 'Resources') - def test_writer_sorting_idempotence_and_current_inc_only_return_bug(self): + def test_writer_sorting_idempotence_and_inc_only_repair(self): inputs = [testdata_dir('resources_b.h'), testdata_dir('resources_a.h')] with tempfile.TemporaryDirectory() as temporary_directory: header = os.path.join(temporary_directory, 'cef_resources.h') @@ -48,9 +48,7 @@ class MakePackHeaderTest(unittest.TestCase): with open(include, 'w', encoding='utf-8') as output: output.write('corrupt include') - # Characterize the known bug: the include is repaired but its write - # result is ignored while the unchanged header result is returned. - self.assertFalse(write_pack_header(header, include, inputs)) + self.assertTrue(write_pack_header(header, include, inputs)) with open(include, encoding='utf-8') as output: self.assertEqual(output.read(), read_golden('make_pack_header', 'cef_resources.inc'))