From c3c0039f24c786a43e19103ab897f9cb85c18245 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Fri, 10 Nov 2017 09:30:10 +0100
Subject: [PATCH] tests/pkg_libcoap: migrate to testrunner

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

diff --git a/tests/pkg_libcoap/Makefile b/tests/pkg_libcoap/Makefile
index b1a95637de..7564cd18b4 100644
--- a/tests/pkg_libcoap/Makefile
+++ b/tests/pkg_libcoap/Makefile
@@ -14,3 +14,6 @@ USEMODULE += gnrc_sock_udp
 USEPKG += libcoap
 
 include $(RIOTBASE)/Makefile.include
+
+test:
+	tests/01-run.py
diff --git a/tests/pkg_libcoap/main.c b/tests/pkg_libcoap/main.c
index fe48a4d4f1..829c3def2b 100644
--- a/tests/pkg_libcoap/main.c
+++ b/tests/pkg_libcoap/main.c
@@ -18,6 +18,6 @@
 
 int main(void)
 {
-    puts("Libcoap compiled!");
+    puts("SUCCESS: Libcoap compiled!");
     return 0;
 }
diff --git a/tests/pkg_libcoap/tests/01-run.py b/tests/pkg_libcoap/tests/01-run.py
new file mode 100755
index 0000000000..20ac72cfff
--- /dev/null
+++ b/tests/pkg_libcoap/tests/01-run.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import math
+
+sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
+import testrunner
+
+
+def testfunc(child):
+    child.expect_exact('SUCCESS: Libcoap compiled!')
+
+if __name__ == "__main__":
+    sys.exit(testrunner.run(testfunc))
-- 
GitLab