Merge pull request from NixOS/gdal-tests-correct-binary

gdal: call correct binaries in tests
This commit is contained in:
Ivan Mincik 2023-12-22 09:58:49 +01:00 committed by GitHub
commit 3eb3e297c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,33 +4,31 @@ let
inherit (gdal) pname version; inherit (gdal) pname version;
in in
runCommand "${pname}-tests" { runCommand "${pname}-tests" { meta.timeout = 60; }
nativeBuildInputs = [ gdal ]; ''
meta.timeout = 60;
} ''
# test version # test version
ogrinfo --version \ ${gdal}/bin/ogrinfo --version \
| grep 'GDAL ${version}' | grep 'GDAL ${version}'
gdalinfo --version \ ${gdal}/bin/gdalinfo --version \
| grep 'GDAL ${version}' | grep 'GDAL ${version}'
# test formats # test formats
ogrinfo --formats \ ${gdal}/bin/ogrinfo --formats \
| grep 'GPKG.*GeoPackage' | grep 'GPKG.*GeoPackage'
gdalinfo --formats \ ${gdal}/bin/gdalinfo --formats \
| grep 'GTiff.*GeoTIFF' | grep 'GTiff.*GeoTIFF'
# test vector file # test vector file
echo -e "Latitude,Longitude,Name\n48.1,0.25,'Test point'" > test.csv echo -e "Latitude,Longitude,Name\n48.1,0.25,'Test point'" > test.csv
ogrinfo ./test.csv ${gdal}/bin/ogrinfo ./test.csv
# test raster file # test raster file
gdal_create \ ${gdal}/bin/gdal_create \
-a_srs "EPSG:4326" \ -a_srs "EPSG:4326" \
-of GTiff \ -of GTiff \
-ot UInt16 \ -ot UInt16 \
@ -40,7 +38,7 @@ runCommand "${pname}-tests" {
-co COMPRESS=LZW \ -co COMPRESS=LZW \
test.tif test.tif
gdalinfo ./test.tif ${gdal}/bin/gdalinfo ./test.tif
touch $out touch $out
'' ''