Skip to content

Commit

Permalink
Added AEC test file (#122)
Browse files Browse the repository at this point in the history
* Added AEC test file

* Fixed typo

* Update run_wgrib2_aec_tests.sh

* Turning openjpeg on in Linux_options workflow to get AEC tests to work

* Update Linux_options.yml

* Updated comment

* Updated aec test and test data

* Updated Linux_options.yml

---------

Co-authored-by: Edward Hartnett <[email protected]>
  • Loading branch information
AlysonStahl-NOAA and edwardhartnett authored May 4, 2024
1 parent 4d4d16c commit e7f52f1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ endif()
copy_test_data(gdaswave.t00z.wcoast.0p16.f000.grib2)
copy_test_data(ref_gdaswave.t00z.wcoast.0p16.f000.grib2.inv)
copy_test_data(ref_npts_gdaswave.t00z.wcoast.0p16.f000.grib2.txt)
copy_test_data(tmp_int.grb)
copy_test_data(ref_WW3_Regional_US_West_Coast_20220718_0000.grib2.inv)
copy_test_data(gdas.t12z.pgrb2.1p00.anl.75r.grib2)
copy_test_data(ref_wind.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv)
Expand All @@ -93,6 +94,9 @@ copy_test_data(ref_grid.gdaswave.t00z.wcoast.0p16.f000.grib2.txt)
# Run these shell tests.
shell_test(run_wgrib2_tests)

if (USE_AEC)
shell_test(run_wgrib2_aec_tests)
endif()
if (FTP_TEST_FILES)
shell_test(run_wgrib2_ftp_tests)
endif()
Binary file added tests/data/tmp_int.grb
Binary file not shown.
20 changes: 20 additions & 0 deletions tests/run_wgrib2_aec_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
# This checks the use of AEC compression, only available if USE_AEC is turned on in CMake.
#
# Alyson Stahl, 4/18/24

set -e
echo ""
echo "*** Running wgrib2 tests"

cksum0=`../wgrib2/wgrib2 data/tmp_int.grb -text - | cksum`
../wgrib2/wgrib2 data/tmp_int.grb -set_grib_type aec -grib_out junk.grb
cksum1=`../wgrib2/wgrib2 junk.grb -text - | cksum`

if [ "$cksum0" != "$cksum1" ] ; then
echo "failed for compressing to aec and reading from aec"
exit 1
fi

echo "*** SUCCESS!"
exit 0

0 comments on commit e7f52f1

Please sign in to comment.