Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Revise content of the root testsuite dir #4516

Merged
merged 6 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion python/grass/gunittest/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,18 @@ def discover(self, start_dir, pattern="test*.py", top_level_dir=None):


if __name__ == "__main__":
GrassTestLoader().discover()
for expression in [r".*\.py$", r".*\.sh$"]:
modules = discover_modules(
start_dir=".",
grass_location="all",
file_regexp=expression,
skip_dirs=GrassTestLoader.skip_dirs,
testsuite_dir=GrassTestLoader.testsuite_dir,
all_locations_value=GrassTestLoader.all_tests_value,
universal_location_value=GrassTestLoader.universal_tests_value,
import_modules=False,
exclude=None,
)
print("Expression:", expression)
print(len(modules))
print([module.file_path for module in modules])
8 changes: 0 additions & 8 deletions testsuite/Makefile

This file was deleted.

44 changes: 27 additions & 17 deletions testsuite/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
# Test suite

This directory contains scripts to check some functionality of GRASS GIS.
Tests are in directories `tests` and `testsuite` under each directory which has tests.
This directory contains additional scripts and information to test functionality
without a focus on a specific part of the code.

GRASS GIS testsuite documentation: <https://grass.osgeo.org/grass-devel/manuals/libpython/gunittest_testing.html>
There are two testing mechanism in place, _pytest_ which is the modern way of testing
GRASS GIS. Tests using _pytest_ are written just as any other Python tests.

## Simple test data
In parallel, there is also custom unittest-based framework centered around
_grass.gunittest_ package. These tests run in the NC sample datasets and can be
executed using _pytest_ or directly. The unittest-based adds a number of custom
assert methods to accommodate different data and outputs typical in GRASS GIS.
_grass.gunittest_ documentation:
<https://grass.osgeo.org/grass-devel/manuals/libpython/gunittest_testing.html>

Some tests may be launched in the location `../demolocation/`:
## Running tests

Tests can be executed using _pytest_:

```bash
# create new mapset for test
grass ../demolocation/user1 -c
# run the test
make
# Setup the Python environment (if not set up already).
# Replace grass by path to the executable if not installed on path.
export PYTHONPATH=\$(grass --config python_path):\$PYTHONPATH
export LD_LIBRARY_PATH=\$(grass --config path)/lib:\$LD_LIBRARY_PATH
# Run the test.
pytest
```

## Extended test data

Most tests require the North Carolina Sample dataset, available from
<https://grass.osgeo.org/sampledata/north_carolina/>
## Test data

## Notes
To test manually or to write tests, you may need to use the North Carolina
Sample dataset, available from
<https://grass.osgeo.org/sampledata/north_carolina/>.

Since 2020: For a more advanced test suite, see
<https://github.com/OSGeo/grass/actions>
## CI

Until 2019: For a more advanced test suite, see
<http://fatra.cnr.ncsu.edu/grassgistests/summary_report/>
Most tests run in the CI. See the `.github` directory for details and
use it as a reference.
29 changes: 0 additions & 29 deletions testsuite/examples/test_framework_GRASS_GIS_with_NC.conf

This file was deleted.

144 changes: 0 additions & 144 deletions testsuite/examples/test_framework_GRASS_GIS_with_NC.sh

This file was deleted.

3 changes: 0 additions & 3 deletions testsuite/raster/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion testsuite/raster/README

This file was deleted.

48 changes: 0 additions & 48 deletions testsuite/raster/rhemisphere.sh

This file was deleted.

File renamed without changes.
26 changes: 0 additions & 26 deletions testsuite/vector/v.in.gps_test.sh

This file was deleted.

Loading