Skip to content

testing/drivertest: Run all framebuffer cases and select one via cmocka - #4006

Merged
GUIDINGLI merged 2 commits into
apache:masterfrom
FASTSHIFT:fix_drivertest_fb
Nov 12, 2026
Merged

GUIDINGLI merged 2 commits into
apache:masterfrom
FASTSHIFT:fix_drivertest_fb

Conversation

@FASTSHIFT

Copy link
Copy Markdown
Contributor

Summary

drivertest_framebuffer selected a testcase with a private -t <number>
option and ran only case 0 by default. Register all four cases in
main() and drop that option. A single case is now selected with the
cmocka runner's own filter:

cmocka -s cmocka_driver_framebuffer -t drivertest_framebuffer_white

Running cmocka_driver_framebuffer -p <devpath> directly runs every case.
The usage text is updated, and the macros that only served the old option
parsing are removed.

A second commit fixes existing nxstyle errors in the file (missing blank
lines after declarations). checkpatch.sh checks whole files, so they
would otherwise fail CI.

Impact

  • Only testing/drivers/drivertest/drivertest_framebuffer.c.
  • Behavior change: -t <number> is removed, and running the program
    without a filter now runs all four cases instead of case 0.
  • No Kconfig or documentation changes.

Testing

  • Host: Ubuntu 22.04 x86_64, gcc 13.1.0
  • Base: apache/nuttx 066314c6373, nuttx-apps ee3d67104 plus this PR
  • Config: sim:nsh plus CONFIG_SIM_X11FB, CONFIG_VIDEO_FB,
    CONFIG_TESTING_CMOCKA, CONFIG_TESTING_CMOCKA_PROG,
    CONFIG_TESTING_DRIVER_TEST (and CONFIG_ALLOW_MIT_COMPONENTS for
    regex). Clean build: no warnings.
  • checkpatch.sh -c -u -m -g on the commits, and -f on the file: pass.
nsh> cmocka -l
...
tests
    drivertest_framebuffer_black
    drivertest_framebuffer_white
    drivertest_framebuffer_cross
    drivertest_framebuffer_vertical

nsh> cmocka -s cmocka_driver_framebuffer -t drivertest_framebuffer_white
[==========] tests: Running 1 test(s).
[ RUN      ] drivertest_framebuffer_white
[       OK ] drivertest_framebuffer_white
[  PASSED  ] 1 test(s).

nsh> cmocka -s cmocka_driver_framebuffer
[==========] tests: Running 4 test(s).
[ RUN      ] drivertest_framebuffer_black
[       OK ] drivertest_framebuffer_black
[ RUN      ] drivertest_framebuffer_white
[       OK ] drivertest_framebuffer_white
[ RUN      ] drivertest_framebuffer_cross
[       OK ] drivertest_framebuffer_cross
[ RUN      ] drivertest_framebuffer_vertical
[       OK ] drivertest_framebuffer_vertical
[  PASSED  ] 4 test(s).

duliang2008 and others added 2 commits November 10, 2026 15:08
Register all four framebuffer testcases in main() and drop the private
-t <number> option. A single case can now be selected with the cmocka
runner's own filter, e.g. "cmocka -s cmocka_driver_framebuffer -t
drivertest_framebuffer_white", and running the program directly executes
every case. Update the usage text accordingly and remove the macros that
were only used by the old option parsing.

Signed-off-by: duxiaoliang <duxiaoliang@xiaomi.com>
Add the blank lines required after declarations.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
@GUIDINGLI
GUIDINGLI merged commit 8473dab into apache:master Nov 12, 2026
41 checks passed
@FASTSHIFT
FASTSHIFT deleted the fix_drivertest_fb branch November 16, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants