Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit 12f5be5

Browse files
author
Deepika Bhavnani
authored
Merge pull request #27 from jamesbeyond/test
Add log test for cpu usage example
2 parents e379217 + 7fd476e commit 12f5be5

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

mbed_app.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"macros": ["MBED_CPU_STATS_ENABLED"]
2+
"macros": ["MBED_CPU_STATS_ENABLED"],
3+
"target_overrides": {
4+
"*": {
5+
"platform.stdio-convert-newlines": 1
6+
}
7+
}
38
}

tests/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Testing examples
2+
3+
Examples are tested using tool [htrun](https://github.com/ARMmbed/mbed-os-tools/tree/master/packages/mbed-host-tests) and templated print log.
4+
5+
To run the test, use following command after you build the example:
6+
```
7+
mbedhtrun -d D: -p COM4 -m K64F -f .\BUILD\K64F\GCC_ARM\cpu-usage.bin --compare-log tests\cpu-usage.log
8+
```
9+
10+
11+
More details about `htrun` are [here](https://github.com/ARMmbed/htrun#testing-mbed-os-examples).
12+

tests/cpu-usage.log

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Idle: \d+ Usage: \d+
2+
Idle: \d+ Usage: \d+
3+
Idle: \d+ Usage: \d+
4+
Idle: \d+ Usage: \d+
5+
Idle: \d+ Usage: \d+
6+
Idle: \d+ Usage: \d+
7+
Idle: \d+ Usage: \d+
8+
Idle: \d+ Usage: \d+

0 commit comments

Comments
 (0)