Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions test_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ endif()
# Run these shell tests.
if(BUILD_4)
if(BUILD_D)
# gu_test(run_copygb2_tests2)
gu_test(run_copygb2_tests)
endif()
gu_test(run_cnvgrib_tests)
gu_test(run_degrib2_tests)
Expand All @@ -96,10 +96,6 @@ gu_test(run_grbindex_tests)
if(G2C_COMPARE)
configure_file("run_copygb2_tests2.sh.in"
"run_copygb2_tests2.sh" @ONLY NEWLINE_STYLE LF)
# file(COPY "${CMAKE_BISOURCE_DIR}/test_utils/run_copygb2_tests2.sh"
# DESTINATION ${CMAKE_BINARY_DIR}/test_utils
# FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
# Add the shell script as a test.
add_test(NAME run_copygb2_tests2.sh COMMAND bash run_copygb2_tests2.sh)
else()
message(STATUS "g2c_compare not used.")
Expand Down
30 changes: 30 additions & 0 deletions test_utils/run_copygb2_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
# This is a test script for the NCEPLIBS-g2 project.
#
# This tests the copygb2 utility.
#
# Ed Hartnett, 1/23/25

set -e
echo ""
echo "*** Running copygb2 test"

# Invalid option.
../utils/copygb2 - && exit 1

# Incorrect number of arguments.
../utils/copygb2 -g data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 run_copygb2_tests_wcoast.grib2 && exit 1

# File missing.
../utils/copygb2 -x data/missing.grib2 && exit 1

# Wrong number of arguments.
../utils/copygb2 -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2 && exit 1


# Use -g option.
#../utils/copygb2 -g kpdtn data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 run_copygb2_tests_wcoast.grib2


echo "*** SUCCESS!"
exit 0
2 changes: 1 addition & 1 deletion utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (BUILD_D)
add_executable(copygb2 copygb2.F90)
target_link_libraries(copygb2 PUBLIC ${PROJECT_NAME}_d)
target_link_libraries(copygb2 PRIVATE PNG::PNG ${JASPER_LIBRARIES}
bacio::bacio ip::ip_d w3emc::w3emc_d)
bacio::bacio ip::ip_d)

if(ip_VERSION LESS 5.0)
target_link_libraries(copygb2 PRIVATE sp::sp_d)
Expand Down
Loading
Loading