diff options
Diffstat (limited to 'test/suite/wtscenario.py')
-rw-r--r-- | test/suite/wtscenario.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/test/suite/wtscenario.py b/test/suite/wtscenario.py index 750a7bcfd00..8576b3ac876 100644 --- a/test/suite/wtscenario.py +++ b/test/suite/wtscenario.py @@ -64,6 +64,32 @@ def log2chr(val): megabyte = 1024 * 1024 +def make_scenarios(*args, **kwargs): + """ + The standard way to create scenarios for WT tests. + Scenarios can be combined by listing them all as arguments. + A final prune= and/or prunelong= argument may be given that + forces the list of entries in the scenario to be pruned. + The result is a (combined) scenario that has been checked + for name duplicates and has been given names and numbers. + """ + scenes = multiply_scenarios('.', *args) + pruneval = None + prunelong = None + for key in kwargs: + if key == 'prune': + pruneval = kwargs[key] + elif key == 'prunelong': + prunelong = kwargs[key] + else: + raise AssertionError( + 'make_scenarios: unexpected named arg: ' + key) + if pruneval != None or prunelong != None: + pruneval = pruneval if pruneval != None else -1 + prunelong = prunelong if prunelong != None else -1 + scenes = prune_scenarios(scenes, pruneval, prunelong) + return number_scenarios(scenes) + def check_scenarios(scenes): """ Make sure all scenarios have unique case insensitive names @@ -235,7 +261,7 @@ class wtscenario: scen.lmax = lmax scen.cache_size = cache s.append((scen.shortName(), dict(session_create_scenario=scen))) - return s + return make_scenarios(s) def shortName(self): """ |