linguini1 opened a new pull request, #17653:
URL: https://github.com/apache/nuttx/pull/17653

   ## Summary
   
   Depends on NuttX apps PR: https://github.com/apache/nuttx-apps/pull/3270
   
   The cmocka test framework is compiled as a library by default in 
(https://github.com/apache/nuttx-apps/pull/3270), and does not include the 
`cmocka` application binary unless `CONFIG_TESTING_CMOCKA_ASLIB=n`. This commit 
updates the defconfigs which include cmocka to also compile the cmocka binary, 
which is the behaviour they were created with.
   
   ## Impact
   
   None, just preserves the behaviour of these two defconfigs.
   
   ## Testing
   
   Testing from https://github.com/apache/nuttx-apps/pull/3270:
   
   Compilation of the cmocka libary without the binary using `sim:nsh` as a 
basis:
   
   ```console
   $ make -j
   Create version.h
   LN: platform/board to /home/linguini/coding/nuttx-space/apps/platform/dummy
   Register: dd
   Register: nsh
   Register: sh
   Register: gcov
   Register: hello
   Register: dumpstack
   Register: gpio
   Register: ostest
   CP:  /home/linguini/coding/nuttx-space/nuttx/include/nuttx/config.h
   CP:  /home/linguini/coding/nuttx-space/nuttx/include/nuttx/fs/hostfs.h
   LD:  nuttx
   Pac SIM with dynamic libs..
   '/usr/lib/libm.so.6' -> 'sim-pac/libs/libm.so.6'
   '/usr/lib/libz.so.1' -> 'sim-pac/libs/libz.so.1'
   '/usr/lib/libc.so.6' -> 'sim-pac/libs/libc.so.6'
   '/usr/lib64/ld-linux-x86-64.so.2' -> 'sim-pac/libs/ld-linux-x86-64.so.2'
   '/lib64/ld-linux-x86-64.so.2' -> 'sim-pac/ld-linux-x86-64.so.2'
   SIM elf with dynamic libs archive in nuttx.tgz
   ```
   
   Then, when disabling `CONFIG_TESTING_CMOCKA_ASLIB`, the compilation is:
   
   ```
   $ make -j
   Create version.h
   LN: platform/board to /home/linguini/coding/nuttx-space/apps/platform/dummy
   Register: cmocka
   Register: hello
   Register: nsh
   Register: sh
   Register: dd
   Register: gcov
   Register: gpio
   Register: dumpstack
   Register: ostest
   CP:  /home/linguini/coding/nuttx-space/nuttx/include/nuttx/config.h
   LD:  nuttx
   Pac SIM with dynamic libs..
   '/usr/lib/libm.so.6' -> 'sim-pac/libs/libm.so.6'
   '/usr/lib/libz.so.1' -> 'sim-pac/libs/libz.so.1'
   '/usr/lib/libc.so.6' -> 'sim-pac/libs/libc.so.6'
   '/usr/lib64/ld-linux-x86-64.so.2' -> 'sim-pac/libs/ld-linux-x86-64.so.2'
   '/lib64/ld-linux-x86-64.so.2' -> 'sim-pac/ld-linux-x86-64.so.2'
   SIM elf with dynamic libs archive in nuttx.tgz
   ```
   
   and I can run the cmocka application on sim:
   
   ```
   nsh> cmocka --help
   an elegant unit testing framework for C with support for mock objects
   Usage: cmocka [OPTION [ARG]] ...
    -?, --help       show this help statement
    -l, --list       display only the names of testcases and testsuite,
                     don't execute them
    -t, --test A     only run cases where case function name matches A pattern
    -p, --skip B     don't run cases where case function name matches B pattern
    -s, --suite C    only run suites where PROGNAME matches C pattern
    -f, --output-path use xml report instead of standard output
    -d, --shuffle-seed shuffling test sequence,between 0 and 99999,
                      when seed is 0,use time(NULL) as the seed for
                      the random number generator
   Example: cmocka --suite mm|sched --test Test* --skip TestNuttxMm0[123]
   
   nsh>
   ```


-- 
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]

Reply via email to