summaryrefslogtreecommitdiff
path: root/tests/generate.py
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-07-18 14:20:18 +0200
committerPatrick Steinhardt <ps@pks.im>2019-07-18 14:29:43 +0200
commit92109976fd48e0c10fe77af8e6a3a82d5c6e665a (patch)
tree97e47301c4a6903500b5d648d9881b5584beebd0 /tests/generate.py
parent29fe79e6538062cffe8aa083136f6cb97a72e724 (diff)
downloadlibgit2-92109976fd48e0c10fe77af8e6a3a82d5c6e665a.tar.gz
tests: fix undercounting of suites
With the introduction of data variants for suites, we started undercounting the number of suites as we didn't account for those that were executed twice. This was then adjusted to count the number of initializers instead, but this fails to account for suites without any initializers at all. Fix the suite count by counting either the number of initializers or, if there is no initializer, count it as a single suite, only.
Diffstat (limited to 'tests/generate.py')
-rw-r--r--[-rwxr-xr-x]tests/generate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/generate.py b/tests/generate.py
index 82e436532..9ed6edef3 100755..100644
--- a/tests/generate.py
+++ b/tests/generate.py
@@ -210,7 +210,7 @@ class TestSuite(object):
module.modified = True
def suite_count(self):
- return sum(len(module.initializers) for module in self.modules.values())
+ return sum(max(1, len(m.initializers)) for m in self.modules.values())
def callback_count(self):
return sum(len(module.callbacks) for module in self.modules.values())