if parms['boardname'] != self.dut.board['board']: self._print(1, "board fail", parms['boardname']) rv_ok = False if parms['short_addr'] != self.dut.board['saddr']: self._print(1, "saddr fail", parms['short_addr']) rv_ok = False if expapp != None and parms['appname'] != expapp: self._print(1, "appname fail", parms['appname']) rv_ok = False return rv_ok if __name__ == '__main__': rv = T.parse_test_options( __doc__, ['setupcfg', 'boardcfg', 'bindir', 'peer', 'duts', 'noflash']) if not rv: sys.exit(1) testnodes = T.get_testnodes(rv["setupcfg"], rv['boardcfg'], rv['bindir']) peer = testnodes.get(rv["peer"]) duts = {dut: testnodes.get(dut) for dut in rv["duts"]} for d in [peer] + duts.values(): d.board["saddr"] = eval(d.board["saddr"]) suites = [] if not rv['noflash']:
self.dut.comm.write("I") rxdata = self.dut.comm.readline().strip() assert rxdata.startswith("IDLE") self.dut.comm.write(" ") rxdata = self.dut.comm.readline().strip() assert rxdata.startswith("IDLE") # === test main ================================================================ if __name__ == '__main__': rv = T.parse_test_options(__doc__, ["setupcfg", "boardcfg", "bindir", "duts", "peer", "noflash"]) if not rv: sys.exit(1) testnodes = T.get_testnodes(rv["setupcfg"], rv['boardcfg'], rv['bindir']) peer = testnodes.get(rv["peer"]) duts = {dut: testnodes.get(dut) for dut in rv["duts"]} suites = [] if not rv['noflash']: s = T.testsuite_factory(T.Test_Fw_Flash, "flash_rdiag_%s" % peer, dut = peer, fw="rdiag", params = rv) suites.append(s) for d in duts.values():
] targets = {} for m in mfl: targets[m] = [ l.split() for l in z.read(m).split("\n") if l.startswith("all:") ][0][1:] for k, v in targets.items(): for t in v: class T(Test_Compile): MAKEFILE = k TARGET = t BUILDDIR = builddir T.__name__ = "compile_%s_%s" % ("_".join(k.split(os.sep)[-2:]), t) suite.addTest(loader.loadTestsFromTestCase(T)) return suite if __name__ == "__main__": rv = T.parse_test_options(__doc__, ["builddir"]) if not rv: sys.exit(1) arcfile = rv['ARGS'].pop(0) builddir = rv['builddir'] T.test_unzip_file(arcfile, builddir, **rv) runner = T.get_runner(**rv) T.unittest.main(testRunner=runner, argv=[sys.argv[0]] + rv['ARGS'])