[riot-notifications] [RIOT-OS/RIOT] tests/thread_float: improve and add script (#16901)

Alexandre Abadie notifications at github.com
Wed Sep 29 17:44:13 CEST 2021

@aabadie commented on this pull request.

> +    assert first + delta > second
+    assert first - delta < second
+def testfunc(child):
+    child.expect_exact("THREADS CREATED")
+    child.expect_exact("THREAD t1 start")
+    child.expect_exact("THREAD t2 start")
+    child.expect_exact("THREAD t3 start")
+    child.expect(r"t(\d): (\d{3}\.\d+)\r\n")
+    first_thread = int(child.match.group(1))
+    # Note: intentionally keeping the float output as string to also test that printf("%f", ...)
+    # prints the exact same char sequence for the same float value each time
+    first_result = child.match.group(2)
+    child.expect(r"t(\d): (\d{3}\.\d+)")

    child.expect(r"t(\d): (\d{3}\.\d+)\r\n")

Just noticed that this is documented here: https://github.com/RIOT-OS/RIOT/tree/master/tests#automated-tests-guidelines

There are other candidates for this below.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210929/e7ad6022/attachment-0001.htm>

More information about the notifications mailing list