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
7ff3a2a5
Commit
7ff3a2a5
authored
7 years ago
by
Alexandre Abadie
Browse files
Options
Downloads
Patches
Plain Diff
tests/pthread_cleanup: migrate to testrunner script
parent
7bab0339
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/pthread_cleanup/Makefile
+3
-0
3 additions, 0 deletions
tests/pthread_cleanup/Makefile
tests/pthread_cleanup/tests/01-run.py
+26
-0
26 additions, 0 deletions
tests/pthread_cleanup/tests/01-run.py
tests/pthread_cleanup/tests/01-test
+0
-87
0 additions, 87 deletions
tests/pthread_cleanup/tests/01-test
with
29 additions
and
87 deletions
tests/pthread_cleanup/Makefile
+
3
−
0
View file @
7ff3a2a5
...
...
@@ -7,3 +7,6 @@ BOARD_BLACKLIST := arduino-mega2560 waspmote-pro arduino-uno arduino-duemilanove
USEMODULE
+=
pthread
include
$(RIOTBASE)/Makefile.include
test
:
tests/01-run.py
This diff is collapsed.
Click to expand it.
tests/pthread_cleanup/tests/01-run.py
0 → 100755
+
26
−
0
View file @
7ff3a2a5
#!/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
(
'
START
'
)
for
i
in
range
(
5
):
child
.
expect_exact
(
'
<SCOPE {}{}>
'
.
format
(
i
+
1
,
'
/
'
if
i
==
4
else
''
))
child
.
expect_exact
(
'
Cleanup: <5>
'
)
child
.
expect_exact
(
'
</SCOPE 4>
'
)
child
.
expect_exact
(
'
</SCOPE 3>
'
)
for
i
in
(
3
,
2
,
1
):
child
.
expect_exact
(
'
Cleanup: <{}>
'
.
format
(
i
))
child
.
expect_exact
(
'
Result: 1234
'
)
child
.
expect
(
'
SUCCESS
'
)
if
__name__
==
"
__main__
"
:
sys
.
exit
(
testrunner
.
run
(
testfunc
))
This diff is collapsed.
Click to expand it.
tests/pthread_cleanup/tests/01-test
deleted
100755 → 0
+
0
−
87
View file @
7bab0339
#!/usr/bin/env expect
set timeout 5
set pid [spawn make term]
puts "-*- Spawened $pid -*-\n"
set once 0
set result 1
while { $once == 0 } {
set once 1
expect {
"Start." {}
timeout { break }
}
expect {
"<SCOPE 0>" {}
timeout { break }
}
expect {
"<SCOPE 1>" {}
timeout { break }
}
expect {
"<SCOPE 2>" {}
timeout { break }
}
expect {
"<SCOPE 3>" {}
timeout { break }
}
expect {
"<SCOPE 4>" {}
timeout { break }
}
expect {
"<SCOPE 5 />" {}
timeout { break }
}
expect {
"Cleanup: <5>" {}
timeout { break }
}
expect {
"</SCOPE 4>" {}
timeout { break }
}
# Cleanup 4 has execute == 0.
expect {
"</SCOPE 3>" {}
timeout { break }
}
# pthread_exit is called here
expect {
"Cleanup: <3>" {}
timeout { break }
}
expect {
"Cleanup: <2>" {}
timeout { break }
}
expect {
"Cleanup: <1>" {}
timeout { break }
}
expect {
"Result: 1234" {}
timeout { break }
}
expect {
"Done." {}
timeout { break }
}
set result 0
}
if { $result == 0 } {
puts "\n-*- Test successful! -*-\n"
} else {
puts "\n-*- TEST HAD ERRORS! -*-\n"
}
spawn kill -9 $pid
wait
close
exit $result
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