diff options
author | Simon Glass <sjg@chromium.org> | 2023-02-21 12:40:28 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-03-08 11:38:48 -0800 |
commit | 93202d72d75ff2e04c14525bc8b585c5ed0d0740 (patch) | |
tree | 22653175af620a43799612c424316397737834fd /tools/buildman/func_test.py | |
parent | cd37d5bccf63e75af395dd5e3b5dd21abbd86881 (diff) |
buildman: Support disabling LTO
This cuts down build performance considerably and is not always needed,
when checking for build errors, etc.
Add a flag to disable it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/func_test.py')
-rw-r--r-- | tools/buildman/func_test.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 799c609446e..6d1557293f0 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -724,15 +724,32 @@ Some images are invalid''' self.assertEqual(False, control.get_allow_missing(False, True, 2, True)) - def testCmdFile(self): - """Test that the -cmd-out file is produced""" - self._RunControl('-o', self._output_dir) + def check_command(self, *extra_args): + """Run a command with the extra arguments and return the commands used + + Args: + extra_args (list of str): List of extra arguments + + Returns: + list of str: Lines returned in the out-cmd file + """ + self._RunControl('-o', self._output_dir, *extra_args) board0_dir = os.path.join(self._output_dir, 'current', 'board0') self.assertTrue(os.path.exists(os.path.join(board0_dir, 'done'))) cmd_fname = os.path.join(board0_dir, 'out-cmd') self.assertTrue(os.path.exists(cmd_fname)) data = tools.read_file(cmd_fname) - lines = data.splitlines() + return data.splitlines() + + def testCmdFile(self): + """Test that the -cmd-out file is produced""" + lines = self.check_command() self.assertEqual(2, len(lines)) self.assertRegex(lines[0], b'make O=/.*board0_defconfig') self.assertRegex(lines[0], b'make O=/.*-s.*') + + def testNoLto(self): + """Test that the --no-lto flag works""" + lines = self.check_command('-L') + self.assertIn(b'NO_LTO=1', lines[0]) + |