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
c5eb2423
Commit
c5eb2423
authored
7 years ago
by
Alexandre Abadie
Browse files
Options
Downloads
Patches
Plain Diff
tests/ps_schedstatistics: migrate to testrunner
parent
811dc765
Branches
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/ps_schedstatistics/Makefile
+3
-0
3 additions, 0 deletions
tests/ps_schedstatistics/Makefile
tests/ps_schedstatistics/tests/01-run.py
+65
-0
65 additions, 0 deletions
tests/ps_schedstatistics/tests/01-run.py
with
68 additions
and
0 deletions
tests/ps_schedstatistics/Makefile
+
3
−
0
View file @
c5eb2423
...
...
@@ -14,3 +14,6 @@ USEMODULE += schedstatistics
USEMODULE
+=
printf_float
include
$(RIOTBASE)/Makefile.include
test
:
tests/01-run.py
This diff is collapsed.
Click to expand it.
tests/ps_schedstatistics/tests/01-run.py
0 → 100755
+
65
−
0
View file @
c5eb2423
#!/usr/bin/env python3
# Copyright (C) 2017 Inria
#
# 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
# directory for more details.
import
os
import
sys
sys
.
path
.
append
(
os
.
path
.
join
(
os
.
environ
[
'
RIOTBASE
'
],
'
dist/tools/testrunner
'
))
import
testrunner
PS_EXPECTED
=
(
(
'
\t
pid | name | state Q | pri | stack ( used) |
'
'
base addr | current | runtime | switches
'
),
(
'
\t
- | isr_stack | - - | - | \d+ ( -?\d+) |
'
'
0x\d+ | 0x\d+
'
),
(
'
\t
1 | idle | pending Q | 15 | \d+ ( -?\d+) |
'
'
0x\d+ | 0x\d+ | \d+\.\d+% | \d+
'
),
(
'
\t
2 | main | running Q | 7 | \d+ ( -?\d+) |
'
'
0x\d+ | 0x\d+ | \d+\.\d+% | \d+
'
),
(
'
\t
3 | thread | bl rx _ | 6 | \d+ ( -?\d+) |
'
'
0x\d+ | 0x\d+ | \d+\.\d+% | \d+
'
),
(
'
\t
4 | thread | bl rx _ | 6 | \d+ ( -?\d+) |
'
'
0x\d+ | 0x\d+ | \d+\.\d+% | \d+
'
),
(
'
\t
5 | thread | bl rx _ | 6 | \d+ ( -?\d+) |
'
'
0x\d+ | 0x\d+ | \d+\.\d+% | \d+
'
),
(
'
\t
6 | thread | bl mutex _ | 6 | \d+ ( -?\d+) |
'
'
0x\d+ | 0x\d+ | \d+\.\d+% | \d+
'
),
(
'
\t
7 | thread | bl rx _ | 6 | \d+ ( -?\d+) |
'
'
0x\d+ | 0x\d+ | \d+\.\d+% | \d+
'
),
(
'
\t
| SUM | | | \d+ (\d+)
'
)
)
def
_check_startup
(
child
):
for
i
in
range
(
5
):
child
.
expect_exact
(
'
Creating thread #{}, next={}
'
.
format
(
i
,
(
i
+
1
)
%
5
))
def
_check_help
(
child
):
child
.
sendline
(
'
help
'
)
child
.
expect_exact
(
'
Command Description
'
)
child
.
expect_exact
(
'
---------------------------------------
'
)
child
.
expect_exact
(
'
reboot Reboot the node
'
)
child
.
expect_exact
(
'
ps Prints information about
'
'
running threads.
'
)
def
_check_ps
(
child
):
child
.
sendline
(
'
ps
'
)
for
line
in
PS_EXPECTED
:
child
.
expect
(
line
)
def
testfunc
(
child
):
_check_startup
(
child
)
_check_help
(
child
)
_check_ps
(
child
)
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