Exemple #1
0
    def __init__(self, ec_dir, th, dut, module):
        """Initializes cts class object with given arguments.

    Args:
      ec_dir: Path to ec directory
      th: Name of the test harness board
      dut: Name of the device under test board
      module: Name of module to build/run tests for (e.g. gpio, interrupt)
    """
        self.results_dir = os.path.join(CTS_TEST_RESULT_DIR, dut, module)
        if os.path.isdir(self.results_dir):
            shutil.rmtree(self.results_dir)
        else:
            os.makedirs(self.results_dir)
        self.ec_dir = ec_dir
        self.module = module
        serial_path = os.path.join(CTS_TEST_RESULT_DIR, 'th_serial')
        self.th = board.TestHarness(th, module, self.results_dir, serial_path)
        self.dut = board.DeviceUnderTest(dut, self.th, module,
                                         self.results_dir)
        cts_dir = os.path.join(self.ec_dir, 'cts')
        testlist_path = os.path.join(cts_dir, self.module, 'cts.testlist')
        self.test_names = Cts.get_macro_args(testlist_path, 'CTS_TEST')

        return_codes_path = os.path.join(cts_dir, 'common', 'cts.rc')
        self.get_return_codes(return_codes_path, 'CTS_RC_')
Exemple #2
0
    def __init__(self, ec_dir, dut, module, debug=False):
        """Initializes cts class object with given arguments.

    Args:
      dut: Name of Device Under Test (DUT) board
      ec_dir: String path to ec directory
      dut: Name of board to use for DUT
      module: Name of module to build/run tests for
      debug: Boolean that indicates whether or not on-board debug message
        printing should be enabled.
    """
        self.results_dir = CTS_TEST_RESULT_DIR
        self.ec_dir = ec_dir
        self.module = module
        self.debug = debug
        serial_path = os.path.join(self.ec_dir, 'build', 'cts_th_serial')
        self.th = board.TestHarness(DEFAULT_TH, serial_path)
        self.dut = board.DeviceUnderTest(dut, self.th)
        cts_dir = os.path.join(self.ec_dir, 'cts')
        testlist_path = os.path.join(cts_dir, self.module, 'cts.testlist')
        self.test_names = Cts.get_macro_args(testlist_path, 'CTS_TEST')

        self.debug_output = {}
        for test in self.test_names:
            self.debug_output[test] = []

        return_codes_path = os.path.join(cts_dir, 'common', 'cts.rc')
        self.return_codes = dict(
            enumerate(Cts.get_macro_args(return_codes_path, 'CTS_RC_')))

        self.return_codes[CTS_CONFLICTING_CODE] = 'RESULTS CONFLICT'
        self.return_codes[CTS_CORRUPTED_CODE] = 'CORRUPTED'
        self.test_results = collections.OrderedDict()