Skip to content

Commit 8ba64dd

Browse files
authored
Windows: Do not pause in .bat and fix executable name in test on Windows (#5624)
1 parent 5700525 commit 8ba64dd

File tree

8 files changed

+5
-28
lines changed

8 files changed

+5
-28
lines changed

.github/workflows/osgeo4w.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ jobs:
143143
pytest ^
144144
@.github/workflows/pytest_args_ci.txt ^
145145
@.github/workflows/pytest_args_deselect.txt ^
146-
@.github/workflows/pytest_args_gunittest.txt ^
147-
--deselect=lib/init/testsuite/test_grass_tmp_mapset.py
146+
@.github/workflows/pytest_args_gunittest.txt
148147
shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}""
149148

150149
- name: Run tests

.github/workflows/osgeo4w_gunittest.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# but it includes mainly tests which can (and should) be fixed.
66
exclude =
77
gui/wxpython/core/testsuite/toolboxes.sh
8-
lib/init/testsuite/test_grass_tmp_mapset.py
98
python/grass/gunittest/testsuite/test_gunitest_doctests.py
109
python/grass/pygrass/raster/testsuite/test_pygrass_raster_doctests.py
1110
python/grass/pygrass/rpc/testsuite/test_pygrass_rpc_doctests.py

lib/init/grass.bat.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,3 @@ set GRASS_PYTHON=@GRASS_PYTHON@
2222
set GRASS_CONFIG_DIR=@grass_config_dir@
2323

2424
"@GRASS_PYTHON@" "@gisbase_init_dir@\etc\@START_UP@" %*
25-
26-
rem
27-
rem Pause on error
28-
rem
29-
if %ERRORLEVEL% GEQ 1 pause

lib/init/testsuite/test_grass_tmp_mapset.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import os
1919
import shutil
2020
import subprocess
21-
from grass.gunittest.utils import xfail_windows
2221

2322

2423
# Note that unlike rest of GRASS GIS, here we are using unittest package
@@ -31,7 +30,9 @@ class TestTmpMapset(unittest.TestCase):
3130
"""Tests --tmp-mapset option of grass command"""
3231

3332
# TODO: here we need a name of or path to the main GRASS GIS executable
34-
executable = "grass"
33+
# TODO: support OSGeo4W executable with:
34+
# executable = "grass" if os.name != "nt" else "grass85.bat"
35+
executable = "grass" if os.name != "nt" else "grass.bat"
3536
# an arbitrary, but identifiable and fairly unique name
3637
location = "test_tmp_mapset_xy"
3738

@@ -44,7 +45,6 @@ def tearDown(self):
4445
"""Deletes the location"""
4546
shutil.rmtree(self.location, ignore_errors=True)
4647

47-
@xfail_windows
4848
def test_command_runs(self):
4949
"""Check that correct parameters are accepted"""
5050
return_code = subprocess.call(
@@ -59,7 +59,6 @@ def test_command_runs(self):
5959
),
6060
)
6161

62-
@xfail_windows
6362
def test_command_fails_without_location(self):
6463
"""Check that the command fails with a nonexistent location"""
6564
return_code = subprocess.call(
@@ -81,7 +80,6 @@ def test_command_fails_without_location(self):
8180
),
8281
)
8382

84-
@xfail_windows
8583
def test_mapset_metadata_correct(self):
8684
"""Check that metadata is readable and have expected value (XY CRS)"""
8785
output = subprocess.check_output(
@@ -95,7 +93,6 @@ def test_mapset_metadata_correct(self):
9593
),
9694
)
9795

98-
@xfail_windows
9996
def test_mapset_deleted(self):
10097
"""Check that mapset is deleted at the end of execution"""
10198
subprocess.check_call(

mswindows/GRASS-Installer.nsi.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,6 @@ Section "GRASS" SecGRASS
676676
FileWrite $0 'cd "%USERPROFILE%"'
677677
FileWrite $0 '$\r$\n'
678678
FileWrite $0 '"%GRASS_PYTHON%" "%GISBASE%\etc\grass@GRASS_VERSION_MAJOR@@[email protected]" %*'
679-
FileWrite $0 '$\r$\n$\r$\n'
680-
FileWrite $0 'if %ERRORLEVEL% GEQ 1 pause'
681679
FileClose $0
682680
done_create_grass_command.bat:
683681

mswindows/crosscompile.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ if not exist "%GISBASE%\etc\fontcap" (
409409
)
410410
411411
"%GRASS_PYTHON%" "%GISBASE%\etc\grass$version.py" %*
412-
if %ERRORLEVEL% geq 1 pause
413412
EOT
414413
unix2dos $dist/grass.bat
415414

mswindows/osgeo4w/grass.bat.tmpl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,4 @@ call "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\env.bat"
1515
rem
1616
rem Launch GRASS GIS
1717
rem
18-
"%GRASS_PYTHON%" "%GISBASE%\etc\grass@[email protected]" %*
19-
20-
rem
21-
rem Pause on error
22-
rem
23-
if %ERRORLEVEL% GEQ 1 pause
18+
"%GRASS_PYTHON%" "%GISBASE%\etc\grass@[email protected]" %*

mswindows/osgeo4w/python-grass.bat.tmpl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,3 @@ call "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\env.bat"
1414

1515
set PYTHONPATH=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\python;%PYTHONPATH%
1616
"%GRASS_PYTHON%" %*
17-
18-
rem
19-
rem Pause on error
20-
rem
21-
if %ERRORLEVEL% GEQ 1 pause

0 commit comments

Comments
 (0)