[gdal-dev] Testing the driver

Andrew C Aitchison andrew at aitchison.me.uk
Sun Feb 18 13:49:13 PST 2024


On Sun, 18 Feb 2024, Even Rouault wrote:

> Le 10/02/2024 à 18:34, Andrew C Aitchison via gdal-dev a écrit :
>> On Sat, 10 Feb 2024, Even Rouault via gdal-dev wrote:
>> 
>>>> To test your own development, you may have a more pleasant experience by 
>>>> directly running just the tests for your driver with something like 
>>>> "pytest autotest/ogr/ogr_miramon.py"  (be careful on Windows, the content 
>>>> of $build_dir/autotest is copied from $source_dir/autotest each time 
>>>> "cmake" is run, so if you edit your test .py file directly in the build 
>>>> directory, be super careful of not accidentally losing your work, and 
>>>> make sure to copy its content to the source directory first. That's 
>>>> admittedly an annoying point of the current test setup on Windows, 
>>>> compared to Unix where we use symbolic links)
>>>> 
>>> Actually Dan figured out it was possible to run directly the tests against 
>>> your test file from the source directory, and not the one that is copied. 
>>> Cf https://github.com/OSGeo/gdal/pull/9224
>>> 
>>> So you can actually do from the build directory:
>>> 
>>> pytest -c autotest/pytest.ini ../autotest/ogr/ogr_gpx.py
>> 
>> Recent tarball releases have cmake/template/pytest.ini.in
>> but how do I genenerate autotest/pytest.ini ?
> It is generated by cmake

Ah. If I do:
   tar Jxf gdal-3.8.4rc1.tar.xz
   tar zxf gdalautotest-3.8.4rc1.tar.gz
   ln -s ../gdalautotest-3.8.4 gdal-3.8.4/autotest
   cd gdal-3.8.4
   cmake -B build
build/autotest/pytest.ini is generated.

That link is not what I had expected -
   ln -s ../gdalautotest-3.8.4 gdal-3.8.4/gdalautotest
would have been more obvious to me, and I did try running cmake inside 
gdalautotest-3.8.4 first.

-- 
Andrew C. Aitchison                      Kendal, UK
                    andrew at aitchison.me.uk


More information about the gdal-dev mailing list