Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
3eaa5eac
Commit
3eaa5eac
authored
Aug 07, 2017
by
Rashad Kanavath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TEST: launch selftester.bat via script
parent
617540d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
68 deletions
+63
-68
Packaging/Files/run_selftester.bat
Packaging/Files/run_selftester.bat
+5
-0
Packaging/Files/selftester.bat
Packaging/Files/selftester.bat
+50
-68
Packaging/installer_files.cmake
Packaging/installer_files.cmake
+8
-0
No files found.
Packaging/Files/run_selftester.bat
0 → 100755
View file @
3eaa5eac
@echo
on
set
CURDIR
=
%~dp0
set
EXIT_ON_ERROR
=
1
set
VERBOSE
=
0
cmd
/k
%CURDIR%
tools
\selftester.bat
/q
>
%CURDIR%
selftest_report
.log
2
>&
1
\ No newline at end of file
Packaging/Files/selftester.bat
View file @
3eaa5eac
@echo
off
@echo
off
setlocal
set
CURRENT_SCRIPT_DIR
=
%~dp0
set
MY_TOOLS_DIR
=
%~dp0
set
DIRNAME
=
%CURRENT_SCRIPT_DIR%
..
cd
%MY_TOOLS_DIR%
..
cd
%DIRNAME%
set
MY_INSTALL_DIR
=
%cd%
echo
"MY_INSTALL_DIR=
%MY_INSTALL_DIR%
"
:: this is set in wrapper script
::set EXIT_ON_ERROR=0
IF
%EXIT_ON_ERROR%
.
==
.
(
set
EXIT_ON_ERROR
=
0
)
IF
%VERBOSE%
.
==
.
(
set
VERBOSE
=
1
)
:: if "/q" is given, hide the error dialogs (hence make the script non-interactive)
:: if "/q" is given, hide the error dialogs (hence make the script non-interactive)
if
/i
not
-
%
1
-==-
/q
-
(
if
/i
not
-
%
1
-==-
/q
-
(
...
@@ -13,7 +18,6 @@ echo Hide error dialogs
...
@@ -13,7 +18,6 @@ echo Hide error dialogs
call
:getDontShowUI
call
:getDontShowUI
if
%DONTSHOWUI_VALUE%
equ
0
call
:setDontShowUI
1
if
%DONTSHOWUI_VALUE%
equ
0
call
:setDontShowUI
1
:skip
_hide_error
:skip
_hide_error
:: Get current PID
:: Get current PID
type
NUL
>
pid
.log
type
NUL
>
pid
.log
wmic
PROCESS
where
"Name='WMIC.exe'"
get
ParentProcessId
>
pid
.log
2
>&
1
wmic
PROCESS
where
"Name='WMIC.exe'"
get
ParentProcessId
>
pid
.log
2
>&
1
...
@@ -22,12 +26,8 @@ for /F "TOKENS=1" %%b in ('type pid.log ^| findstr [0-9]') do set CURRENT_PID=%%
...
@@ -22,12 +26,8 @@ for /F "TOKENS=1" %%b in ('type pid.log ^| findstr [0-9]') do set CURRENT_PID=%%
:: setup the otbenv
:: setup the otbenv
call
otbenv
.bat
call
otbenv
.bat
del
selftest_report
.log
type
NUL
>
selftest_report
.log
call
:nb
_report_lines
set
REF_SIZE
=
%nb_report_lines_out%
:: -----------------------------------------------------------------------------------
:: -----------------------------------------------------------------------------------
rem
Check 1 : check binaries
REM
Check 1 : check binaries
for
/R
%%i
in
(*
.dll
)
do
(
for
/R
%%i
in
(*
.dll
)
do
(
call
:check
_binary
%%i
call
:check
_binary
%%i
)
)
...
@@ -36,13 +36,6 @@ for %%i in (bin\mapla.exe,bin\monteverdi.exe,bin\otbApplicationLauncherCommandLi
...
@@ -36,13 +36,6 @@ for %%i in (bin\mapla.exe,bin\monteverdi.exe,bin\otbApplicationLauncherCommandLi
)
)
call
:check
_binary
lib
\python\_otbApplication.pyd
call
:check
_binary
lib
\python\_otbApplication.pyd
call
:nb
_report_lines
if
%nb_report_lines_out%
gtr
%REF_SIZE%
(
echo
Check
1
/3 :
FAIL
)
else
(
echo
Check
1
/3 :
PASS
)
set
REF_SIZE
=
%nb_report_lines_out%
:: -----------------------------------------------------------------------------------
:: -----------------------------------------------------------------------------------
rem Check 2 : check applications and Python wrapping
rem Check 2 : check applications and Python wrapping
set
/a
app_count
=
0
set
/a
app_count
=
0
...
@@ -54,30 +47,17 @@ if %app_count% leq 90 (
...
@@ -54,30 +47,17 @@ if %app_count% leq 90 (
)
)
call
:check
_python_wrapping
call
:check
_python_wrapping
call
:nb
_report_lines
if
%nb_report_lines_out%
gtr
%REF_SIZE%
(
echo
Check
2
/3 :
FAIL
)
else
(
echo
Check
2
/3 :
PASS
)
set
REF_SIZE
=
%nb_report_lines_out%
:: -----------------------------------------------------------------------------------
:: -----------------------------------------------------------------------------------
rem Check 3 : check monteverdi & mapla
rem Check 3 : check monteverdi & mapla
call
:check
_desktop_app
monteverdi
call
:check
_desktop_app
monteverdi
call
:check
_desktop_app
mapla
20
call
:check
_desktop_app
mapla
20
call
:nb
_report_lines
if
%nb_report_lines_out%
gtr
%REF_SIZE%
(
echo
Check
3
/3 :
FAIL
)
else
(
echo
Check
3
/3 :
PASS
)
if
/i
not
-
%
1
-==-
/q
-
(
if
/i
not
-
%
1
-==-
/q
-
(
goto
:skip
_restore_error
goto
:skip
_restore_error
)
)
if
%DONTSHOWUI_VALUE%
equ
0
call
:setDontShowUI
0
if
%DONTSHOWUI_VALUE%
equ
0
call
:setDontShowUI
0
:skip
_restore_error
:skip
_restore_error
setlocal
del
pid
.log
del
pid
.log
del
tmp
.log
del
tmp
.log
endlocal
endlocal
...
@@ -86,13 +66,14 @@ goto :eof
...
@@ -86,13 +66,14 @@ goto :eof
::########################[ FUNCTIONS ]##################################
::########################[ FUNCTIONS ]##################################
:check
_binary
:check
_binary
setlocal
setlocal
if
%VERBOSE%
equ
1
(
echo
":check_binary
%
1"
)
type
NUL
>
tmp
.log
type
NUL
>
tmp
.log
tools
\otb_loader.exe
%
1
>
tmp
.log
2
>&
1
tools
\otb_loader.exe
%
1
>
tmp
.log
2
>&
1
call
:nb
_tmp_lines
call
:nb
_tmp_lines
if
%nb_tmp_lines_out%
gtr
0
(
if
%nb_tmp_lines_out%
gtr
0
(
echo
ERROR
:
otb_loader
.exe
%
1
echo
"ERROR: otb_loader.exe
%
1"
echo
otb_loader
.exe
%
1
>>
selftest_report
.log
type
tmp
.log
type
tmp
.log
>>
selftest_report
.log
if
%EXIT_ON_ERROR%
equ
1
(
exit
1
)
)
)
endlocal
endlocal
goto
:eof
goto
:eof
...
@@ -101,9 +82,10 @@ goto :eof
...
@@ -101,9 +82,10 @@ goto :eof
setlocal
setlocal
set
dll_path
=
%~n1
set
dll_path
=
%~n1
set
app
=
%dll
_path:
~
7
%
set
app
=
%dll
_path:
~
7
%
if
%VERBOSE%
equ
1
(
echo
":check_application
%app%
"
)
if
not
exist
bin
\otbcli_
%app%
.bat
(
if
not
exist
bin
\otbcli_
%app%
.bat
(
echo
ERROR
:
missing
cli
launcher
for
application
%app%
echo
ERROR
:
missing
cli
launcher
for
application
%app%
echo
ERROR
:
missing
cli
launcher
for
application
%app%
>>
selftest_report
.log
if
%EXIT_ON_ERROR%
equ
1
(
exit
1
)
goto
:check
_gui
goto
:check
_gui
)
)
type
NUL
>
tmp
.log
type
NUL
>
tmp
.log
...
@@ -111,13 +93,14 @@ cmd /C bin\otbcli_%app%.bat "-help" ^> tmp.log ^2^>^&^1
...
@@ -111,13 +93,14 @@ cmd /C bin\otbcli_%app%.bat "-help" ^> tmp.log ^2^>^&^1
call
:parse
_cli_output
call
:parse
_cli_output
if
%parse_cli_result%
equ
0
(
if
%parse_cli_result%
equ
0
(
echo
ERROR
:
error
launching
application
otbcli_
%app%
echo
ERROR
:
error
launching
application
otbcli_
%app%
echo
ERROR
:
error
launching
application
otbcli_
%app%
>>
selftest_report
.log
type
results
.txt
type
tmp
.log
>>
selftest_report
.log
if
%EXIT_ON_ERROR%
equ
1
(
exit
1
)
)
)
:check
_gui
:check
_gui
if
not
exist
bin
\otbgui_
%app%
.bat
(
if
not
exist
bin
\otbgui_
%app%
.bat
(
echo
ERROR
:
missing
gui
launcher
for
application
%app%
echo
ERROR
:
missing
gui
launcher
for
application
%app%
echo
ERROR
:
missing
gui
launcher
for
application
%app%
>>
selftest_report
.log
if
%EXIT_ON_ERROR%
equ
1
(
exit
1
)
goto
:check
_application_end
goto
:check
_application_end
)
)
if
%app_count%
geq
2
goto
:check
_application_end
if
%app_count%
geq
2
goto
:check
_application_end
...
@@ -130,20 +113,21 @@ if %child_pid% gtr 1 (
...
@@ -130,20 +113,21 @@ if %child_pid% gtr 1 (
set
first_child
=
%child_pid%
set
first_child
=
%child_pid%
)
else
(
)
else
(
echo
ERROR
:
could
not
launch
otbgui_
%app%
echo
ERROR
:
could
not
launch
otbgui_
%app%
echo
ERROR
:
could
not
launch
otbgui_
%app%
>>
selftest_report
.log
type
tmp
.log
type
tmp
.log
>>
selftest_report
.log
goto
:check
_application_clean
goto
:check
_application_clean
)
)
call
:get
_child_pid
%first_child%
otbApplicationLauncherQt
.exe
call
:get
_child_pid
%first_child%
otbApplicationLauncherQt
.exe
if
not
%child_pid%
gtr
1
(
if
not
%child_pid%
gtr
1
(
echo
ERROR
:
could
not
launch
otbApplicationLauncherQt
%app%
echo
ERROR
:
could
not
launch
otbApplicationLauncherQt
%app%
echo
ERROR
:
could
not
launch
otbApplicationLauncherQt
%app%
>>
selftest_report
.log
type
tmp
.log
type
tmp
.log
>>
selftest_report
.log
if
%EXIT_ON_ERROR%
equ
1
(
exit
1
)
)
)
:check
_application_clean
:check
_application_clean
if
not
%first_child%
==
0
(
if
not
%first_child%
==
0
(
taskkill
/PID
%first_child%
/F /T
>
NUL
2
>&
1
taskkill
/PID
%first_child%
/F /T
>
NUL
2
>&
1
)
)
:check
_application_end
:check
_application_end
endlocal
&
set
/a
app_count
=
app_count
+
1
endlocal
&
set
/a
app_count
=
app_count
+
1
goto
:eof
goto
:eof
...
@@ -161,8 +145,8 @@ if %child_pid% gtr 1 (
...
@@ -161,8 +145,8 @@ if %child_pid% gtr 1 (
taskkill
/PID
%child_pid%
/F /T
>
NUL
2
>&
1
taskkill
/PID
%child_pid%
/F /T
>
NUL
2
>&
1
)
else
(
)
else
(
echo
ERROR
:
could
not
launch
%appName%
.exe
echo
ERROR
:
could
not
launch
%appName%
.exe
echo
ERROR
:
could
not
launch
%appName%
.exe
>>
selftest_report
.log
type
tmp
.log
type
tmp
.log
>>
selftest_report
.log
if
%EXIT_ON_ERROR%
equ
1
(
exit
1
)
)
)
endlocal
endlocal
goto
:eof
goto
:eof
...
@@ -174,8 +158,8 @@ python -c "import otbApplication" > tmp.log 2>&1
...
@@ -174,8 +158,8 @@ python -c "import otbApplication" > tmp.log 2>&1
call
:nb
_tmp_lines
call
:nb
_tmp_lines
if
%nb_tmp_lines_out%
gtr
0
(
if
%nb_tmp_lines_out%
gtr
0
(
echo
ERROR
:
failed
to
run
python
wrapping
echo
ERROR
:
failed
to
run
python
wrapping
echo
ERROR
:
failed
to
run
python
wrapping
>>
selftest_report
.log
type
tmp
.log
type
tmp
.log
>>
selftest_report
.log
if
%EXIT_ON_ERROR%
equ
1
(
exit
1
)
)
)
endlocal
endlocal
goto
:eof
goto
:eof
...
@@ -183,39 +167,36 @@ goto :eof
...
@@ -183,39 +167,36 @@ goto :eof
:parse
_cli_output
:parse
_cli_output
setlocal
setlocal
set
/a
ret
=
1
set
/a
ret
=
1
f
or
/F
%%a
in
(
'findstr /n /r /c:"
^T
his is the
%app%
application, version " tmp.log'
)
do
set
output
=
%%a
f
indstr
/n /r /c
:
"
^T
his is the *.*(
%app%
) application, version "
tmp
.log
>
results
.txt
if
not
"
%output%
"
gtr
"1:"
(
if
%errorlevel%
==
1
(
set
/a
ret
=
0
set
/a
ret
=
0
goto
:parse
_cli_output_end
echo
"findstr failed 1st regex in parse_cli_output"
goto
:parse
_cli_output_end
)
)
set
output
=
findstr
/n /r /c
:
"
^P
arameters: "
tmp
.log
>
results
.txt
for
/F
%%a
in
(
'findstr /n /r /c:"
^P
arameters:" tmp.log'
)
do
set
output
=
%%a
if
%errorlevel%
==
1
(
if
not
"
%output%
"
gtr
"3:"
(
set
/a
ret
=
0
set
/a
ret
=
0
goto
:parse
_cli_output_end
echo
"findstr failed 2nd regex in parse_cli_output"
goto
:parse
_cli_output_end
)
)
set
output
=
findstr
/n /r /c
:
"
^E
xamples: "
tmp
.log
>
results
.txt
for
/F
%%a
in
(
'findstr /n /r /c:"
^E
xamples:" tmp.log'
)
do
set
output
=
%%a
if
%errorlevel%
==
1
(
if
not
"
%output%
"
gtr
"1"
(
set
/a
ret
=
0
set
/a
ret
=
0
goto
:parse
_cli_output_end
echo
"findstr failed 3rd regex in parse_cli_output"
goto
:parse
_cli_output_end
)
)
set
output
=
findstr
/n /r /c
:
"FATAL"
tmp
.log
>
results
.txt
for
/F
%%a
in
(
'findstr /n /r /c:"FATAL" tmp.log'
)
do
set
output
=
%%a
if
%errorlevel%
==
0
(
if
"
%output%
"
gtr
"1"
(
set
/a
ret
=
0
set
/a
ret
=
0
goto
:parse
_cli_output_end
echo
"findstr passed 4th regex in parse_cli_output"
goto
:parse
_cli_output_end
)
)
:parse
_cli_output_end
:parse
_cli_output_end
endlocal
&
set
/a
parse_cli_result
=
%ret%
endlocal
&
set
/a
parse_cli_result
=
%ret%
goto
:eof
goto
:eof
::-----------------------------------------------------------------------
::-----------------------------------------------------------------------
:nb
_report_lines
setlocal
for
/F
"delims="
%%i
in
(
'find /C /V ""
^<
selftest_report.log'
)
do
set
output
=
%%i
endlocal
&
set
nb_report_lines_out
=
%output%
goto
:eof
::-----------------------------------------------------------------------
:nb
_tmp_lines
:nb
_tmp_lines
setlocal
setlocal
for
/F
"delims="
%%i
in
(
'find /C /V ""
^<
tmp.log'
)
do
set
output
=
%%i
for
/F
"delims="
%%i
in
(
'find /C /V ""
^<
tmp.log'
)
do
set
output
=
%%i
...
@@ -245,3 +226,4 @@ setlocal
...
@@ -245,3 +226,4 @@ setlocal
reg
add
"HKCU\Software\Microsoft\Windows\Windows Error Reporting"
/v
DontShowUI
/t
REG_DWORD
/d
%
1
/f
reg
add
"HKCU\Software\Microsoft\Windows\Windows Error Reporting"
/v
DontShowUI
/t
REG_DWORD
/d
%
1
/f
endlocal
endlocal
goto
:eof
goto
:eof
Packaging/installer_files.cmake
View file @
3eaa5eac
...
@@ -73,6 +73,14 @@ macro(installer_files)
...
@@ -73,6 +73,14 @@ macro(installer_files)
Files/otbenv.bash
Files/otbenv.bash
DESTINATION
${
PKG_STAGE_DIR
}
DESTINATION
${
PKG_STAGE_DIR
}
)
)
#A script to launch selftest and
#save output to selftest_report.log
install
(
PROGRAMS
Files/run_selftester.bat
RENAME selftester.bat
DESTINATION
${
PKG_STAGE_DIR
}
)
endif
()
endif
()
#these scripts are not auto-installed in PKG_STAGE_DIR
#these scripts are not auto-installed in PKG_STAGE_DIR
...
...
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