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
cfc593eb
Commit
cfc593eb
authored
Jul 02, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed run.py bugs
parent
b528348f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
run.py
modules/ts/misc/run.py
+17
-18
No files found.
modules/ts/misc/run.py
View file @
cfc593eb
import
sys
,
os
,
platform
,
xml
,
re
,
tempfile
,
glob
,
datetime
,
getpass
import
sys
,
os
,
platform
,
xml
,
re
,
tempfile
,
glob
,
datetime
,
getpass
,
shutil
from
optparse
import
OptionParser
from
optparse
import
OptionParser
from
subprocess
import
Popen
,
PIPE
from
subprocess
import
Popen
,
PIPE
...
@@ -228,6 +228,7 @@ class RunInfo(object):
...
@@ -228,6 +228,7 @@ class RunInfo(object):
# fix empty tests dir
# fix empty tests dir
if
not
self
.
tests_dir
:
if
not
self
.
tests_dir
:
self
.
tests_dir
=
self
.
path
self
.
tests_dir
=
self
.
path
self
.
tests_dir
=
os
.
path
.
normpath
(
self
.
tests_dir
)
# add path to adb
# add path to adb
if
self
.
android_executable
:
if
self
.
android_executable
:
self
.
adb
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
self
.
android_executable
)),
(
"platform-tools/adb"
,
"platform-tools/adb.exe"
)[
hostos
==
'nt'
])
self
.
adb
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
self
.
android_executable
)),
(
"platform-tools/adb"
,
"platform-tools/adb.exe"
)[
hostos
==
'nt'
])
...
@@ -375,7 +376,6 @@ class RunInfo(object):
...
@@ -375,7 +376,6 @@ class RunInfo(object):
setattr
(
self
,
name
,
None
)
setattr
(
self
,
name
,
None
)
finally
:
finally
:
if
dir
:
if
dir
:
import
shutil
shutil
.
rmtree
(
dir
)
shutil
.
rmtree
(
dir
)
def
isTest
(
self
,
fullpath
):
def
isTest
(
self
,
fullpath
):
...
@@ -536,16 +536,17 @@ class RunInfo(object):
...
@@ -536,16 +536,17 @@ class RunInfo(object):
if
fname
==
name
:
if
fname
==
name
:
return
t
return
t
if
fname
.
endswith
(
".exe"
)
or
(
self
.
targetos
==
"android"
and
fname
.
endswith
(
".apk"
)):
if
fname
.
endswith
(
".exe"
)
or
(
self
.
targetos
==
"android"
and
fname
.
endswith
(
".apk"
)):
if
fname
.
endswith
(
"d.exe"
):
fname
=
fname
[:
-
4
]
fname
=
fname
[:
-
5
]
else
:
fname
=
fname
[:
-
4
]
if
fname
==
name
:
if
fname
==
name
:
return
t
return
t
if
self
.
options
.
configuration
==
"Debug"
and
fname
==
name
+
'd'
:
return
t
if
fname
.
startswith
(
self
.
nameprefix
):
if
fname
.
startswith
(
self
.
nameprefix
):
fname
=
fname
[
len
(
self
.
nameprefix
):]
fname
=
fname
[
len
(
self
.
nameprefix
):]
if
fname
==
name
:
if
fname
==
name
:
return
t
return
t
if
self
.
options
.
configuration
==
"Debug"
and
fname
==
name
+
'd'
:
return
t
return
None
return
None
def
runAdb
(
self
,
*
args
):
def
runAdb
(
self
,
*
args
):
...
@@ -707,6 +708,11 @@ class RunInfo(object):
...
@@ -707,6 +708,11 @@ class RunInfo(object):
cmd
.
append
(
"--help"
)
cmd
.
append
(
"--help"
)
else
:
else
:
cmd
.
extend
(
args
)
cmd
.
extend
(
args
)
orig_temp_path
=
os
.
environ
.
get
(
'OPENCV_TEMP_PATH'
)
temp_path
=
tempfile
.
mkdtemp
(
prefix
=
"__opencv_temp."
,
dir
=
orig_temp_path
or
None
)
os
.
environ
[
'OPENCV_TEMP_PATH'
]
=
temp_path
print
>>
_stderr
,
"Running:"
,
" "
.
join
(
cmd
)
print
>>
_stderr
,
"Running:"
,
" "
.
join
(
cmd
)
try
:
try
:
Popen
(
cmd
,
stdout
=
_stdout
,
stderr
=
_stderr
,
cwd
=
workingDir
)
.
wait
()
Popen
(
cmd
,
stdout
=
_stdout
,
stderr
=
_stderr
,
cwd
=
workingDir
)
.
wait
()
...
@@ -714,20 +720,13 @@ class RunInfo(object):
...
@@ -714,20 +720,13 @@ class RunInfo(object):
pass
pass
# clean temporary files
# clean temporary files
temp_path
=
os
.
environ
.
get
(
'OPENCV_TEMP_PATH'
)
if
orig_temp_path
:
if
not
temp_path
:
os
.
environ
[
'OPENCV_TEMP_PATH'
]
=
orig_temp_path
if
self
.
targetos
==
"nt"
:
else
:
temp_path
=
tempfile
.
gettempdir
()
del
os
.
environ
[
'OPENCV_TEMP_PATH'
]
else
:
temp_path
=
"/tmp"
try
:
try
:
if
self
.
targetos
==
"nt"
:
shutil
.
rmtree
(
temp_path
)
for
filename
in
glob
.
glob
(
os
.
path
.
join
(
temp_path
,
"ocv*"
))
:
os
.
remove
(
filename
)
else
:
for
filename
in
glob
.
glob
(
os
.
path
.
join
(
temp_path
,
"__opencv_temp.*"
))
:
os
.
remove
(
filename
)
except
:
except
:
pass
pass
...
...
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