Skip to content

Commit 9bbc9ff

Browse files
Fix use of g2c_compare in testing (#797)
* working on g2c_compare * fixed g2c_compare issue
1 parent 6d2f54b commit 9bbc9ff

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ endif()
9292
# We need g2c if G2C_COMPARE is chosen.
9393
if (G2C_COMPARE OR USE_G2C_API)
9494
find_package(g2c 2.1.0 REQUIRED)
95+
if (G2C_COMPARE)
96+
find_program(G2C_COMPARE_PROG g2c_compare REQUIRED)
97+
endif()
9598
else()
9699
find_package(g2c REQUIRED)
97100
endif()

test_utils/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ endif()
8080
# Run these shell tests.
8181
if(BUILD_4)
8282
if(BUILD_D)
83-
gu_test(run_copygb2_tests2)
83+
# gu_test(run_copygb2_tests2)
8484
endif()
8585
gu_test(run_cnvgrib_tests)
8686
gu_test(run_degrib2_tests)
@@ -94,10 +94,15 @@ gu_test(run_copygb_tests)
9494
gu_test(run_grbindex_tests)
9595

9696
if(G2C_COMPARE)
97-
find_program(G2C_COMPARE g2c_compare)
98-
gu_test(run_copygb2_tests)
97+
configure_file("run_copygb2_tests2.sh.in"
98+
"run_copygb2_tests2.sh" @ONLY NEWLINE_STYLE LF)
99+
# file(COPY "${CMAKE_BISOURCE_DIR}/test_utils/run_copygb2_tests2.sh"
100+
# DESTINATION ${CMAKE_BINARY_DIR}/test_utils
101+
# FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
102+
# Add the shell script as a test.
103+
add_test(NAME run_copygb2_tests2.sh COMMAND bash run_copygb2_tests2.sh)
99104
else()
100-
message(STATUS "g2c_compare not found.")
105+
message(STATUS "g2c_compare not used.")
101106
endif()
102107

103108
if(FTP_TEST_FILES)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ echo "*** Running copygb2 test"
1111
../utils/copygb2 -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2
1212

1313
# Are the files the same?
14-
g2c_compare -v data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2
14+
@G2C_COMPARE_PROG@ -v data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2
1515

1616
# Invoke interpolation logic.
1717
../utils/copygb2 -g "30 6 0 0 0 0 0 0 1473 1025 12190000 226541000 8 25000000 265000000 5079000 5079000 0 64 25000000 25000000" -i"1 1" -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.ip.grib2
1818

1919
# Are the files the same?
20-
g2c_compare -v data/ref_gdaswave.t00z.wcoast.0p16.f000.ip.grib2 test_gdaswave_2.ip.grib2
20+
@G2C_COMPARE_PROG@ -v data/ref_gdaswave.t00z.wcoast.0p16.f000.ip.grib2 test_gdaswave_2.ip.grib2
2121

2222
echo "*** SUCCESS!"
2323
exit 0

0 commit comments

Comments
 (0)