From 3454afb790bb00a7e4276e7af420065c474a18a1 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Mon, 19 Jan 2015 18:43:59 -0500 Subject: [PATCH] Making xfail be RE-compatible --- lib/sumfiles.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/sumfiles.py b/lib/sumfiles.py index d4a06f5..fcfcd26 100644 --- a/lib/sumfiles.py +++ b/lib/sumfiles.py @@ -112,6 +112,12 @@ class DejaResults(object): self.parse_sum_line(cur_results, line) return cur_results + def transform_re (self, xfails): + ret = {} + for r in xfails: + ret[r] = re.compile (r) + return ret + # Compute regressions between RESULTS and BASELINE on BUILDER. # BASELINE will be modified if any new PASSes are seen. # Returns a regression report, as a string. @@ -120,12 +126,20 @@ class DejaResults(object): our_keys.sort() result = '' xfails = self.read_xfail (builder) + xfails_re = self.transform_re (xfails) if xfails is None: xfails = {} for key in our_keys: # An XFAIL entry means we have an unreliable test. - if key in xfails: + cont = False + for x in xfails_re: + if re.match (xfails_re[x], (key)): + cont = True + break + if cont: continue +# if key in xfails: +# continue # A transition to PASS means we should update the baseline. if results[key] == 'PASS': if key not in baseline or baseline[key] != 'PASS':