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
ad58e965
Commit
ad58e965
authored
Oct 02, 2012
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automation for build and test OpenCV Manager on several devices added.
parent
d64d7608
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
10 deletions
+69
-10
all.py
android/service/all.py
+44
-0
device.conf
android/service/device.conf
+4
-0
push_native.py
android/service/push_native.py
+9
-3
test_native.py
android/service/test_native.py
+12
-7
No files found.
android/service/all.py
0 → 100755
View file @
ad58e965
#!/usr/bin/python
import
os
import
sys
import
shutil
LOCAL_LOG_PATH
=
os
.
path
.
join
(
os
.
getcwd
(),
"logs"
)
if
(
__name__
==
"__main__"
):
if
(
not
os
.
path
.
exists
(
LOCAL_LOG_PATH
)):
os
.
makedirs
(
LOCAL_LOG_PATH
)
print
(
"Building native part of OpenCV Manager..."
)
HomeDir
=
os
.
getcwd
()
os
.
chdir
(
os
.
path
.
join
(
HomeDir
,
"engine"
))
shutil
.
rmtree
(
os
.
path
.
join
(
HomeDir
,
"engine"
,
"libs"
),
ignore_errors
=
True
)
shutil
.
rmtree
(
os
.
path
.
join
(
HomeDir
,
"engine"
,
"obj"
),
ignore_errors
=
True
)
BuildCommand
=
"ndk-build V=1 >
\"
%
s
\"
2>&1"
%
os
.
path
.
join
(
LOCAL_LOG_PATH
,
"build.log"
)
#print(BuildCommand)
res
=
os
.
system
(
BuildCommand
)
if
(
0
==
res
):
print
(
"Build
\t
[OK]"
)
else
:
print
(
"Build
\t
[FAILED]"
)
sys
.
exit
(
-
1
)
os
.
chdir
(
HomeDir
)
ConfFile
=
open
(
"device.conf"
,
"rt"
)
for
s
in
ConfFile
.
readlines
():
keys
=
s
.
split
(
";"
)
if
(
len
(
keys
)
<
2
):
print
(
"Error: invalid config line:
\"
%
s
\"
"
%
s
)
continue
Arch
=
keys
[
0
]
Name
=
keys
[
1
]
print
(
"testing
\"
%
s
\"
arch"
%
Arch
)
print
(
"Pushing to device
\"
%
s
\"
"
%
Name
)
PushCommand
=
"
%
s
\"
%
s
\"
\"
%
s
\"
2>&1"
%
(
os
.
path
.
join
(
HomeDir
,
"push_native.py"
),
Arch
,
Name
)
os
.
system
(
PushCommand
)
print
(
"Testing on device
\"
%
s
\"
"
%
Name
)
TestCommand
=
"
%
s
\"
%
s
\"
\"
%
s
\"
2>&1"
%
(
os
.
path
.
join
(
HomeDir
,
"test_native.py"
),
Arch
,
Name
)
os
.
system
(
TestCommand
)
\ No newline at end of file
android/service/device.conf
0 → 100644
View file @
ad58e965
armeabi
;
15
c000000581404
;
x86
;
0123456789
ABCDEF
;
mips
;
Novo7
Basic
;
\ No newline at end of file
android/service/push_native.py
View file @
ad58e965
#!/usr/bin/python
import
os
import
sys
TARGET_DEVICE_PATH
=
"/data/data/EngineTest"
DEVICE_NAME
=
""
DEVICE_STR
=
""
DEVICE_ARCH
=
"armeabi"
if
(
DEVICE_NAME
!=
""
):
DEVICE_STR
=
"-s "
+
DEVICE_NAME
if
(
__name__
==
"__main__"
):
print
(
"Waiting for device ..."
)
if
(
len
(
sys
.
argv
)
>=
3
):
DEVICE_ARCH
=
sys
.
argv
[
1
]
DEVICE_NAME
=
sys
.
argv
[
2
]
if
(
DEVICE_NAME
!=
""
):
DEVICE_STR
=
"-s
\"
"
+
DEVICE_NAME
+
"
\"
"
print
(
"Waiting for device
\"
%
s
\"
with arch
\"
%
s
\"
..."
%
(
DEVICE_NAME
,
DEVICE_ARCH
))
os
.
system
(
"adb
%
s wait-for-device"
%
DEVICE_STR
)
os
.
system
(
"adb
%
s shell mkdir -p
%
s"
%
(
DEVICE_STR
,
TARGET_DEVICE_PATH
))
os
.
system
(
"adb
%
s push ./engine/libs/
%
s/libOpenCVEngine.so
%
s"
%
(
DEVICE_STR
,
DEVICE_ARCH
,
TARGET_DEVICE_PATH
))
...
...
android/service/test_native.py
View file @
ad58e965
...
...
@@ -5,26 +5,31 @@ import sys
DEVICE_NAME
=
""
DEVICE_STR
=
""
if
(
DEVICE_NAME
!=
""
):
DEVICE_STR
=
"-s "
+
DEVICE_NAME
DEVICE_ARCH
=
"armeabi"
LOCAL_LOG_PATH
=
os
.
path
.
join
(
os
.
getcwd
(),
"logs"
)
DEVICE_LOG_PATH
=
"/sdcard/OpenCVEngineLogs"
DEVICE_BIN_PATH
=
"/data/data/EngineTest"
def
RunTestApp
(
AppName
):
TestLog
=
os
.
path
.
join
(
DEVICE_LOG_PATH
,
AppName
+
".xml"
)
TestLog
=
os
.
path
.
join
(
DEVICE_LOG_PATH
,
AppName
+
"
_"
+
DEVICE_ARCH
+
"
.xml"
)
os
.
system
(
"adb
%
s shell
\"
LD_LIBRARY_PATH=
%
s:$LD_LIBRARY_PATH;
%
s --gtest_output=
\"
xml:
%
s
\"\"
"
%
(
DEVICE_STR
,
DEVICE_BIN_PATH
,
os
.
path
.
join
(
DEVICE_BIN_PATH
,
AppName
),
TestLog
))
os
.
system
(
"adb
%
s pull
\"
%
s
\"
\"
%
s
\"
"
%
(
DEVICE_STR
,
TestLog
,
LOCAL_LOG_PATH
))
if
(
__name__
==
"__main__"
):
if
(
3
==
len
(
sys
.
argv
)):
DEVICE_ARCH
=
sys
.
argv
[
1
]
DEVICE_NAME
=
sys
.
argv
[
2
]
if
(
DEVICE_NAME
!=
""
):
DEVICE_STR
=
"-s
\"
"
+
DEVICE_NAME
+
"
\"
"
if
(
not
os
.
path
.
exists
(
LOCAL_LOG_PATH
)):
os
.
makedirs
(
LOCAL_LOG_PATH
)
print
(
"Waiting for device
..."
)
print
(
"Waiting for device
\"
%
s
\"
with arch
\"
%
s
\"
..."
%
(
DEVICE_NAME
,
DEVICE_ARCH
)
)
os
.
system
(
"adb
%
s wait-for-device"
%
DEVICE_STR
)
os
.
system
(
"adb
%
s shell rm -r
\"
%
s
\"
"
%
(
DEVICE_STR
,
DEVICE_LOG_PATH
))
os
.
system
(
"adb
%
s shell mkdir -p
\"
%
s
\"
"
%
(
DEVICE_STR
,
DEVICE_LOG_PATH
))
...
...
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