summaryrefslogtreecommitdiffhomepage
path: root/test/unit
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-04-24 05:08:56 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2020-04-24 05:08:56 +0100
commit6a9a4fe0d46263d4d158803d4a82851e240e0e63 (patch)
treef67061d63bbcf79e503b7472713b92dfdf6b6d41 /test/unit
parentaf9392af1fec054119c8ddcd356ade0ea3fbf913 (diff)
downloadunit-6a9a4fe0d46263d4d158803d4a82851e240e0e63.tar.gz
unit-6a9a4fe0d46263d4d158803d4a82851e240e0e63.tar.bz2
Tests: introduced module version specification in prerequisites.
Diffstat (limited to '')
-rw-r--r--test/unit/main.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/unit/main.py b/test/unit/main.py
index 4507f71a..074d053e 100644
--- a/test/unit/main.py
+++ b/test/unit/main.py
@@ -52,9 +52,21 @@ class TestUnit(unittest.TestCase):
type = self.application_type
for module in self.prerequisites['modules']:
if module in self.available['modules']:
- for version in self.available['modules'][module]:
- self.application_type = type + ' ' + version
+ prereq_version = self.prerequisites['modules'][module]
+ available_versions = self.available['modules'][module]
+
+ if prereq_version == 'all':
+ for version in available_versions:
+ self.application_type = type + ' ' + version
+ super().run(result)
+ elif prereq_version == 'any':
+ self.application_type = type + ' ' + available_versions[0]
super().run(result)
+ else:
+ for version in available_versions:
+ if version.startswith(prereq_version):
+ self.application_type = type + ' ' + version
+ super().run(result)
@classmethod
def main(cls):