mirror of
https://github.com/linux-usb-gadgets/libusbgx.git
synced 2025-07-13 06:19:43 +03:00
libusbgx: tests: Update guideline changes
Change-Id: I3bc3124c1e0abec017799da84d628bf97b79737f Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com> [Update description] Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
This commit is contained in:
parent
895d7cef49
commit
887fe1cc20
1 changed files with 5 additions and 3 deletions
|
@ -119,7 +119,7 @@ argument before running functions which may fail.
|
|||
|
||||
# Composing test cases
|
||||
All test cases are defined in list of UnitTest structures. You can define test
|
||||
case by macros provided by cmocka or by USBG_TEST macro.
|
||||
case by macros provided by cmocka or by USBG_TEST or USBG_TEST_TS macro.
|
||||
|
||||
USBG_TEST is similar to unit_test_setup_teardown from cmocka, but always uses
|
||||
the same teardown (teardown_state) and names test case with custom string.
|
||||
|
@ -137,9 +137,11 @@ Simplest way to add more tests is defining test states and new setup functions,
|
|||
combining them with existing testing functions using USBG_TEST. You can also
|
||||
write own test function. When you have test and setup prepared, add
|
||||
|
||||
USBG_TEST("test_name", test_function, setup_function),
|
||||
USBG_TEST_TS("test_name", test_function, setup_function),
|
||||
or
|
||||
USBG_TEST("test_name", test_function, setup_function, teardown_function),
|
||||
|
||||
at the end of tests[] array in main. Remember to add documentation to the case
|
||||
at the end of tests[] array. Remember to add documentation to the case
|
||||
(see Documenting test cases).
|
||||
|
||||
# Removing tests
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue