Gw Unit Testing: Difference between revisions

From Phobos Wiki
Jump to navigation Jump to search
(Uus lehekülg: '# In Qt Creator open Projects. # In Build tab: ## In 'Edit build configuration' 'Add'->'Clone Selected'. Name it something like ''unittest'' ## In 'General' change 'Build directo...')
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
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
# In 'Run' tab:
# In Run tab:
## 'Clone selected' in 'Run configuration' (same as for 'Edit build configuration')
## 'Clone selected' in 'Run configuration' (same as for 'Edit build configuration')
## 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.
== Git branches ==
<pre>
feature-unit-test
</pre>
== Development ==
ATM there is a script scripts/upd-n-run-tests.sh which updates a given device with the latest firmware, runs unit test in that device and outputs
results to the user. It is run at the end of br-build.sh
=== Redmine ===
none
= Gateway/source source =
== Development ==
=== Redmine ===
https://phobos.martem.ee/redmine/issues/2317




[[Kasutaja:MarkTomm|MarkTomm]] 21. november 2014, kell 10:14 (EET)
[[Kasutaja:MarkTomm|MarkTomm]] 13. veebruar 2015, kell 11:26 (EET)

Latest revision as of 09:26, 13 February 2015

Qt creator build configuration for unit testing

  1. In Qt Creator open Projects.
  2. In Build tab:
    1. In 'Edit build configuration' click 'Add'->'Clone Selected'. Name it something like unittest
    2. In 'General' change 'Build directory', so unit test executable doesn't overwrite the previous program
    3. In 'Build Steps'->'qmake' click 'Details' add DEFINES+=UNIT_TEST to 'Additional Arguments' field
  3. In Run tab:
    1. 'Clone selected' in 'Run configuration' (same as for 'Edit build configuration')
    2. 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.

Git branches

feature-unit-test

Development

ATM there is a script scripts/upd-n-run-tests.sh which updates a given device with the latest firmware, runs unit test in that device and outputs results to the user. It is run at the end of br-build.sh

Redmine

none

Gateway/source source

Development

Redmine

https://phobos.martem.ee/redmine/issues/2317


MarkTomm 13. veebruar 2015, kell 11:26 (EET)