return results if __name__ == "__main__": output_path1 = "./temp_outputs/" output_path2 = parserCommad().true_root_dir + "outputs/" input_list = [] with open("./output/input_list.txt", "r") as f: input_list = f.read().split("\n")[:-1] f.close() f = open( "./_MBFL_randomization_higher_order_mutant_set/res_original_version.in", "a") for input_sample in input_list: try: if util.isFileEqual(output_path1 + input_sample + ".out", output_path2 + input_sample + ".out"): f.write("0") else: f.write("1") except MemoryError: f.write("1") except FileNotFoundError: f.write("1") except UnicodeError: f.write("1") f.write("\n") f.close()
true_outputs_list.append(true_outputs_dir + input_path + ".out") defect_root_dir = parserCommad( ).defect_root_dir + "outputs/" # the path of defect outputs for input_path in input_path_list: defect_outputs_list.append(defect_root_dir + input_path + ".out") # we think the number of .txt in output1 is equal in output2 with open("./output/res_vector.in", 'w') as f: f.write("") # create and clean res_record.txt f.close() f = open("./output/res_vector.in", 'a') for true_outputs_path, defect_outputs_path in zip(true_outputs_list, defect_outputs_list): try: if isFileEqual(true_outputs_path, defect_outputs_path): f.write("0") else: f.write("1") except MemoryError: f.write("1") except FileNotFoundError: f.write("1") except UnicodeError: f.write("1") f.write("\n") f.close()