Example to demonstrate usage of `mbed_stats_cpu_get()` API usage

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Mon May 13 20:02:06 2019 +0100
Parent:
21:65112b9f2e80
Child:
23:c6babfdff3b1
Commit message:
Merge pull request #29 from jamesbeyond/test

Add log test for cpu stats example
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cpu-stats

Changed in this revision

mbed_app.json Show annotated file Show diff for this revision Revisions of this file
tests/README.md Show annotated file Show diff for this revision Revisions of this file
tests/cpu-stats.log Show annotated file Show diff for this revision Revisions of this file
--- a/mbed_app.json	Mon Feb 25 21:27:38 2019 +0000
+++ b/mbed_app.json	Mon May 13 20:02:06 2019 +0100
@@ -1,3 +1,8 @@
 {
-    "macros": ["MBED_CPU_STATS_ENABLED"]
+    "macros": ["MBED_CPU_STATS_ENABLED"],
+    "target_overrides": {
+        "*": {
+            "platform.stdio-convert-newlines": 1
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/README.md	Mon May 13 20:02:06 2019 +0100
@@ -0,0 +1,12 @@
+# Testing examples
+
+Examples are tested using tool [htrun](https://github.com/ARMmbed/mbed-os-tools/tree/master/packages/mbed-host-tests) and templated print log. 
+
+To run the test, use following command after you build the example:
+```
+mbedhtrun -d D: -p COM4 -m K64F -f .\BUILD\K64F\GCC_ARM\cpu-stats.bin --compare-log tests\cpu-stats.log
+```
+
+
+More details about `htrun` are [here](https://github.com/ARMmbed/htrun#testing-mbed-os-examples).
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/cpu-stats.log	Mon May 13 20:02:06 2019 +0100
@@ -0,0 +1,19 @@
+Uptime\s+Idle Time\s+Sleep time\s+DeepSleep time
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
+\d+\s+\d+\s+\d+\s+\d+
\ No newline at end of file