diff options
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rwxr-xr-x | src/third_party/wiredtiger/test/suite/run.py | 39 |
2 files changed, 33 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 15172f4d0f9..6fd6b2e4cb2 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "eefa8c5a41640a1becb9dbd6cdac17fa61928253" + "commit": "29a290bfb376d6a7d3da02d12b7b6236c028db07" } diff --git a/src/third_party/wiredtiger/test/suite/run.py b/src/third_party/wiredtiger/test/suite/run.py index 86aafdb261c..4e1971cbcbe 100755 --- a/src/third_party/wiredtiger/test/suite/run.py +++ b/src/third_party/wiredtiger/test/suite/run.py @@ -131,7 +131,8 @@ Options:\n\ -p | --preserve preserve output files in WT_TEST/<testname>\n\ -r N | --random-sample N randomly sort scenarios to be run, then\n\ execute every Nth (2<=N<=1000) scenario.\n\ - -s N | --scenario N use scenario N (N can be number or symbolic)\n\ + -s N | --scenario N use scenario N (N can be symbolic, number, or\n\ + list of numbers and ranges in the form 1,3-5,7)\n\ -t | --timestamp name WT_TEST according to timestamp\n\ -v N | --verbose N set verboseness to N (0<=N<=3, default=1)\n\ -i | --ignore-stdout dont fail on unexpected stdout or stderr\n\ @@ -178,16 +179,40 @@ def show_env(verbose, envvar): # e.g. test_util03 -> util reCatname = re.compile(r"test_([^0-9]+)[0-9]*") +# Look for a list of the form 0-9,11,15-17. +def parse_int_list(str): + # Use a dictionary as the result set to avoid repeated list scans. + # (Only the keys are used; the values are ignored.) + ret = {} + # Divide the input into ranges separated by commas. + for r in str.split(","): + # Split the range we got (if it is one). + bounds = r.split("-") + if len(bounds) == 1 and bounds[0].isdigit(): + # It's a single number with no dash. + scenario = int(bounds[0]) + ret[scenario] = True + continue + if len(bounds) == 2 and bounds[0].isdigit() and bounds[1].isdigit(): + # It's two numbers separated by a dash. + for scenario in range(int(bounds[0]), int(bounds[1]) + 1): + ret[scenario] = True + continue + # It's not valid syntax; give up. + return None + return ret + def restrictScenario(testcases, restrict): if restrict == '': return testcases - elif restrict.isdigit(): - s = int(restrict) - return [t for t in testcases - if hasattr(t, 'scenario_number') and t.scenario_number == s] else: - return [t for t in testcases - if hasattr(t, 'scenario_name') and t.scenario_name == restrict] + scenarios = parse_int_list(restrict) + if scenarios is not None: + return [t for t in testcases + if hasattr(t, 'scenario_number') and t.scenario_number in scenarios] + else: + return [t for t in testcases + if hasattr(t, 'scenario_name') and t.scenario_name == restrict] def addScenarioTests(tests, loader, testname, scenario): loaded = loader.loadTestsFromName(testname) |