Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Commit a91839c

Browse files
author
Simon Warta
committed
Add hit count test to testObsoleteHeaderDisappears
1 parent 1b3f3c1 commit a91839c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

integrationtests.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ def testObsoleteHeaderDisappears(self):
337337
# A includes B
338338
with cd(os.path.join(ASSETS_DIR, "header-miss-obsolete")):
339339
compileCmd = CLCACHE_CMD + ["/I.", "/nologo", "/EHsc", "/c", "main.cpp"]
340+
cache = clcache.Cache()
340341

341342
with open("A.h", "w") as header:
342343
header.write('#define INFO 1337\n')
@@ -346,13 +347,21 @@ def testObsoleteHeaderDisappears(self):
346347

347348
subprocess.check_call(compileCmd)
348349

350+
with cache.statistics as stats:
351+
oldMisses = stats.numHeaderChangedMisses()
352+
353+
# Make include B.h obsolete
349354
with open("A.h", "w") as header:
350355
header.write('#define INFO 1337\n')
351356
header.write('\n')
352357
os.remove("B.h")
353358

354359
subprocess.check_call(compileCmd)
355360

361+
with cache.statistics as stats:
362+
newMisses = stats.numHeaderChangedMisses()
363+
self.assertEqual(newMisses, oldMisses+1)
364+
356365

357366
class TestRunParallel(unittest.TestCase):
358367
def _zeroStats(self):

0 commit comments

Comments
 (0)