mirror of
https://github.com/aphrody-labs/cef.git
synced 2026-10-13 21:07:07 +00:00
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.
This commit is contained in:
1 parent
75745dce64
commit
12e5a74d01
2 files changed
+3
-5
No files matched your search
@@ -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):
|
||||
|
||||
@@ -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'))
|
||||
|
||||
Reference in new issue
Block a user