RE: Host PC Image - MACHINE genericx86-64 - Unit Testing/TDD with Target Application using the Yocto SDK (krikstone)
"Chen, Qi" <[email protected]>
| Newsgroups | org.yoctoproject.lists.poky |
|---|---|
| Message-ID | <CO6PR11MB5602101481B97B07999164CCEDF82@CO6PR11MB5602.namprd11.prod.outlook.com> |
IMHO, instead of trying to doing native build inside SDK, which I don't think is ever supported, it's easier to: 1. Start the target (maybe via qemu kvm) 2. Write a wrapper script which uses scp & ssh to copy and execute binaries. E.g., copy_and_exec.sh <dir_to_copy> <cmd_to_execute_on_taregt> And what you do is basically 'make DESTDIR=somepath install' and then 'copy_and_exec somepath somecmd'. Regards, Qi From: [email protected] <[email protected]> On Behalf Of Enrique.Herrera via lists.yoctoproject.org Sent: Tuesday, June 4, 2024 8:59 PM To: [email protected] Subject: [poky] Host PC Image - MACHINE genericx86-64 - Unit Testing/TDD with Target Application using the Yocto SDK (krikstone) The following blog post link fully describes my current situation. Exploring Approaches for Unit Testing with the Yocto SDK - Page Fault Blog<https://pagefault.blog/2023/05/16/exploring-approaches-for-unit-testing-with-the-yocto-sdk/> (https://pagefault.blog/2023/05/16/exploring-approaches-for-unit-testing-with-the-yocto-sdk/) I made a CMake project that included the Google Test framework. My intention was to implement TDD, test-driven development. The process of TDD for embedded development is not straightforward. Every time you want to run a test, it takes time to deploy test case binaries to the target. For efficient TDD workflow, developers would need immediate feedback from executing the test cases. Running the test case binaries locally on the developer's host machine would be necessary. The SDK that was created based on YOCTO image recipes is intended to build target binaries. Natively building targeted application libraries in the SDK is possible. However. The build environment setup can be a mess. I know I couldn't get it to work. I followed the recommended solution for the 'Page Fault Blog' post. Basically, set MACHINE configuration variable to "genericax86-64". The libraries that were generated in SDK for your PC will match those in your target image. Despite my efforts, the binaries I built using this SDK did not function properly. [Image removed by sender. r/yocto - Unit Testing/TDD with Target Application using the Yocto SDK]<https://preview.redd.it/unit-testing-tdd-with-target-application-using-the-yocto-sdk-v0-jvsedi5ope4d1.png?width=594&format=png&auto=webp&s=65b80e3becb3defeda4eda4e6cada09147ad2802> When I tried to run the binary, I get "No such file or directory". I found a Stack Overflow<https://stackoverflow.com/questions/46787700/controlling-architecture-in-resulting-rpms> post about issues building generic x86_64 targets, by setting DEFAULTTUNE:genericx86-64 ?= "x86-64" . Still, i get the same result. I cannot be the only one who tried test driven development with YOCTO project.. Enrique Herrera Sr. Software Engineer Embedded Software & Firmware Technical Lead Internal
~WRD0001.jpg
(image/jpeg, 823 B) - not displayed