Changeset 987 for tester/comparison.py
- Timestamp:
- 07/08/20 23:35:17 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester/comparison.py
r798 r987 7 7 class Comparison: 8 8 def __init__(self, l1, l2): 9 self.list2_file = '' # (last if there are many) file name with goal results (if they are stored in a file) 9 10 self.list1 = self.prepare_fill_in_files(l1) 10 11 self.list2 = self.prepare_fill_in_files(l2) 11 12 self.p1 = 0 # updated position within list1 12 13 self.p2 = 0 # updated position within list2 13 self. ok= True # the final comparison result14 self.equal = True # the final comparison result 14 15 self.result = "" # details of comparing individual lines 15 16 16 17 while not self.finished(): 17 18 if not self.compare_element(): 18 self. ok= False19 self.equal = False 19 20 20 21 @staticmethod … … 38 39 file_name = l[len(globals.SPEC_INSERTPLATFORMDEPENDENTFILE):] 39 40 new_list += self.load_platform_specific(file_name) 41 self.list2_file = file_name 40 42 else: 41 43 new_list.append(l) … … 66 68 waiting = False 67 69 if e2.startswith(globals.SPEC_REGEXP): 68 ok= re.match(e2[len(globals.SPEC_REGEXP):], e1)70 equal = re.match(e2[len(globals.SPEC_REGEXP):], e1) 69 71 else: 70 ok= self.compare_strings(e1, e2) # ignoring the discrimination of /\ will work only when regexp's are not used72 equal = self.compare_strings(e1, e2) # ignoring the discrimination of /\ will work only when regexp's are not used 71 73 self.result += repr(e1) + " " 72 if ok:74 if equal: 73 75 self.p2 += 1 74 76 else: … … 77 79 self.p2 += 1 78 80 else: 79 ok= True81 equal = True 80 82 else: 81 83 self.p2 += 1 82 if ok:84 if equal: 83 85 self.result += globals.ANSI_SETGREEN + "ok" + globals.ANSI_RESET + "\n" # if both are identical, we display only the left one 84 86 else: … … 86 88 self.result += repr(e2disp) + "\n" 87 89 self.p1 += 1 88 return ok90 return equal
Note: See TracChangeset
for help on using the changeset viewer.