def generate_test_cases(self): """This function is used to generate the test cases using the sensor model. Args: self: Instance of the class. Returns: True on success else False. Raises: NA. """ os.chdir(self.current_dir) os.chdir("./../../../tools/sensor_model") command = "make proto" if not general_functions.execute_command(command): logging.error("Unable to make the proto in sensor model.") return False if self.asic_mode: command = "".join(["python gen_testcases.py --testdir=", self.test_case_dir]) else: command = "".join(["python gen_testcases.py --testdir=", self.test_case_dir, " --asic_mode=False"]) if not general_functions.execute_command(command): logging.error("unable to generate test cases from sensor model") return False os.chdir(self.current_dir) return True
def remove_existing_test_cases(self): """This function is used to remove the existing test cases. Args: self: Instance of the class. Returns: True on success else False. Raises: NA. """ os.chdir(self.test_case_dir) command = "rm -rf *" if not general_functions.execute_command(command): logging.error("Unable to clean the existing test cases.") return False os.chdir("./../../../../tools/sensor_model") if not general_functions.execute_command("make clean"): logging.error("Unable to clean the sensor model folder.") return False os.chdir(self.current_dir) return True