# Just a few for spill file, and compressed support. short_list = [ \ ('byte.tif', 1, 4672, None), ('uint16.tif', 1, 4672, None), ('float64.tif', 1, 4672, None) ] for item in short_list: ut2 = gdaltest.GDALTest( 'HFA', item[0], item[1], item[2], options = [ 'USE_SPILL=YES' ] ) if ut2 is None: print( 'HFA tests skipped' ) gdaltest_list.append( (ut2.testCreateCopy, item[0] + ' (spill)') ) gdaltest_list.append( (ut2.testCreate, item[0] + ' (spill)') ) ut2 = gdaltest.GDALTest( 'HFA', item[0], item[1], item[2], options = [ 'COMPRESS=YES' ] ) if ut2 is None: print( 'HFA tests skipped' ) # gdaltest_list.append( (ut2.testCreateCopy, item[0] + ' (compressed)') ) gdaltest_list.append( (ut2.testCreate, item[0] + ' (compressed)') ) if __name__ == '__main__': gdaltest.setup_run( 'hfa_write' ) gdaltest.run_tests( gdaltest_list ) gdaltest.summarize()
y1 = random.randint(0, 10000) x2 = x1 + random.randint(1, 10) y2 = y1 + random.randint(1, 10) feat.SetGeometry(build_rectangle(x1, y1, x2, y2)) lyr.CreateFeature(feat) feat = None ds.ExecuteSQL('CREATE SPATIAL INDEX ON ogr_shape_qix') ret = check_qix_random_geoms(lyr) shape_drv.DeleteDataSource('/vsimem/ogr_shape_qix.shp') return ret gdaltest_list = [ ogr_shape_qix_1, ogr_shape_qix_2, ogr_shape_qix_3, ogr_shape_qix_4, ] if __name__ == '__main__': gdaltest.setup_run('ogr_shape_qix') gdaltest.run_tests(gdaltest_list) sys.exit(gdaltest.summarize())
if arg == '-l': print('List of GDAL Autotest modules') for test in all_test_list: print('* ' + test) sys.exit(0) elif arg == '-run_as_external': run_as_external = True elif arg == '-h' or arg[0] == '-': print('Usage: ' + sys.argv[0] + ' [OPTION]') print('\t<tests> - list of test modules to run, run all if none specified') print('\t-l - list available test modules') print('\t-h - print this usage message') print('\t-run_as_external - run each test script in a dedicated Python instance') sys.exit(0) else: test_list.append(arg) if not test_list: test_list = all_test_list # we set ECW to not resolve projection and datum strings to get 3.x behavior. gdal.SetConfigOption("ECW_DO_NOT_RESOLVE_DATUM_PROJECTION", "YES") gdaltest.setup_run('gdalautotest_all') gdaltest.run_all(test_list, run_as_external=run_as_external) errors = gdaltest.summarize() sys.exit(errors)
2056, #somerc 2027, #utm 4326, #longlat 26943, #utm ] for item in tiff_srs_list: try: epsg_code = item[0] epsg_broken = item[1] epsg_proj4_broken = item[2] except: epsg_code = item epsg_broken = False epsg_proj4_broken = False ut = TestTiffSRS(epsg_code, 1, epsg_broken) gdaltest_list.append((ut.test, "tiff_srs_epsg_%d" % epsg_code)) ut = TestTiffSRS(epsg_code, 0, epsg_proj4_broken) gdaltest_list.append((ut.test, "tiff_srs_proj4_of_epsg_%d" % epsg_code)) gdaltest_list.append(tiff_srs_without_linear_units) if __name__ == '__main__': gdaltest.setup_run('tiff_srs') gdaltest.run_tests(gdaltest_list) gdaltest.summarize()
prj_parms = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) pci_parms = srs.ExportToPCI() if pci_parms[0] != 'LONG/LAT D506' \ or pci_parms[1] != 'DEGREE' \ or pci_parms[2] != prj_parms: print(pci_parms) gdaltest.post_reason('ExportToPCI result wrong.') return 'fail' return 'success' gdaltest_list = [ osr_pci_1, osr_pci_2, osr_pci_3, osr_pci_4, osr_pci_5, osr_pci_6, osr_pci_7, None] if __name__ == '__main__': gdaltest.setup_run('osr_pci') gdaltest.run_tests(gdaltest_list) sys.exit(gdaltest.summarize())
if len(sys.argv) == 2: if sys.argv[1] == '-l': print('List of GDAL Autotest modules') for test in all_test_list: print('* ' + test) sys.exit(0) elif sys.argv[1] == '-h' or sys.argv[1][0] == '-': print('Usage: ' + sys.argv[0] + ' [OPTION]') print( '\t<tests> - list of test modules to run, run all if none specified' ) print('\t-l - list available test modules') print('\t-h - print this usage message') sys.exit(0) test_list = [] for i in range(1, len(gdaltest.argv)): test_list.append(gdaltest.argv[i]) if len(test_list) == 0: test_list = all_test_list gdaltest.setup_run('gdalautotest_all') gdaltest.run_all(test_list, []) errors = gdaltest.summarize() sys.exit(errors)