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
3608a9a6
Commit
3608a9a6
authored
7 years ago
by
Sebastian Meiling
Browse files
Options
Downloads
Patches
Plain Diff
tests, thread_flood: update test script and output
parent
08eb6c39
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/thread_flood/main.c
+18
-4
18 additions, 4 deletions
tests/thread_flood/main.c
tests/thread_flood/tests/01-run.py
+2
-1
2 additions, 1 deletion
tests/thread_flood/tests/01-run.py
with
20 additions
and
5 deletions
tests/thread_flood/main.c
+
18
−
4
View file @
3608a9a6
/*
/*
* Copyright (C) 2015 Hamburg University of Applied Sciences
* Copyright (C) 2015
-2017
Hamburg University of Applied Sciences
*
*
* This file is subject to the terms and conditions of the GNU Lesser
* 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
* General Public License v2.1. See the file LICENSE in the top level
...
@@ -16,16 +16,19 @@
...
@@ -16,16 +16,19 @@
* Spawns sleeping threads till the scheduler's capacity is exhausted.
* Spawns sleeping threads till the scheduler's capacity is exhausted.
*
*
* @author Andreas "Paul" Pauli <andreas.pauli@haw-hamburg.de>
* @author Andreas "Paul" Pauli <andreas.pauli@haw-hamburg.de>
* @author Sebastian Meiling <s@mlng.net>
*
*
* @}
* @}
*/
*/
#include
<errno.h>
#include
<errno.h>
#include
<stdio.h>
#include
<stdio.h>
#include
"thread.h"
#include
"thread.h"
#include
"kernel_types.h"
/* One stack for all threads. DON'T TRY THIS AT HOME!! */
/* One stack for all threads. DON'T TRY THIS AT HOME!! */
static
char
dummy_stack
[
THREAD_STACKSIZE_
DEFAULT
];
static
char
dummy_stack
[
THREAD_STACKSIZE_
IDLE
];
static
void
*
thread_func
(
void
*
arg
)
static
void
*
thread_func
(
void
*
arg
)
{
{
...
@@ -35,6 +38,7 @@ static void *thread_func(void *arg)
...
@@ -35,6 +38,7 @@ static void *thread_func(void *arg)
int
main
(
void
)
int
main
(
void
)
{
{
kernel_pid_t
thr_id
=
KERNEL_PID_UNDEF
;
kernel_pid_t
thr_id
=
KERNEL_PID_UNDEF
;
unsigned
thr_cnt
=
0
;
puts
(
"[START] Spawning threads"
);
puts
(
"[START] Spawning threads"
);
do
{
do
{
...
@@ -43,11 +47,21 @@ int main(void)
...
@@ -43,11 +47,21 @@ int main(void)
THREAD_PRIORITY_MAIN
-
1
,
THREAD_PRIORITY_MAIN
-
1
,
THREAD_CREATE_SLEEPING
|
THREAD_CREATE_STACKTEST
,
THREAD_CREATE_SLEEPING
|
THREAD_CREATE_STACKTEST
,
thread_func
,
NULL
,
"dummy"
);
thread_func
,
NULL
,
"dummy"
);
++
thr_cnt
;
printf
(
"."
);
}
while
(
-
EOVERFLOW
!=
thr_id
);
}
while
(
-
EOVERFLOW
!=
thr_id
);
puts
(
""
);
/* decrease by 1 because last thread_create failed */
--
thr_cnt
;
if
(
-
EOVERFLOW
==
thr_id
)
{
/* expect (MAXTHREADS - 2), as main and idle thread take a PID each */
puts
(
"[SUCCESS] Thread creation successfully aborted"
);
if
(
thr_cnt
==
(
MAXTHREADS
-
2
))
{
printf
(
"[SUCCESS]"
);
}
else
{
printf
(
"[ERROR] expected %u,"
,
(
MAXTHREADS
-
2
));
}
}
printf
(
" created %u
\n
"
,
thr_cnt
);
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
tests/thread_flood/tests/01-run.py
+
2
−
1
View file @
3608a9a6
...
@@ -9,7 +9,8 @@ import testrunner
...
@@ -9,7 +9,8 @@ import testrunner
def
testfunc
(
child
):
def
testfunc
(
child
):
child
.
expect_exact
(
u
'
[START] Spawning threads
'
)
child
.
expect_exact
(
u
'
[START] Spawning threads
'
)
child
.
expect_exact
(
u
'
[SUCCESS] Thread creation
'
)
child
.
expect
(
r
'
\.+
'
)
child
.
expect
(
r
'
\[SUCCESS\] created \d+
'
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
sys
.
exit
(
testrunner
.
run
(
testfunc
))
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