diff options
author | Simon Glass <sjg@chromium.org> | 2023-07-19 17:48:23 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-07-24 09:34:10 -0600 |
commit | c649153b5885ebd2beeb9ebf997896da8321c480 (patch) | |
tree | 2c4e8c2190872d18b06a180d1e78687fe461bc7a /tools/buildman/func_test.py | |
parent | ad99599ca2b584eb388e09406c6ef2b21a488f0a (diff) |
buildman: Correct operation of MAINTAINERS N:
This doesn't work as intended. Instead it scans every defconfig file
in the source tree.
Fix it and add a test.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/func_test.py')
-rw-r--r-- | tools/buildman/func_test.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 71f3029f153..164dd7c620a 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -933,8 +933,8 @@ Active aarch64 armv8 - armltd total_compute board2 # Move the contents of the second file into this one, removing the # second file, to check multiple records in a single file. - data = orig_data + tools.read_file(other, binary=False) - tools.write_file(main, data, binary=False) + both_data = orig_data + tools.read_file(other, binary=False) + tools.write_file(main, both_data, binary=False) os.remove(other) params_list, warnings = self._boards.build_board_list(config_dir, src) self.assertEquals(2, len(params_list)) @@ -942,7 +942,7 @@ Active aarch64 armv8 - armltd total_compute board2 # Add another record, this should be ignored with a warning extra = '\n\nAnother\nM: Fred\nF: configs/board9_defconfig\nS: other\n' - tools.write_file(main, data + extra, binary=False) + tools.write_file(main, both_data + extra, binary=False) params_list, warnings = self._boards.build_board_list(config_dir, src) self.assertEquals(2, len(params_list)) self.assertEquals( @@ -950,7 +950,7 @@ Active aarch64 armv8 - armltd total_compute board2 warnings) # Add another TARGET to the Kconfig - tools.write_file(main, data, binary=False) + tools.write_file(main, both_data, binary=False) orig_kc_data = tools.read_file(kc_file) extra = (b''' if TARGET_BOARD2 @@ -975,3 +975,12 @@ endif self.assertEquals( ['WARNING: board2_defconfig: No TARGET_BOARD2 enabled'], warnings) + tools.write_file(kc_file, orig_kc_data) + + # Replace the last F: line of board 2 with an N: line + data = ''.join(both_data.splitlines(keepends=True)[:-1]) + tools.write_file(main, data + 'N: oa.*2\n', binary=False) + params_list, warnings = self._boards.build_board_list(config_dir, src) + self.assertEquals(2, len(params_list)) + self.assertFalse(warnings) + |