From 811dc7657a372d368e937a915d9ecbcbba2c84a6 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Sat, 11 Nov 2017 20:50:55 +0100
Subject: [PATCH] tests/sizeof_tcb: migrate to testrunner

---
 tests/sizeof_tcb/Makefile        |  3 +++
 tests/sizeof_tcb/main.c          |  2 +-
 tests/sizeof_tcb/tests/01-run.py | 31 +++++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100755 tests/sizeof_tcb/tests/01-run.py

diff --git a/tests/sizeof_tcb/Makefile b/tests/sizeof_tcb/Makefile
index c9a38e0717..3e47d51eda 100644
--- a/tests/sizeof_tcb/Makefile
+++ b/tests/sizeof_tcb/Makefile
@@ -10,3 +10,6 @@ include ../Makefile.tests_common
 # DISABLE_MODULE += core_msg
 
 include $(RIOTBASE)/Makefile.include
+
+test:
+	tests/01-run.py
diff --git a/tests/sizeof_tcb/main.c b/tests/sizeof_tcb/main.c
index 66f4650cff..1d7db7b7f2 100644
--- a/tests/sizeof_tcb/main.c
+++ b/tests/sizeof_tcb/main.c
@@ -58,6 +58,6 @@ int main(void)
     P(stack_size);
 #endif
 
-    puts("Done.");
+    puts("SUCCESS");
     return 0;
 }
diff --git a/tests/sizeof_tcb/tests/01-run.py b/tests/sizeof_tcb/tests/01-run.py
new file mode 100755
index 0000000000..5d568051f6
--- /dev/null
+++ b/tests/sizeof_tcb/tests/01-run.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2017 Inria
+#
+# This file is subject to the terms and conditions of the GNU Lesser
+# General Public License v2.1. See the file LICENSE in the top level
+# directory for more details.
+
+import os
+import sys
+
+sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+import testrunner
+
+
+def testfunc(child):
+    child.expect_exact('\tmember, sizeof, offsetof')
+    child.expect_exact('sizeof(thread_t): 36')
+    child.expect_exact('\tsp            4   0')
+    child.expect_exact('\tstatus        1   4')
+    child.expect_exact('\tpriority      1   5')
+    child.expect_exact('\tpid           2   6')
+    child.expect_exact('\trq_entry      4   8')
+    child.expect_exact('\twait_data     4  12')
+    child.expect_exact('\tmsg_waiters   4  16')
+    child.expect_exact('\tmsg_queue    12  20')
+    child.expect_exact('\tmsg_array     4  32')
+    child.expect_exact('SUCCESS')
+
+if __name__ == "__main__":
+    sys.exit(testrunner.run(testfunc))
-- 
GitLab