71 Commits

Author SHA1 Message Date
Nyall Dawson
325a5cb16a Fix lint 2023-07-07 14:29:28 +10:00
Nyall Dawson
394315955e Apply suggestions from code review 2023-07-07 14:29:28 +10:00
Matthias Kuhn
1626b7e928 Move tests to QgisUnitTests 2023-07-07 14:29:28 +10:00
Matthias Kuhn
54b45078b5 Monkey patch and deprecate API 2023-07-07 14:29:28 +10:00
Nyall Dawson
1a1d2a7a8d Alternative approach to a QGIS specific unittest class 2023-07-07 14:29:28 +10:00
Nyall Dawson
0811919ba6 Ensure symbols using map unit sizing work correctly in elevation
profile plots

Fixes #52833
2023-05-23 09:56:46 +10:00
Matthias Kuhn
c8dd71e4d3 Set size for layout check 2023-05-13 08:47:22 +02:00
Matthias Kuhn
da075fa259 Use QgsLayoutChecker from core 2023-05-09 14:41:31 +02:00
Nyall Dawson
60380c1cf8 Use fstring 2023-04-27 04:39:14 +10:00
Nyall Dawson
3492ddbcfa Move layout checking to base class 2023-04-27 04:39:14 +10:00
Nyall Dawson
e2ad92e843 Only append to existing test reports if running under CI 2023-04-27 04:39:14 +10:00
Nyall Dawson
ecab2bfb4f Partially update annotation item test to newer framework 2023-04-27 04:39:14 +10:00
Nyall Dawson
f2878a43e1 Start moving some render check methods to base class 2023-04-27 04:39:14 +10:00
Sandro Santilli
7588ce429f Cleanup temporary python test config path when requested
References #48884
2022-10-20 04:49:56 +02:00
Nyall Dawson
9f07b782f2 More working processing tests on newer systems 2022-08-10 16:33:18 +10:00
Nyall Dawson
b17ad2f703 Add some more methods to normalize geometries for processing tests 2022-08-08 17:50:06 +10:00
Nyall Dawson
07ee0bb7e4 Fix some tests on newer GEOS 2022-03-17 18:12:27 +10:00
Denis Rouzaud
da08c8a435
[cmake] generalize Python output directory in UseTest macro (#43191)
* [cmake] generalize Python output directory in UseTest macro

this is helpful in case we set up another python output directory (eg PySide2)

* define python output directories to the parent scope

* try with target_include_directories

* define vars on top level

* Update UsePythonTest.cmake

* some cleanup

* more cleanup

* fix uic

* fix path for all platforms

* fix var
2021-05-13 07:32:03 +02:00
Etienne Trimaille
3711fcf198 Update the flake8 configuration 2021-05-09 16:40:38 +10:00
Denis Rouzaud
555f516925
use cmake native FindPython (#42497) 2021-03-28 21:49:40 +02:00
Nyall Dawson
973682baa3 Use QgsRenderChecker to compare png images when comparing processing result
directories
2021-02-08 13:23:40 +10:00
Nyall Dawson
1af083415a Use a different technique to compare expected vs result directories in processing tests, which allows us to compare the
contents of files using a more flexible approach
2021-02-08 13:23:40 +10:00
Nyall Dawson
d4f2b842ba Allow for multiple reference text files 2021-02-08 13:23:40 +10:00
Nyall Dawson
9ba0bd9944 Allow casting date/datetime values to string to compare to expected results 2021-02-08 13:23:39 +10:00
Nyall Dawson
846d1fe0e6 [processing] Add option to ignore part order when comparing geometries to expected results 2021-02-08 13:23:39 +10:00
Nyall Dawson
7478bca68d [processing] Don't use authid to compare layer CRSes
Instead of QgsCoordinateReferenceSystem == operator, so that we
can correctly test equality of non-standard CRSes
2021-01-11 13:06:05 +10:00
Denis Rouzaud
eddf6feb45 modernize CMakeLists.txt files 2020-11-12 07:14:46 +10:00
Denis Rouzaud
7d1ca81618
improve geometry equality report in tests (#39772)
from https://github.com/qgis/QGIS/pull/8154/files#diff-dbb55b6871a9157f22dc7a979009676cb03f2fadefc557ad0e66a47c92a93503
2020-11-03 09:30:14 +01:00
Alexander Bruy
136c5a4bc2 perform rounding either if field type is numeric or if value was casted
to the number
2020-06-16 08:35:51 +10:00
Sandro Santilli
c23a19793a Set QGIS_CUSTOM_CONFIG_PATH to temporary dir for python tests
Partially fixes #34185
See also #34187
2020-02-03 09:28:38 +01:00
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Martin Dobias
ee63cffd88 [processing] Add 'project' to test definition and 'directory' output test
- for algorithms that produce directory output, it is possible to test
  that directory contents are exactly the same (recursively)
- added possibility to have a project file loaded before an algorithm is run
- documented the new additions (+ few existing ones)
2019-04-25 21:40:31 +02:00
Alessandro Pasotti
ed9709b4fa Copy updated test runner into the docker
Handle -e and do not exit on error
2018-11-20 10:31:05 +01:00
Matthias Kuhn
8aca375a6e Add assertGeometriesEqual function for testing 2018-08-21 17:57:14 +02:00
Martin Dobias
c3279ee544 Add a note about version added for new functions in testing module 2018-05-10 14:10:10 -04:00
Martin Dobias
ef145afca6 Add support for unordered comparison of features of layers
This is useful when an algorithm returns features in no particular order
and sorting features by attributes does not help because there may be
features with the same attributes, giving non-unique sorting orders.
2018-05-10 06:50:57 -04:00
Martin Dobias
73d10afe31 Processing tests: allow topological geometry tests instead of exact tests
This is useful with geometry algorithms when the order of the coordinates of produced
geometries does not need to be exactly the same every time, but the output is still
topologically equivalent.
2018-05-10 06:50:57 -04:00
Nyall Dawson
739d4fab09 More verbose test outputs 2018-05-06 19:19:45 +10:00
Matthias Kuhn
7b3308dc4a Improved debug output on test fail 2018-05-02 16:11:08 +02:00
Matthias Kuhn
5f0f8062bc Compare case insensitive 2018-05-02 14:17:59 +02:00
Matthias Kuhn
d9bdedf6d5 testing.checkLayersEqual, assert field names 2018-05-02 11:44:14 +02:00
Nyall Dawson
6dbdbead0c Handle null values in processing attribute tests 2017-11-14 07:14:46 +10:00
Matthias Kuhn
394c53154f Update for nose2 0.7.0 2017-11-05 23:03:16 +01:00
Nyall Dawson
837c1c56eb Fix tests 2017-10-26 08:44:38 +10:00
Nyall Dawson
e9fd409552 Allow multiple primary key fields to be specified for processing tests
`
2017-09-08 16:33:55 +10:00
Nyall Dawson
b87b2fe827 Allow skipping crs check in processing test results
The GML format often requires extra 'hand holding' in order to
get QGIS to detect it's CRS (e.g. GML files created directly
in GDAL will not have an autodetected CRS when pulled into
QGIS). This needs fixing, but as a workaround to allow
processing algorithm porting to continue we can now skip
the crs check for these layers.
2017-08-14 04:56:24 +10:00
Matthias Kuhn
abf768141b More verbose python testing output 2017-08-10 08:03:50 +02:00
Mario Baranzini
78af413dcc Remove python future compatibility layer 2017-08-07 10:27:15 +02:00
Nyall Dawson
d4ad063f45 Allow specifying a 'primary key' field when comparing layers for
processing tests

Some algorithms will return results in different orders, e.g.
due to the use of dicts or other methods which do not guarantee
a fixed return order.

Using a primary key to do the feature match allows us to flexibly
handle these situations and provide tests for these algorithms.
2017-08-05 22:10:18 +10:00
Nyall Dawson
e8d667cac3 Allow testing of layer equality without throwing asserts
Sometimes in tests it's required to check for layer equality without
aborting in case of mismatches
2017-08-05 17:51:38 +10:00