From 225d842e4c5aa5159c4e706f071dba4a9fdb0958 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 16 Feb 2020 21:57:53 +0530 Subject: unit tests: Make assertBuildNoOp check stricter We also need to verify that no CustomBuild targets were rebuilt. --- run_unittests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/run_unittests.py b/run_unittests.py index f26ab7e18..7a229033a 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1706,15 +1706,15 @@ class BasePlatformTests(unittest.TestCase): if self.backend is Backend.ninja: self.assertIn(ret.split('\n')[-2], self.no_rebuild_stdout) elif self.backend is Backend.vs: - # Ensure that some target said that no rebuild was done + # Ensure that some target of each type said that no rebuild was done + # We always have at least one CustomBuild target for the regen checker self.assertIn('CustomBuild:\n All outputs are up-to-date.', ret) self.assertIn('ClCompile:\n All outputs are up-to-date.', ret) self.assertIn('Link:\n All outputs are up-to-date.', ret) # Ensure that no targets were built - clre = re.compile('ClCompile:\n [^\n]*cl', flags=re.IGNORECASE) - linkre = re.compile('Link:\n [^\n]*link', flags=re.IGNORECASE) - self.assertNotRegex(ret, clre) - self.assertNotRegex(ret, linkre) + self.assertNotRegex(ret, re.compile('CustomBuild:\n [^\n]*cl', flags=re.IGNORECASE)) + self.assertNotRegex(ret, re.compile('ClCompile:\n [^\n]*cl', flags=re.IGNORECASE)) + self.assertNotRegex(ret, re.compile('Link:\n [^\n]*link', flags=re.IGNORECASE)) elif self.backend is Backend.xcode: raise unittest.SkipTest('Please help us fix this test on the xcode backend') else: -- cgit v1.2.3