anchor.diff:  :check_application_end
   endlocal & set /a app_count=app_count+1
   goto :eof
  -
  -:launch_gui
  -setlocal
  -start /b bin\otbgui_%app%.bat
  -endlocal
  -goto :eof
  -
  +::-----------------------------------------------------------------------
  +:check_desktop_app
  +setlocal
  +set appName=%1
  +set delay=5
  +if not -%2-==-- set delay=%2
  +type NUL > tmp.log
  +start /b bin\%appName%.exe > tmp.log 2>&1
  +timeout %delay% >nul
  +call :get_child_pid %CURRENT_PID% %appName%.exe
  +if %child_pid% gtr 1 (
  +  taskkill /PID %child_pid% /F /T > NUL 2>&1
  +) else (
  +  echo ERROR : could not launch %appName%.exe
  +  echo ERROR : could not launch %appName%.exe >> selftest_report.log
  +  type tmp.log >> selftest_report.log
  +)
  +endlocal
  +goto :eof
  +::-----------------------------------------------------------------------
  +:check_python_wrapping
  +setlocal
  +type NUL > tmp.log
  +python -c "import otbApplication" > tmp.log 2>&1
  +call :nb_tmp_lines
  +if %nb_tmp_lines_out% gtr 0 (
  +  echo ERROR : failed to run python wrapping
  +  echo ERROR : failed to run python wrapping >> selftest_report.log
  +  type tmp.log >> selftest_report.log
  +)
  +endlocal
  +goto :eof
  +::-----------------------------------------------------------------------
   :parse_cli_output
   setlocal
  -set ret=1
  +set /a ret=1
   for /F %%a in ('findstr /n /r /c:"^This is the %app% application, version " tmp.log') do set output=%%a
   if not "%output%" gtr "1:" (
  -  echo First line not found
  -  set ret=0
  +  set /a ret=0
     goto :parse_cli_output_end
   )
   set output=
   for /F %%a in ('findstr /n /r /c:"^Parameters:" tmp.log') do set output=%%a
   if not "%output%" gtr "3:" (
  -  echo Parameters line not found
  -  set ret=0
  +  set /a ret=0
     goto :parse_cli_output_end
   )
   set output=
   for /F %%a in ('findstr /n /r /c:"^Examples:" tmp.log') do set output=%%a
   if not "%output%" gtr "1" (
  -  echo Examples line not found
  -  echo %output%
  -  set ret=0
  +  set /a ret=0
     goto :parse_cli_output_end
   )
   set output=
   for /F %%a in ('findstr /n /r /c:"FATAL" tmp.log') do set output=%%a
   if "%output%" gtr "1" (
  -  echo FATAL found
  -  echo %output%
  -  set ret=0
  +  set /a ret=0
     goto :parse_cli_output_end
   )
   :parse_cli_output_end
  -endlocal & set parse_cli_result=%ret%
  -goto :eof
  -
  +endlocal & set /a parse_cli_result=%ret%
  +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
   setlocal
   for /F "delims=" %%i in ('find /C /V "" ^< tmp.log') do set output=%%i
   endlocal & set nb_tmp_lines_out=%output%
   goto :eof
  -
  +::-----------------------------------------------------------------------
   :get_child_pid
   setlocal
   set parent_pid=%1
  
positive.code: if %app_count% leq 90 (
    echo WARNING: only %app_count% applications found ! Expected at least 90
  )
  
  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
  
  
  endlocal
  goto :eof
  
  rem functions :
  :check_binary
  setlocal
  type NUL > tmp.log
  
negative.code: call :nb_tmp_lines
  if %nb_tmp_lines_out% gtr 0 (
    echo ERROR : otb_loader.exe %1
    echo otb_loader.exe %1 >> selftest_report.log
    type tmp.log >> selftest_report.log
  )
  endlocal
  goto :eof
  ::-----------------------------------------------------------------------
  :check_application
  setlocal
  set dll_path=%~n1
  set app=%dll_path:~7%
  if not exist bin\otbcli_%app%.bat (
    echo ERROR : missing cli launcher for application %app%
    echo ERROR : missing cli launcher for application %app% >> selftest_report.log
    goto :check_gui
  )
  type NUL > tmp.log
  cmd /C bin\otbcli_%app%.bat "-help" ^> tmp.log ^2^>^&^1
  call :parse_cli_output
  if %parse_cli_result% equ 0 (
    echo ERROR : error launching application otbcli_%app%
    echo ERROR : error launching application otbcli_%app% >> selftest_report.log
    type tmp.log >> selftest_report.log
  )
  :check_gui
  if not exist bin\otbgui_%app%.bat (
    echo ERROR : missing gui launcher for application %app%
    echo ERROR : missing gui launcher for application %app% >> selftest_report.log
    goto :check_application_end
  )
  if %app_count% geq 2 goto :check_application_end
  type NUL > tmp.log
  start /b bin\otbgui_%app%.bat ^> tmp.log ^2^>^&^1
  timeout 5 >nul
  call :get_child_pid %CURRENT_PID% cmd.exe
  set first_child=0
  if %child_pid% gtr 1 (
    set first_child=%child_pid%
  ) else (
    echo ERROR : could not launch otbgui_%app%
    echo ERROR : could not launch otbgui_%app% >> selftest_report.log
    type tmp.log >> selftest_report.log
    goto :check_application_clean
  )
  call :get_child_pid %first_child% otbApplicationLauncherQt.exe
  if not %child_pid% gtr 1 (
    echo ERROR : could not launch otbApplicationLauncherQt %app%
    echo ERROR : could not launch otbApplicationLauncherQt %app% >> selftest_report.log
    type tmp.log >> selftest_report.log
  )
  :check_application_clean
  if not %first_child% == 0 (
  