def match_filter_xcode(actual, expected): if actual: if not TestCmd.is_List(actual): actual = actual.split('\n') if not TestCmd.is_List(expected): expected = expected.split('\n') actual = [a for a in actual if 'No recorder, buildTask: <Xcode3BuildTask:' not in a] return match(actual, expected)
def match(a, b): if a == b: return True if not TestCmd.is_List(a): a = a.split('\n') if not TestCmd.is_List(b): b = b.split('\n') if expected_error in '\n'.join(a) + '\n'.join(b): saw_expected_error[0] = True return True return False
def match_filter_xcode(actual, expected): if actual: if not TestCmd.is_List(actual): actual = actual.split('\n') if not TestCmd.is_List(expected): expected = expected.split('\n') actual = [a for a in actual if 'No recorder, buildTask: <Xcode3BuildTask:' not in a and 'Beginning test session' not in a and 'Writing diagnostic log' not in a and 'Logs/Test/' not in a] return match(actual, expected)
def match_custom(lines, expect): if expect != expect_stdout: # stderr if lines == expect: return 1 return None # taken directly from TestCmd if not TestCmd.is_List(lines): # CRs mess up matching (Windows) so split carefully lines = re.split('\r?\n', lines) # record number of matches for each regex n_actual = [0] * len(expected_patterns) for line in lines: for i, regex in enumerate(expected_patterns): if regex.search(line): n_actual[i] += 1 break # compare actual counts to expected counts for n_expect in expected_counts: if n_actual == n_expect: return 1 return None