Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
379737bc
Commit
379737bc
authored
7 years ago
by
Alexandre Abadie
Browse files
Options
Downloads
Patches
Plain Diff
tests/thread_msg: migrate to testrunner
parent
0792a5d7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/thread_msg/Makefile
+4
-1
4 additions, 1 deletion
tests/thread_msg/Makefile
tests/thread_msg/main.c
+13
-3
13 additions, 3 deletions
tests/thread_msg/main.c
tests/thread_msg/tests/01-run.py
+19
-0
19 additions, 0 deletions
tests/thread_msg/tests/01-run.py
with
36 additions
and
4 deletions
tests/thread_msg/Makefile
+
4
−
1
View file @
379737bc
APPLICATION
=
thread_msg
include
../Makefile.tests_common
BOARD_INSUFFICIENT_MEMORY
:=
nucleo32-f031 nucleo32-f042
stm32f0discovery
BOARD_INSUFFICIENT_MEMORY
:=
nucleo32-f031 nucleo32-f042
DISABLE_MODULE
+=
auto_init
include
$(RIOTBASE)/Makefile.include
test
:
tests/01-run.py
This diff is collapsed.
Click to expand it.
tests/thread_msg/main.c
+
13
−
3
View file @
379737bc
...
...
@@ -28,7 +28,7 @@ char t1_stack[THREAD_STACKSIZE_MAIN];
char
t2_stack
[
THREAD_STACKSIZE_MAIN
];
char
t3_stack
[
THREAD_STACKSIZE_MAIN
];
kernel_pid_t
p1
,
p2
,
p3
;
kernel_pid_t
p_main
,
p1
,
p2
,
p3
;
void
*
thread1
(
void
*
arg
)
{
...
...
@@ -47,13 +47,15 @@ void *thread1(void *arg)
}
puts
(
"THREAD 1 end
\n
"
);
msg_t
msg
;
msg_send
(
&
msg
,
p_main
);
return
NULL
;
}
void
*
thread2
(
void
*
arg
)
{
(
void
)
arg
;
puts
(
"THREAD 2
\n
"
);
puts
(
"THREAD 2
start
\n
"
);
for
(
int
i
=
0
;;
++
i
)
{
msg_t
msg
,
reply
;
...
...
@@ -70,7 +72,7 @@ void *thread2(void *arg)
void
*
thread3
(
void
*
arg
)
{
(
void
)
arg
;
puts
(
"THREAD 3
\n
"
);
puts
(
"THREAD 3
start
\n
"
);
for
(
int
i
=
0
;;
++
i
)
{
msg_t
msg
;
...
...
@@ -83,6 +85,7 @@ void *thread3(void *arg)
int
main
(
void
)
{
p_main
=
sched_active_pid
;
p1
=
thread_create
(
t1_stack
,
sizeof
(
t1_stack
),
THREAD_PRIORITY_MAIN
-
1
,
THREAD_CREATE_WOUT_YIELD
|
THREAD_CREATE_STACKTEST
,
thread1
,
NULL
,
"nr1"
);
...
...
@@ -93,5 +96,12 @@ int main(void)
THREAD_CREATE_WOUT_YIELD
|
THREAD_CREATE_STACKTEST
,
thread3
,
NULL
,
"nr3"
);
puts
(
"THREADS CREATED
\n
"
);
msg_t
msg
;
/* Wait until thread 1 is done */
msg_receive
(
&
msg
);
puts
(
"SUCCESS"
);
return
0
;
}
This diff is collapsed.
Click to expand it.
tests/thread_msg/tests/01-run.py
0 → 100755
+
19
−
0
View file @
379737bc
#!/usr/bin/env python3
import
os
import
sys
sys
.
path
.
append
(
os
.
path
.
join
(
os
.
environ
[
'
RIOTBASE
'
],
'
dist/tools/testrunner
'
))
import
testrunner
def
testfunc
(
child
):
child
.
expect_exact
(
'
THREADS CREATED
'
)
child
.
expect_exact
(
'
THREAD 1 start
'
)
child
.
expect_exact
(
'
THREAD 2 start
'
)
child
.
expect_exact
(
'
THREAD 3 start
'
)
child
.
expect_exact
(
'
THREAD 1 end
'
)
child
.
expect_exact
(
'
SUCCESS
'
)
if
__name__
==
"
__main__
"
:
sys
.
exit
(
testrunner
.
run
(
testfunc
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment