Bug 12724

Summary: Support "make check" on build host via qemu wrappers
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Juro Bystricky <juro.bystricky>
Component: coreAssignee: Unassigned <unassigned>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: Medium CC: meta.mr.watcher, meta.watcher, ross.burton, stephano
Version: 5.99   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Juro Bystricky 2018-05-01 14:10:49 UTC
There is a mechanism to test cross-compiled binaries via ptest infrastructure.
The tests are cross-compiled on build host and assumed to run later on in an image as native binaries via ptest-runner.
It should be also possible to cross-compile the test binaries and run them on the build host as well via qemu wrappers. It is probably not going to be easy, but this way we could (for example) assure a package will not make it into sstate (or package feed) unless it passes some tests. Basically, build would fail if it fails to pass "make check", which would be performed automatically. This would, however, require some additional syntax and updating compliant recipes.

I believe qemu wrappers are mature enough to accomplish this.
Comment 1 Juro Bystricky 2018-05-03 06:27:26 UTC
This would be *** much *** easier to implement if we assumed/mandated binfmt. 
(for example https://wiki.debian.org/QemuUserEmulation). Besides, there is no point in re-inventing the wheel. In principle, a cross-compiled program should "just run" on the build host.
Comment 2 Ross Burton 2018-05-03 07:56:13 UTC
Having lived through scratchbox and scratchbox2, having binfmt/qemu 'just work' is great for the trivial cases but causes a world of pain for the non-trivial ones.

We do have a way to run binaries in qemu-user already (qemu.bbclass) so running a test suite at build time should be possible.
Comment 3 Ross Burton 2018-12-12 12:04:25 UTC
Marking as dup.

*** This bug has been marked as a duplicate of bug 13063 ***