Ejemplo n.º 1
0
    def __init__(self, metadata, log_file=None):
        """
        @brief Constructor
        @param metadata IDK Metadata object
        @param log_file File to store test results.  If none specified log to STDOUT
        """
        repo_dir = Config().get("working_repo")
        if (not repo_dir):
            raise IDKConfigMissing()

        # Ion scripts need to be run from the base os the repo dir so it has access
        # to resources using relative pathing.  So we just do
        os.chdir(repo_dir)

        self.metadata = metadata
        if (not self.metadata.driver_name):
            raise DriverNotStarted()

        if (log_file):
            self.log_fh = open(log_file, "w")
        else:
            self.log_fh = sys.stdout

        config_path = "%s/%s" % (self.metadata.driver_dir(),
                                 CommConfig.config_filename())
        self.comm_config = CommConfig.get_config_from_file(config_path)
        if (not self.comm_config):
            raise CommConfigReadFail(msg=config_path)

        self.test_runner = nose.core.TextTestRunner(stream=self.log_fh)
Ejemplo n.º 2
0
 def overwrite(self):
     """
     @brief Overwrite the current files with what is stored in the current metadata file.
     """
     self.metadata = Metadata()
     self.comm_config = CommConfig.get_config_from_file(self.metadata)
     self.generate_code(force = True)
Ejemplo n.º 3
0
    def __init__(self, metadata, log_file = None):
        """
        @brief Constructor
        @param metadata IDK Metadata object
        @param log_file File to store test results.  If none specified log to STDOUT
        """
        repo_dir = Config().get("working_repo")
        if(not repo_dir):
            raise IDKConfigMissing()
        
        # Ion scripts need to be run from the base os the repo dir so it has access
        # to resources using relative pathing.  So we just do 
        os.chdir(repo_dir)
        
        self.metadata = metadata
        if(not self.metadata.driver_name):
            raise DriverNotStarted()

        if( log_file ):
            self.log_fh = open(log_file, "w")
        else:
            self.log_fh = sys.stdout
            
        config_path = "%s/%s" % (self.metadata.driver_dir(), CommConfig.config_filename())
        self.comm_config = CommConfig.get_config_from_file(config_path)
        if(not self.comm_config):
            raise CommConfigReadFail(msg=config_path)

        self.test_runner = nose.core.TextTestRunner(stream=self.log_fh)
Ejemplo n.º 4
0
 def overwrite(self):
     """
     @brief Overwrite the current files with what is stored in the current metadata file.
     """
     self.metadata = Metadata()
     self.comm_config = CommConfig.get_config_from_file(self.metadata)
     self.generate_code(force=True)
Ejemplo n.º 5
0
    def init_comm_config(self):
        """
        @brief Create the comm config object by reading the comm_config.yml file.
        """
        log.info("Initialize comm config")
        config_file = self.comm_config_file()

        log.debug(" -- reading comm config from: %s" % config_file)
        if not os.path.exists(config_file):
            raise TestNoCommConfig(msg="Missing comm config.  Try running start_driver or switch_driver")

        self.comm_config = CommConfig.get_config_from_file(config_file)
Ejemplo n.º 6
0
    def init_comm_config(self):
        """
        @brief Create the comm config object by reading the comm_config.yml file.
        """
        log.info("Initialize comm config")
        config_file = self.comm_config_file()

        log.debug(" -- reading comm config from: %s" % config_file)
        if not os.path.exists(config_file):
            raise TestNoCommConfig(
                msg=
                "Missing comm config.  Try running start_driver or switch_driver"
            )

        self.comm_config = CommConfig.get_config_from_file(config_file)