Gw Unit Testing: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
= Qt creator build configuration for unit testing = | |||
# In Qt Creator open Projects. | # In Qt Creator open Projects. | ||
# In Build tab: | # In Build tab: | ||
## In 'Edit build configuration' 'Add'->'Clone Selected'. Name it something like ''unittest'' | ## In 'Edit build configuration' click 'Add'->'Clone Selected'. Name it something like ''unittest'' | ||
## In 'General' change 'Build directory', so unit test executable doesn't overwrite the previous program | ## In 'General' change 'Build directory', so unit test executable doesn't overwrite the previous program | ||
## In 'Build Steps'->'qmake' click 'Details' add ''DEFINES+=UNIT_TEST'' to 'Additional Arguments' field | ## In 'Build Steps'->'qmake' click 'Details' add ''DEFINES+=UNIT_TEST'' to 'Additional Arguments' field | ||
Line 8: | Line 10: | ||
## Add ''--show_progress=no --log_level=all'' to 'Arguments' field | ## Add ''--show_progress=no --log_level=all'' to 'Arguments' field | ||
= gw source = | |||
== Rationale == | |||
The idea is to automate unit testing as much as possible and run tests whenever new firmware is built. | |||
This implies that there is at least one Martem device of each type with a fixed IP address that is never relocated. | |||
After the firmware is built and packaged it is sent to the designated device and unit tests are run, results | |||
retrieved and output to the user. | |||
[[Kasutaja:MarkTomm|MarkTomm]] | [[Kasutaja:MarkTomm|MarkTomm]] 13. veebruar 2015, kell 10:46 (EET) |
Revision as of 08:46, 13 February 2015
Qt creator build configuration for unit testing
- In Qt Creator open Projects.
- In Build tab:
- In 'Edit build configuration' click 'Add'->'Clone Selected'. Name it something like unittest
- In 'General' change 'Build directory', so unit test executable doesn't overwrite the previous program
- In 'Build Steps'->'qmake' click 'Details' add DEFINES+=UNIT_TEST to 'Additional Arguments' field
- In Run tab:
- 'Clone selected' in 'Run configuration' (same as for 'Edit build configuration')
- Add --show_progress=no --log_level=all to 'Arguments' field
gw source
Rationale
The idea is to automate unit testing as much as possible and run tests whenever new firmware is built. This implies that there is at least one Martem device of each type with a fixed IP address that is never relocated. After the firmware is built and packaged it is sent to the designated device and unit tests are run, results retrieved and output to the user.
MarkTomm 13. veebruar 2015, kell 10:46 (EET)