Testing cross-compiled binaries
Being able to effortlessly cross-compile binaries for different architectures adds much convenience to the developer workflows of the people involved, but often, these workflows do not stop at building the binaries but also include running tests. If the software also compiles on the host toolchain and the tests are generic enough, running tests on the host might be the easiest way to test the software, although it might cost some time when switching the toolchains and rebuilding frequently. If this is not possible or too time-consuming, one alternative is of course to run any tests on the real target hardware, but depending on the availability of the hardware and the effort of setting up the tests on the hardware, this might also be rather cumbersome. So, often, a practicable middle way is to run tests inside an emulator for the target platform if this is available.
To define an emulator for running tests, the CROSSCOMPILING_EMULATOR
target property...