Skip to content

Commit

Permalink
Merge pull request #199 from NOAA-EMC/ejh_large_ftp_tests
Browse files Browse the repository at this point in the history
adding FTP tests with large files
  • Loading branch information
edwardhartnett authored Dec 28, 2022
2 parents cdeba3c + 145db28 commit b24f1ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ project(gributil VERSION ${pVersion} LANGUAGES C Fortran)
option(OPENMP "use OpenMP threading" OFF)
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
option(FTP_TEST_FILES "Fetch and test with files on FTP site." OFF)
option(LARGE_FTP_TESTS "When testing with FTP files, include very large (> 2GB) test files - this is slow!" OFF)
SET(TEST_FILE_DIR "." CACHE STRING "Check this directory for test files before using FTP.")

if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
Expand Down
12 changes: 11 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Ed Hartnett

# This fortran test is for the internals of degrib2.
add_executable(test_degrib2_int test_degrib2_int.F90 ${CMAKE_SOURCE_DIR}/src/degrib2/prlevel.F90 ${CMAKE_SOURCE_DIR}/src/degrib2/prvtime.F90)
add_executable(test_degrib2_int test_degrib2_int.F90 ${CMAKE_SOURCE_DIR}/src/degrib2/prlevel.F90
${CMAKE_SOURCE_DIR}/src/degrib2/prvtime.F90)
target_link_libraries(test_degrib2_int PRIVATE g2::g2_4)
add_test(NAME test_degrib2_int COMMAND test_degrib2_int)

Expand Down Expand Up @@ -92,6 +93,15 @@ if(FTP_TEST_FILES)
PULL_DATA(${G2_FTP_URL} ${THE_FILE})
endforeach()

# Fetch the large test file(s) from FTP if desired.
set(LARGE_FTP_FILES "fv3lam.t00z.namerica.f00.grib2")
if(LARGE_FTP_TESTS)
foreach(THE_FILE IN LISTS LARGE_FTP_FILES)
PULL_DATA(${G2_FTP_URL} ${THE_FILE})
endforeach()
add_definitions(-DLARGE_FTP_TESTS)
endif()

# Copy this inventory from the test directory. It's the expected
# inventory for one of the FTP files, after conversion to GRIB1.
gu_copy_test_data(ref_test_WW3_West.grib1.inventory.txt)
Expand Down

0 comments on commit b24f1ac

Please sign in to comment.