Prefered way to identify target device in tests?

I’m working on getting the tests running with Hexagon, and have a question about identifying the target architecture.

Hexagon LLVM doesn’t use a couple architectures like “x86_64” or “i386”, instead we have many architectures, like “v4”, “v5”, “v55”, “v56”, v60”, so using self.getArchitecture() can be problematic. I’ve got a list of Hexagon architectures in a global supported_hexagon_versions in When I need to check for Hexagon, should I do something like “self.getArchitecture in supported_hexagon_versions”, or something like this:

self.runCmd(“target list”)

if “arch=hexagon--,” in self.res.GetOutput():



The architecture should be available from the test infrastructure. We have many tests that have @expectedFile(archs=re.compile("^mips")). So each test knows its architecture and this should be available in as a member variable of the TestBase object that everyone inherits from. Search for "mips" in all tests. I know some watchpoint tests are different on MIPS because they only have 1 hardware watchpoint available, so they had to work around some issues in those tests. See how they did things and mimic that.