Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
860172c6
Commit
860172c6
authored
May 03, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
run.py - fixed java tests launch on Windows
parent
a79c52a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
run.py
modules/ts/misc/run.py
+12
-12
No files found.
modules/ts/misc/run.py
View file @
860172c6
...
...
@@ -601,7 +601,7 @@ class RunInfo(object):
logfile
=
userlog
[
0
][
userlog
[
0
]
.
find
(
":"
)
+
1
:]
if
self
.
targetos
==
"android"
and
exe
.
endswith
(
".apk"
):
print
"running"
,
exe
print
"running
java tests:
"
,
exe
try
:
# get package info
output
=
Popen
(
self
.
aapt
+
[
"dump"
,
"xmltree"
,
exe
,
"AndroidManifest.xml"
],
stdout
=
PIPE
,
stderr
=
_stderr
)
.
communicate
()
...
...
@@ -614,14 +614,14 @@ class RunInfo(object):
if
not
manifest_tag
:
print
>>
_stderr
,
"failed to get manifest info from"
,
exe
return
pkg_name
=
re
.
search
(
r"^[ ]+A: package=\"(?P<pkg>.*?)\" \(Raw: \"(?P=pkg)\"\)$"
,
manifest_tag
[
0
],
flags
=
re
.
MULTILINE
)
.
group
(
"pkg"
)
pkg_name
=
re
.
search
(
r"^[ ]+A: package=\"(?P<pkg>.*?)\" \(Raw: \"(?P=pkg)\"\)
\r?
$"
,
manifest_tag
[
0
],
flags
=
re
.
MULTILINE
)
.
group
(
"pkg"
)
#get test instrumentation info
instrumentation_tag
=
[
t
for
t
in
tags
if
t
.
startswith
(
"instrumentation "
)]
if
not
instrumentation_tag
:
print
>>
_stderr
,
"can not find instrumentation detials in"
,
exe
return
pkg_runner
=
re
.
search
(
r"^[ ]+A: android:name\(0x[0-9a-f]{8}\)=\"(?P<runner>.*?)\" \(Raw: \"(?P=runner)\"\)$"
,
instrumentation_tag
[
0
],
flags
=
re
.
MULTILINE
)
.
group
(
"runner"
)
pkg_target
=
re
.
search
(
r"^[ ]+A: android:targetPackage\(0x[0-9a-f]{8}\)=\"(?P<pkg>.*?)\" \(Raw: \"(?P=pkg)\"\)$"
,
instrumentation_tag
[
0
],
flags
=
re
.
MULTILINE
)
.
group
(
"pkg"
)
pkg_runner
=
re
.
search
(
r"^[ ]+A: android:name\(0x[0-9a-f]{8}\)=\"(?P<runner>.*?)\" \(Raw: \"(?P=runner)\"\)
\r?
$"
,
instrumentation_tag
[
0
],
flags
=
re
.
MULTILINE
)
.
group
(
"runner"
)
pkg_target
=
re
.
search
(
r"^[ ]+A: android:targetPackage\(0x[0-9a-f]{8}\)=\"(?P<pkg>.*?)\" \(Raw: \"(?P=pkg)\"\)
\r?
$"
,
instrumentation_tag
[
0
],
flags
=
re
.
MULTILINE
)
.
group
(
"pkg"
)
if
not
pkg_name
or
not
pkg_runner
or
not
pkg_target
:
print
>>
_stderr
,
"can not find instrumentation detials in"
,
exe
return
...
...
@@ -632,14 +632,14 @@ class RunInfo(object):
pkg_target
=
self
.
options
.
junit_package
#uninstall already installed package
print
>>
_stderr
,
"Uninstalling old"
,
pkg_name
,
"from device..."
output
=
Popen
(
self
.
adb
+
[
"uninstall"
,
pkg_name
],
stdout
=
_stdout
,
stderr
=
_stderr
)
.
wait
()
if
output
!=
0
:
print
>>
_stderr
,
"failed to uninstall"
,
pkg_name
,
"from device"
return
print
>>
_stderr
,
"Installing new"
,
exe
,
"to device...
"
output
=
Popen
(
self
.
adb
+
[
"install"
,
exe
],
stdout
=
_stdout
,
stderr
=
_stderr
)
.
wait
()
if
output
!=
0
:
print
>>
_stderr
,
"
f
ailed to install"
,
exe
,
"to device"
Popen
(
self
.
adb
+
[
"uninstall"
,
pkg_name
],
stdout
=
PIPE
,
stderr
=
_stderr
)
.
communicate
()
print
>>
_stderr
,
"Installing new"
,
exe
,
"to device..."
,
output
=
Popen
(
self
.
adb
+
[
"install"
,
exe
],
stdout
=
PIPE
,
stderr
=
PIPE
)
.
communicate
()
if
output
[
0
]
and
output
[
0
]
.
strip
()
.
endswith
(
"Success"
):
print
>>
_stderr
,
"Success
"
else
:
print
>>
_stderr
,
"Failure"
print
>>
_stderr
,
"
F
ailed to install"
,
exe
,
"to device"
return
print
>>
_stderr
,
"Running jUnit tests for "
,
pkg_target
if
self
.
setUp
is
not
None
:
...
...
Write
Preview
Markdown
is supported
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