Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
magic-lantern
magic-lantern
Commits
43e2b44457d4
Commit
8ad75ac3
authored
Apr 15, 2019
by
alex@thinkpad
Browse files
QEMU: updated some test scripts for Python 3
--HG-- branch : qemu
parent
43b9e467ed5a
Changes
3
Hide whitespace changes
Inline
Side-by-side
contrib/qemu/scripts/remove_end_loop.py
View file @
43e2b444
#!/usr/bin/env python3
import
sys
def
remove_end_loop
(
buf
):
...
...
contrib/qemu/tests/run_tests.sh
View file @
43e2b444
...
...
@@ -792,7 +792,7 @@ function test_calls_from {
# remove infinite loop at the end, if any
ansi2txt < tests/
$CAM
/
$TEST
-raw
.log
\
|
grep
-E
"call |return "
\
| python remove_end_loop.py
\
| python
3
remove_end_loop.py
\
>
tests/
$CAM
/
$TEST
.log
# count some stats
...
...
@@ -1391,7 +1391,7 @@ function test_calls_cstack {
sleep
10
stop_qemu_expect_running
ansi2txt < tests/
$CAM
/
$TEST
-raw
.log | python tests/test_callstack.py &> tests/
$CAM
/
$TEST
-test
.log
\
ansi2txt < tests/
$CAM
/
$TEST
-raw
.log | python
3
tests/test_callstack.py &> tests/
$CAM
/
$TEST
-test
.log
\
&&
(
tail
-n
1 tests/
$CAM
/
$TEST
-test
.log |
tr
-d
'\n'
;
echo
" OK"
)
\
||
(
tail
-n
1 tests/
$CAM
/
$TEST
-test
.log |
tr
-d
'\n'
;
echo
-e
"
\e
[31mFAILED!
\e
[0m"
)
}
...
...
contrib/qemu/tests/test_callstack.py
View file @
43e2b444
#!/usr/bin/env python3
from
__future__
import
print_function
import
os
,
sys
,
re
from
collections
import
defaultdict
...
...
@@ -49,8 +52,8 @@ def match_stacks(current_stack, printed_stack):
if
l
[:
70
].
rstrip
()
!=
p
[:
70
].
rstrip
():
warnings
+=
1
print
l
print
p
print
(
l
)
print
(
p
)
# only report different arguments as warnings (fixme)
# but don't allow differences on what functions were called
if
l
.
strip
().
split
(
"("
)[
0
]
!=
p
.
strip
().
split
(
"("
)[
0
]:
...
...
@@ -143,6 +146,6 @@ for line in lines:
debug
(
"<%s:%s:%s>"
,
at_task
,
at_a1
,
at_a2
)
assert
stackid
==
(
"interrupt"
if
at_task
.
startswith
(
"INT-"
)
else
at_task
)
print
"%d stack traces, %d stacks, %d task switches, %d interrupts"
%
(
call_stacks
,
len
(
callstacks
.
keys
()),
task_switches
,
interrupts
)
print
(
"%d stack traces, %d stacks, %d task switches, %d interrupts"
%
(
call_stacks
,
len
(
callstacks
.
keys
()),
task_switches
,
interrupts
)
)
if
warnings
:
print
"%d warning(s)"
%
warnings
print
(
"%d warning(s)"
%
warnings
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment