Example usage of the mbed_stats_thread_get_each API.

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Mon May 13 19:02:36 2019 +0100
Parent:
20:7dd1d11eaa3b
Child:
22:fad33e988407
Commit message:
Merge pull request #26 from jamesbeyond/test

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

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/thread-statistics.log Show annotated file Show diff for this revision Revisions of this file
--- a/mbed_app.json	Mon Feb 25 21:28:11 2019 +0000
+++ b/mbed_app.json	Mon May 13 19:02:36 2019 +0100
@@ -1,3 +1,8 @@
 {
-    "macros": ["MBED_THREAD_STATS_ENABLED"]
+    "macros": ["MBED_THREAD_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 19:02:36 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\thread-statistics.bin --compare-log tests\thread-statistics.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/thread-statistics.log	Mon May 13 19:02:36 2019 +0100
@@ -0,0 +1,20 @@
+ID: 0x[0-9a-fA-F]+
+Name: main
+State: \d+
+Priority: \d+
+Stack Size: \d+
+Stack Space: \d+
+
+ID: 0x[0-9a-fA-F]+
+Name: rtx_idle
+State: \d+
+Priority: \d+
+Stack Size: \d+
+Stack Space: \d+
+
+ID: 0x[0-9a-fA-F]+
+Name: rtx_timer
+State: \d+
+Priority: \d+
+Stack Size: \d+
+Stack Space: \d+