Skip to content
Permalink
Browse files

osgeo4w: fix running of python tests

  • Loading branch information
jef-n committed Feb 7, 2017
1 parent 5b27d82 commit e5fd81ffc33c4f4e3b7bde1a718447fbe32ecb5f
Showing with 44 additions and 38 deletions.
  1. +21 −14 cmake/UsePythonTest.cmake
  2. +7 −3 doc/msvc.t2t
  3. +5 −6 ms-windows/osgeo4w/package-nightly.cmd
  4. +11 −13 ms-windows/osgeo4w/package.cmd
  5. +0 −2 scripts/pyuic-wrapper.bat
@@ -29,23 +29,30 @@ MACRO(ADD_PYTHON_TEST TESTNAME FILENAME)

IF(WIN32)
STRING(REGEX REPLACE ":" " " wo_semicolon "${ARGN}")
IF(USING_NINJA OR USING_NMAKE)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake "
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin\")
SET(ENV{PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin;\$ENV{PATH}\")
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/;${QGIS_OUTPUT_DIRECTORY}/python/plugins;${CMAKE_SOURCE_DIR}/tests/src/python;\$ENV{PYTHONPATH}\")
MESSAGE(\"PATH:\$ENV{PATH}\")
")
ELSE(USING_NINJA OR USING_NMAKE)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake "
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/\${CMAKE_BUILD_TYPE}\")
SET(ENV{PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/\${CMAKE_BUILD_TYPE};\$ENV{PATH}\")
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/;${QGIS_OUTPUT_DIRECTORY}/python/plugins;${CMAKE_SOURCE_DIR}/tests/src/python;\$ENV{PYTHONPATH}\")
MESSAGE(\"PATH:\$ENV{PATH}\")
")
ENDIF(USING_NINJA OR USING_NMAKE)
ELSE(WIN32)
STRING(REGEX REPLACE ";" " " wo_semicolon "${ARGN}")
ENDIF(WIN32)

FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake "
IF(WIN32)
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/\${CMAKE_BUILD_TYPE}\")
SET(ENV{PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/\${CMAKE_BUILD_TYPE};\$ENV{PATH}\")
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/;${QGIS_OUTPUT_DIRECTORY}/python/plugins;${CMAKE_SOURCE_DIR}/tests/src/python;\$ENV{PYTHONPATH}\")
MESSAGE(\"PATH:\$ENV{PATH}\")
ELSE(WIN32)
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}\")
SET(ENV{LD_LIBRARY_PATH} \"${pyenv}:${QGIS_OUTPUT_DIRECTORY}/lib:\$ENV{LD_LIBRARY_PATH}\")
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/:${QGIS_OUTPUT_DIRECTORY}/python/plugins:${CMAKE_SOURCE_DIR}/tests/src/python:\$ENV{PYTHONPATH}\")
MESSAGE(\"export LD_LIBRARY_PATH=\$ENV{LD_LIBRARY_PATH}\")
ENDIF(WIN32)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake "
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}\")
SET(ENV{LD_LIBRARY_PATH} \"${pyenv}:${QGIS_OUTPUT_DIRECTORY}/lib:\$ENV{LD_LIBRARY_PATH}\")
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/:${QGIS_OUTPUT_DIRECTORY}/python/plugins:${CMAKE_SOURCE_DIR}/tests/src/python:\$ENV{PYTHONPATH}\")
MESSAGE(\"export LD_LIBRARY_PATH=\$ENV{LD_LIBRARY_PATH}\")
")
ENDIF(WIN32)

FOREACH(_in ${ARGN})
STRING(REGEX MATCH "^([^=]+)=(.*)$" _out ${_in})
@@ -8,11 +8,11 @@ MinGW).
This section describes the setup required to allow Visual Studio to be used to
build QGIS.

===Visual C++ Express Edition===
===Visual C++ Community Edition===

The free (as in free beer) Express Edition installer is available under:
The free (as in free beer) Community installer is available under:

https://download.my.visualstudio.com/db/en_visual_studio_express_2015_for_windows_10_x86_x64_web_installer_6878617.exe?t=9437eae7-7ff2-462a-a349-312fd069ef2d&e=1486459960&h=1fa3414e467f267c795c01bc38b9472d&su=1
http://download.microsoft.com/download/D/2/3/D23F4D0F-BA2D-4600-8725-6CCECEA05196/vs_community_ENU.exe

===Other tools and dependencies===

@@ -45,6 +45,10 @@ and from OSGeo4W (select //Advanced Installation//):
- pyqt5
- python3-devel
- python3-qscintilla
- python3-nose2
- python3-future
- python3-pyyaml
- python3-mock
- qca-qt5-devel
- qca-qt5-libs
- qscintilla-qt5
@@ -59,10 +59,10 @@ goto cmake_x86_64

:cmake_x86
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x86 /Release
path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin
set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86\SetupAPI.Lib
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)

set CMAKE_OPT=^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
@@ -74,12 +74,9 @@ goto cmake

:cmake_x86_64
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x64 /Release
path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin\amd64
set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64\SetupAPI.Lib
if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PF86%\Microsoft SDKs\Windows\v7.0A\Lib\x64\SetupAPI.Lib
if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\Lib\x64\SetupAPI.lib
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)

set CMAKE_OPT=^
@@ -198,7 +195,7 @@ cmake -G Ninja ^
-D WITH_INTERNAL_MOCK=FALSE ^
-D WITH_INTERNAL_HTTPLIB2=FALSE ^
-D WITH_INTERNAL_FUTURE=FALSE ^
-D WITH_INTERNAL_PYSPATIALITE=TRUE ^
-D WITH_PYSPATIALITE=TRUE ^
-D QCA_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\Qt5\include\QtCrypto ^
-D QCA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qca-qt5.lib ^
-D QSCINTILLA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qscintilla2.lib ^
@@ -208,17 +205,19 @@ cmake -G Ninja ^
if errorlevel 1 (echo cmake failed & goto error)

:skipcmake
if exist noclean (echo skip clean & goto skipclean)
if exist ..\noclean (echo skip clean & goto skipclean)
echo CLEAN: %DATE% %TIME%
cmake --build %BUILDDIR% --target clean --config %BUILDCONF%
if errorlevel 1 (echo clean failed & goto error)

:skipclean
if exist ..\skipbuild (echo skip build & goto skipbuild)
echo ALL_BUILD: %DATE% %TIME%
cmake --build %BUILDDIR% --config %BUILDCONF%
if errorlevel 1 cmake --build %BUILDDIR% --config %BUILDCONF%
if errorlevel 1 (echo build failed twice & goto error)

:skipbuild
if exist ..\skiptests goto skiptests

echo RUN_TESTS: %DATE% %TIME%
@@ -59,22 +59,20 @@ goto cmake_x86_64

:cmake_x86
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x86 /Release
path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin
set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86\SetupAPI.Lib
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)

set CMAKE_OPT=^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
goto cmake

:cmake_x86_64
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x64 /Release
path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin\amd64
set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64\SetupAPI.Lib
set SETUPAPI_LIBRARY=%PF86%\Microsoft SDKs\Windows\v7.0A\Lib\x64\SetupAPI.Lib
if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\Lib\x64\SetupAPI.lib
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)

set CMAKE_OPT=^
@@ -144,8 +142,8 @@ touch %SRCDIR%\CMakeLists.txt
echo CMAKE: %DATE% %TIME%
if errorlevel 1 goto error

set LIB=%LIB%;%OSGEO4W_ROOT%\lib
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
set LIB=%LIB%;%OSGEO4W_ROOT%\apps\Qt5\lib;%OSGEO4W_ROOT%\lib
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\apps\Qt5\include;%OSGEO4W_ROOT%\include

cmake -G Ninja ^
-D CMAKE_CXX_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^
@@ -164,7 +162,6 @@ cmake -G Ninja ^
-D WITH_GLOBE=FALSE ^
-D WITH_TOUCH=TRUE ^
-D WITH_ORACLE=TRUE ^
-D WITH_QTWEBKIT=FALSE ^
-D WITH_CUSTOM_WIDGETS=TRUE ^
-D CMAKE_CXX_FLAGS_RELEASE="/MD /MP /O2 /Ob2 /D NDEBUG" ^
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
@@ -192,16 +189,17 @@ cmake -G Ninja ^
-D WITH_INTERNAL_MOCK=FALSE ^
-D WITH_INTERNAL_HTTPLIB2=FALSE ^
-D WITH_INTERNAL_FUTURE=FALSE ^
-D WITH_PYSPATIALITE=TRUE ^
-D QCA_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\Qt5\include\QtCrypto ^
-D QCA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qca.lib ^
-D QCA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qca-qt5.lib ^
-D QSCINTILLA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qscintilla2.lib ^
-D SUPPRESS_SIP_WARNINGS=TRUE ^
%CMAKE_OPT% ^
%SRCDIR:\=/%
if errorlevel 1 (echo cmake failed & goto error)

:skipcmake
if exist noclean (echo skip clean & goto skipclean)
if exist ..\noclean (echo skip clean & goto skipclean)
echo CLEAN: %DATE% %TIME%
cmake --build %BUILDDIR% --target clean --config %BUILDCONF%
if errorlevel 1 (echo clean failed & goto error)
@@ -231,7 +229,6 @@ if errorlevel 1 echo TESTS WERE NOT SUCCESSFUL.
PATH %oldpath%

:skiptests
:package

if exist "%PKGDIR%" (
echo REMOVE: %DATE% %TIME%
@@ -242,6 +239,7 @@ echo INSTALL: %DATE% %TIME%
cmake --build %BUILDDIR% --target install --config %BUILDCONF%
if errorlevel 1 (echo INSTALL failed & goto error)

:package
echo PACKAGE: %DATE% %TIME%

cd ..
@@ -363,13 +361,13 @@ move %PKGDIR%\bin\qbrowser.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.exe
if errorlevel 1 (echo move of browser executable failed & goto error)

if not exist %PKGDIR%\qtplugins\sqldrivers mkdir %PKGDIR%\qtplugins\sqldrivers
move %OSGEO4W_ROOT%\apps\qt4\plugins\sqldrivers\qsqlocispatial.dll %PKGDIR%\qtplugins\sqldrivers
move %OSGEO4W_ROOT%\apps\qt5\plugins\sqldrivers\qsqlocispatial.dll %PKGDIR%\qtplugins\sqldrivers
if errorlevel 1 (echo move of oci sqldriver failed & goto error)
move %OSGEO4W_ROOT%\apps\qt4\plugins\sqldrivers\qsqlspatialite.dll %PKGDIR%\qtplugins\sqldrivers
move %OSGEO4W_ROOT%\apps\qt5\plugins\sqldrivers\qsqlspatialite.dll %PKGDIR%\qtplugins\sqldrivers
if errorlevel 1 (echo move of spatialite sqldriver failed & goto error)

if not exist %PKGDIR%\qtplugins\designer mkdir %PKGDIR%\qtplugins\designer
move %OSGEO4W_ROOT%\apps\qt4\plugins\designer\qgis_customwidgets.dll %PKGDIR%\qtplugins\designer
move %OSGEO4W_ROOT%\apps\qt5\plugins\designer\qgis_customwidgets.dll %PKGDIR%\qtplugins\designer
if errorlevel 1 (echo move of customwidgets failed & goto error)

if not exist %PKGDIR%\python\PyQt5\uic\widget-plugins mkdir %PKGDIR%\python\PyQt5\uic\widget-plugins
@@ -3,6 +3,4 @@ set PYUIC=%1
set PATH=%2;%PATH%
set PYTHONPATH=%3;%PYTHONPATH%
set PYTHON=%4
echo PATH:%PATH%
echo PYTHONPATH:%PYTHONPATH%
%PYTHON% %~dp0\pyuic-wrapper.py %5 %6 %7 %8 %9

0 comments on commit e5fd81f

Please sign in to comment.
You can’t perform that action at this time.