Skip to content

Commit 534024e

Browse files
committed
Added internal scripts for automated test in virtual environments with both PyQt5 and PySide2
1 parent 7e7eb0e commit 534024e

14 files changed

+98
-85
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- Added command-line options to the `PythonQwt-tests-py3` script to run all the tests
77
simultenously in unattended mode (`--mode unattended`) or to update all the
88
screenshots (`--mode screenshots`).
9+
- Added internal scripts for automated test in virtual environments with both PyQt5 and
10+
PySide2.
911

1012
### Version 0.8.1 ###
1113

build_dist.bat

-23
This file was deleted.

build_doc.bat

-25
This file was deleted.

run_test_launcher.bat

-13
This file was deleted.

build_and_upload.bat renamed to scripts/build_and_upload.bat

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
set UNATTENDED=1
3-
call build_doc.bat
4-
call build_dist.bat
3+
call %~dp0build_doc.bat
4+
call %~dp0build_dist.bat
55
@echo:
66
@echo ==============================================================================
77
choice /t 5 /c yn /cs /d n /m "Do you want to upload packages to PyPI (y/n)?"
@@ -10,6 +10,7 @@ if errorlevel 1 goto :yes
1010
:yes
1111
@echo ==============================================================================
1212
@echo:
13+
cd %~dp0..
1314
twine upload dist/*
1415
GOTO :continue
1516
:no

scripts/build_dist.bat

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@echo off
2+
cd %~dp0..\
3+
if exist MANIFEST ( del /q MANIFEST )
4+
if exist build ( rmdir /s /q build )
5+
if exist dist ( rmdir /s /q dist )
6+
call %~dp0func SetPythonPath
7+
call %~dp0func UseWinPython
8+
python setup.py sdist bdist_wheel --universal
9+
python setup.py build sdist
10+
call %~dp0func EndOfScript

scripts/build_doc.bat

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
call %~dp0func SetPythonPath
3+
call %~dp0func UseWinPython
4+
set PATH=C:\Program Files\7-Zip;C:\Program Files (x86)\7-Zip;C:\Program Files\HTML Help Workshop;C:\Program Files (x86)\HTML Help Workshop;%PATH%
5+
cd %~dp0..\
6+
sphinx-build -b htmlhelp doc build\doc
7+
hhc build\doc\PythonQwt.hhp
8+
copy /y build\doc\PythonQwt.chm doc\_downloads
9+
7z a doc\_downloads\PythonQwt.chm.zip doc\_downloads\PythonQwt.chm
10+
move /y doc\PythonQwt.chm .
11+
sphinx-build -b html doc build\doc
12+
call %~dp0func EndOfScript

scripts/func.bat

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
REM Utilities for deployment, test and build scripts
2+
@echo off
3+
call:%*
4+
goto Exit
5+
6+
:SetPythonPath
7+
set PYTHONPATH=%~dp0..
8+
goto:eof
9+
10+
:UseWinPython
11+
if defined WINPYDIRBASE (
12+
call %WINPYDIRBASE%\scripts\env.bat
13+
call :ShowTitle "Using WinPython from %WINPYDIRBASE%"
14+
)
15+
goto:eof
16+
17+
:ShowTitle
18+
@echo:
19+
@echo ========= %~1 =========
20+
@echo:
21+
goto:eof
22+
23+
:EndOfScript
24+
@echo:
25+
@echo **********************************************************************************
26+
@echo:
27+
if not defined UNATTENDED (
28+
@echo End of script
29+
pause
30+
)
31+
goto:eof
32+
33+
:Exit
34+
exit /b

scripts/run_test_launcher.bat

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@echo off
2+
setlocal
3+
call %~dp0func SetPythonPath
4+
call %~dp0func UseWinPython
5+
python -m qwt.tests.__init__
6+
call %~dp0func EndOfScript

scripts/run_test_venv.bat

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@echo off
2+
setlocal
3+
set UNATTENDED=1
4+
call %~dp0build_dist
5+
set PYTHONPATH=
6+
call %~dp0func UseWinPython
7+
call :TestEnv PyQt5
8+
call :TestEnv PySide2
9+
set UNATTENDED=
10+
call %~dp0func EndOfScript
11+
exit /B %ERRORLEVEL%
12+
13+
:TestEnv
14+
call %~dp0func ShowTitle "Testing in %~1-based Python virtual environment"
15+
set VENVPATH=cd %~dp0..\build\testenv
16+
python -m venv %VENVPATH%
17+
call %VENVPATH%\Scripts\activate
18+
pip install %~1
19+
for %%f IN ("%~dp0..\dist\PythonQwt-*.whl") DO ( pip install %%f )
20+
call %VENVPATH%\Scripts\PythonQwt-tests-py3 --mode unattended
21+
call %VENVPATH%\Scripts\deactivate
22+
exit /B 0

run_unattended_tests.bat renamed to scripts/run_unattended_tests.bat

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
@echo off
2-
32
setlocal
4-
set PYTHONPATH=%cd%
3+
call %~dp0func SetPythonPath
4+
cd %~dp0..\
55

66
if not defined WINPYDIRBASE ( goto :no )
7-
87
choice /t 5 /c yn /cs /d n /m "Do you want to run tests only from %WINPYDIRBASE% (y/n)?"
98
if errorlevel 2 goto :no
10-
119
:yes
1210
call %WINPYDIRBASE%\scripts\env.bat
1311
python qwt/tests/__init__.py --mode unattended

scripts/take_screenshots.bat

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
setlocal
3+
call %~dp0func SetPythonPath
4+
call %~dp0func UseWinPython
5+
cd %~dp0..\
6+
python qwt/tests/__init__.py --mode screenshots
7+
call %~dp0func EndOfScript

take_screenshots.bat

-13
This file was deleted.

upload.bat

-5
This file was deleted.

0 commit comments

Comments
 (0)