1570af302Sopenharmony_ciimport difflib 2570af302Sopenharmony_ciimport os 3570af302Sopenharmony_ci 4570af302Sopenharmony_cidef compare_file(): 5570af302Sopenharmony_ci if os.path.exists(r'result.html'): 6570af302Sopenharmony_ci os.remove(r'result.html') 7570af302Sopenharmony_ci f = open(r'../libc-test/REPORT','r') 8570af302Sopenharmony_ci a = f.readlines() 9570af302Sopenharmony_ci f.close() 10570af302Sopenharmony_ci f = open(r'REPORT','r') 11570af302Sopenharmony_ci b = f.readlines() 12570af302Sopenharmony_ci f.close() 13570af302Sopenharmony_ci if a != b: 14570af302Sopenharmony_ci compare = difflib.HtmlDiff() 15570af302Sopenharmony_ci c = compare.make_file(a,b) 16570af302Sopenharmony_ci f = open(r'result.html','w') 17570af302Sopenharmony_ci f.write(c) 18570af302Sopenharmony_ci f.close 19570af302Sopenharmony_ciif __name__ == '__main__': 20570af302Sopenharmony_ci compare_file()