-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
221 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
*** Settings *** | ||
Documentation Verify basic functionality of the Periph Timer API. | ||
# reset application and check DUT has correct firmware, skip all tests on error | ||
Suite Setup Run Keywords PHiLIP.DUT Reset | ||
... API Firmware Should Match | ||
# reset application before running any test | ||
Test Setup Run Keywords PHiLIP.DUT Reset | ||
... API Sync Shell | ||
|
||
# import libs and keywords | ||
Resource api_shell.keywords.txt | ||
Resource periph_timer.keywords.txt | ||
|
||
# add default tags to all tests | ||
Force Tags periph_timer | ||
|
||
*** Test Cases *** | ||
Timer Init Should Succeed | ||
[Documentation] Verify timer_init return code | ||
API Call Should Succeed Timer Init freq=%{PERIPH_TIMER_HZ} | ||
|
||
Timer Read Should Succeed | ||
[Documentation] Verify timer_read returns a value | ||
API Call Should Succeed Timer Init freq=%{PERIPH_TIMER_HZ} | ||
API Call Should Succeed Timer Read | ||
|
||
Timer Clear Should Succeed | ||
[Documentation] Verify timer_clear return code | ||
API Call Should Succeed Timer Init freq=%{PERIPH_TIMER_HZ} | ||
API Call Should Succeed Timer Clear | ||
|
||
Timer Set Should Succeed | ||
[Documentation] Verify timer_set return code | ||
API Call Should Succeed Timer Init freq=%{PERIPH_TIMER_HZ} | ||
API Call Should Succeed Timer Set ticks=${10000} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
*** Settings *** | ||
Documentation Extended functionality checks of the Periph Timer API. | ||
# reset application and check DUT has correct firmware, skip all tests on error | ||
Suite Setup Run Keywords PHiLIP.DUT Reset | ||
... API Firmware Should Match | ||
# reset application before running any test | ||
Test Setup Run Keywords PHiLIP.DUT Reset | ||
... API Sync Shell | ||
|
||
# import libs and keywords | ||
Resource api_shell.keywords.txt | ||
Resource periph_timer.keywords.txt | ||
|
||
# add default tags to all tests | ||
Force Tags periph_timer | ||
|
||
*** Test Cases *** | ||
Timer Values Should Differ | ||
[Documentation] Verify timer values are different on consecutive reads | ||
API Call Should Succeed Timer Debug Pin dev=0 port=%{DEBUG0_PORT} pin=%{DEBUG0_PIN} | ||
API Call Should Succeed Timer Init freq=%{PERIPH_TIMER_HZ} | ||
API Call Should Succeed Timer Read | ||
${t1}= API Get Last Result As Integer | ||
API Call Should Succeed Timer Read | ||
${t2}= API Get Last Result As Integer | ||
Should Be True ${t2} != ${t1} |
26 changes: 26 additions & 0 deletions
26
tests/periph_timer/tests/03__periph_timer_set_delays.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
*** Settings *** | ||
Documentation Evaluate Delays for numerous timer_set values. | ||
# reset application and check DUT has correct firmware, skip all tests on error | ||
Suite Setup Run Keywords PHiLIP.DUT Reset | ||
... API Firmware Should Match | ||
# reset application before running any test | ||
Test Setup Run Keywords PHiLIP.DUT Reset | ||
... PHILIP Reset | ||
... API Sync Shell | ||
# set test template for data driver tests | ||
Test Template Measure Timer Set Delay | ||
# import libs and keywords | ||
Resource api_shell.keywords.txt | ||
Resource periph_timer.keywords.txt | ||
|
||
# add default tags to all tests | ||
Force Tags periph_timer | ||
|
||
*** Test Cases *** TICKS | ||
Measure Delay of 100 Ticks ${100} | ||
Measure Delay of 200 Ticks ${200} | ||
Measure Delay of 1000 Ticks ${1000} | ||
Measure Delay of 2000 Ticks ${2000} | ||
Measure Delay of 10000 Ticks ${10000} | ||
Measure Delay of 20000 Ticks ${20000} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
*** Settings *** | ||
Library PeriphTimer port=%{PORT} baudrate=%{BAUD} timeout=${%{CMD_TIMEOUT}} connect_wait=${%{CONNECT_WAIT}} | ||
|
||
Resource api_shell.keywords.txt | ||
Resource philip.keywords.txt | ||
|
||
*** Keywords *** | ||
Measure Timer Set Delay | ||
[Documentation] Evaluates delay between timer_set and entering | ||
... the timer ISR callback (measured by PHiLIP) | ||
[Arguments] ${ticks} | ||
PHILIP Trace GPIO 0 | ||
API Call Should Succeed Timer Debug Pin dev=0 port=%{DEBUG0_PORT} pin=%{DEBUG0_PIN} | ||
API Call Should Succeed Timer Init freq=%{PERIPH_TIMER_HZ} | ||
API Call Should Succeed Timer Set dev=0 chan=0 ticks=${ticks} | ||
API Call Should Succeed PHiLIP.Read Trace | ||
${trace}= Set Variable ${RESULT['data']} | ||
${delay}= Evaluate ${trace}[-1][time] - ${trace}[-2][time] | ||
Log Many ${ticks} ${delay} |
Oops, something went wrong.