anjiahao1 opened a new pull request, #4190: URL: https://github.com/apache/nuttx-apps/pull/4190
## Summary Start each cmocka test program with posix_spawn(). exec_builtin() replaces the calling task with the test program, so the runner can only wait for the pid it happens to return, and the environment and argument list are fixed by the builtin interface. Start each test with posix_spawn() instead and wait for the pid it provides: the test runs as a separate task, the runner keeps its own context, and the environment can be passed. Add the LIBC_EXECFUNCS dependency that the spawn call needs. ## Impact * Is new feature added? NO - test runner fix. * Impact on user: NO * Impact on build: YES - TESTING_CMOCKA now requires LIBC_EXECFUNCS. * Impact on hardware: NO * Impact on documentation: NO * Impact on security: NO * Impact on compatibility: NO ## Testing Build host: Linux x86_64, gcc 13.3. ``` tools/configure.sh -a <apps> sim:nsh # enable CONFIG_TESTING_CMOCKA, CONFIG_TESTING_CMOCKA_PROG, # CONFIG_LIBC_REGEX (with ALLOW_MIT_COMPONENTS) and CONFIG_LIBC_EXECFUNCS make -j$(nproc) ``` The build completes; the log shows both the runner and the library compiled: ``` CC: .../testing/cmocka/cmocka_main.c CC: cmocka/src/cmocka.c LD: nuttx ``` The cmocka sources are downloaded by the existing Makefile rule. ## PR verification * [x] This PR introduces only one functional change. * [x] I have updated all required description fields above. * [x] My PR adheres to Contributing Guidelines and Documentation. * [ ] My PR is still work in progress (not ready for review). * [x] My PR is ready for review and can be safely merged into a codebase. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
