Skip to content

Commit 40ad4fe

Browse files
committed
tests/thread: Add thread_create_basic test.
Simple test for basic thread creation and execution, useful for initial validation of threading implementations. Signed-off-by: Andrew Leech <[email protected]>
1 parent 87f7025 commit 40ad4fe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# test basic thread creation (returns valid thread ID)
2+
# This test only verifies k_thread_create() succeeds, not execution
3+
import _thread
4+
5+
6+
def worker():
7+
pass
8+
9+
10+
# Create thread and check ID is non-zero
11+
tid = _thread.start_new_thread(worker, ())
12+
print(type(tid) == int)
13+
print(tid != 0)
14+
print("done")

0 commit comments

Comments
 (0)