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