Skip to content

Commit

Permalink
mud1
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Aug 17, 2023
1 parent c4bb7f2 commit 180ed78
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Run macOS-based netCDF Tests


on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

name: Run S3 netCDF Tests (under Ubuntu Linux)

on: [workflow_dispatch]
on: [push,workflow_dispatch]

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: Run Ubuntu/Linux netCDF Tests

on: [pull_request, workflow_dispatch]
on: [push,pull_request, workflow_dispatch]

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_win_cygwin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run Cygwin-based tests

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

env:
SHELLOPTS: igncr
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_win_mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Run MSYS2, MinGW64-based Tests
env:
CPPFLAGS: "-D_BSD_SOURCE"

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

jobs:

Expand Down
60 changes: 43 additions & 17 deletions ncdump/tst_mud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,55 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
# unlimited dimensions.

set -e
if test "x$TESTNCZARR" = x1 ; then
. "$srcdir/test_nczarr.sh"
s3isolate "testdir_mud4"
THISDIR=`pwd`
cd $ISOPATH
fi

echo ""
echo "*** Testing ncdump output for multiple unlimited dimensions"
echo "*** creating netcdf file tst_mud4.nc from ref_tst_mud4.cdl ..."
${NCGEN} -4 -b -o tst_mud4.nc $srcdir/ref_tst_mud4.cdl
echo "*** creating tst_mud4.cdl from tst_mud4.nc ..."
${NCDUMP} tst_mud4.nc > tst_mud4.cdl

echo "*** creating netcdf file $file from ref_tst_mud4.cdl ..."

if test "x$TESTNCZARR" = x1 ; then
fileargs "tmp_mud4_${zfilt}"
deletemap $zext $file
file="$fileurl"
else
file="tmp_mud4_${zfilt}.nc"
rm -f $file
fi

${NCGEN} -4 -b -o $file $srcdir/ref_tst_mud4.cdl
echo "*** creating tmp_mud4.cdl from $file ..."
${NCDUMP} $file > tmp_mud4.cdl
# echo "*** comparing tst_mud4.cdl with ref_tst_mud4.cdl..."
diff -b tst_mud4.cdl $srcdir/ref_tst_mud4.cdl
# echo "*** comparing annotation from ncdump -bc tst_mud4.nc with expected output..."
${NCDUMP} -bc tst_mud4.nc > tst_mud4-bc.cdl
diff -b tst_mud4-bc.cdl $srcdir/ref_tst_mud4-bc.cdl
diff -b tmp_mud4.cdl $srcdir/ref_tst_mud4.cdl
# echo "*** comparing annotation from ncdump -bc $file with expected output..."
${NCDUMP} -bc $file > tmp_mud4-bc.cdl
diff -b tmp_mud4-bc.cdl $srcdir/ref_tst_mud4-bc.cdl

# Now test with char arrays instead of ints
echo "*** creating netcdf file tst_mud4_chars.nc from ref_tst_mud4_chars.cdl ..."
${NCGEN} -4 -b -o tst_mud4_chars.nc $srcdir/ref_tst_mud4_chars.cdl
echo "*** creating tst_mud4_chars.cdl from tst_mud4_chars.nc ..."
${NCDUMP} tst_mud4_chars.nc > tst_mud4_chars.cdl
# echo "*** comparing tst_mud4_chars.cdl with ref_tst_mud4_chars.cdl..."
diff -b tst_mud4_chars.cdl $srcdir/ref_tst_mud4_chars.cdl
exit 0
if test "x$TESTNCZARR" = x1 ; then
fileargs "tmp_mud4_chars${zfilt}"
deletemap $zext $file
file="$fileurl"
else
file="tmp_mud4_chars${zfilt}.nc"
rm -f $file
fi
echo "*** creating netcdf file $file from ref_tst_mud4_chars.cdl ..."
${NCGEN} -4 -b -o $file $srcdir/ref_tst_mud4_chars.cdl
echo "*** creating ${file}.cdl from $file ..."
${NCDUMP} $file > tmp_mud4_chars.cdl
# echo "*** comparing tmp_mud4_chars.cdl with ref_tst_mud4_chars.cdl..."
diff -b tmp_mud4_chars.cdl $srcdir/ref_tst_mud4_chars.cdl
gexit 0
# unused
# echo "*** comparing annotation from ncdump -bc tst_mud4_chars.nc with expected output..."
${NCDUMP} -bc tst_mud4_chars.nc > tst_mud4_chars-bc.cdl
# diff -b tst_mud4_chars-bc.cdl $srcdir/ref_tst_mud4_chars-bc.cdl
${NCDUMP} -bc $file > tmp_mud4_chars-bc.cdl
# diff -b tmp_mud4_chars-bc.cdl $srcdir/ref_tst_mud4_chars-bc.cdl
echo "*** All ncdump test output for multiple unlimited dimensions passed!"
exit 0
13 changes: 8 additions & 5 deletions nczarr_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SET(abs_top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
remove_definitions(-DDLL_EXPORT)

# Create nczarr tests from nc_test4 tests
macro(NCZARR_SH_TEST basename)
FILE(READ ${CMAKE_CURRENT_SOURCE_DIR}/../nc_test4/tst_${basename}.sh SHSOURCE)
macro(NCZARR_SH_TEST basename src)
FILE(READ ${CMAKE_CURRENT_SOURCE_DIR}/../${src}/tst_${basename}.sh SHSOURCE)
STRING(PREPEND SHSOURCE "#!/bin/bash\n")
STRING(PREPEND SHSOURCE "TESTNCZARR=1\n")
# Replace with FILE(CONFIGURE) when cmake 3.18 is in common use
Expand All @@ -32,9 +32,10 @@ NCZARR_C_TEST(unlim_vars unlim_vars)
NCZARR_C_TEST(h5_endians endians)
NCZARR_C_TEST(put_vars_two_unlim_dim put_vars_two_unlim_dim)

NCZARR_SH_TEST(specific_filters)
NCZARR_SH_TEST(unknown)
NCZARR_SH_TEST(filter_vlen)
NCZARR_SH_TEST(specific_filters nc_test4)
NCZARR_SH_TEST(unknown nc_test4)
NCZARR_SH_TEST(filter_vlen nc_test4)
NCZARR_SH_TEST(mud ncdump)

FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh
${CMAKE_CURRENT_SOURCE_DIR}/ref*.cdl
Expand Down Expand Up @@ -126,6 +127,7 @@ IF(ENABLE_TESTS)
add_sh_test(nczarr_test run_nccopyz)
add_sh_test(nczarr_test run_fillonlyz)
add_sh_test(nczarr_test run_unlim_io)
add_sh_test(nczarr_test run_mud)
ENDIF()

IF(ENABLE_FILTER_TESTING)
Expand All @@ -138,6 +140,7 @@ IF(ENABLE_TESTS)
ADD_SH_TEST(nczarr_test run_nczfilter)
ADD_SH_TEST(nczarr_test run_filter)
ADD_SH_TEST(nczarr_test run_specific_filters)
ADD_SH_TEST(nczarr_test run_filter_vlen)
IF(FALSE)
# This test is too dangerous to run in a parallel make environment.
# It causes race conditions. So suppress and only test by hand.
Expand Down
14 changes: 12 additions & 2 deletions nczarr_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ TESTS += run_scalar.sh
TESTS += run_nulls.sh
TESTS += run_notzarr.sh
TESTS += run_external.sh
TESTS += run_mud.sh

if ENABLE_NCZARR_ZIP
TESTS += run_newformat.sh
Expand Down Expand Up @@ -188,8 +189,8 @@ ref_zarr_test_data.cdl.gz

CLEANFILES = ut_*.txt ut*.cdl tmp*.nc tmp*.cdl tmp*.txt tmp*.dmp tmp*.zip tmp*.nc tmp*.dump tmp*.tmp tmp*.zmap tmp_ngc.c ref_zarr_test_data.cdl tst_*.nc.zip ref_quotes.zip ref_power_901_constants.zip

BUILT_SOURCES = test_quantize.c run_specific_filters.sh run_filterinstall.sh run_unknown.sh \
test_filter_vlen.c run_filter_vlen.sh test_unlim_vars.c
BUILT_SOURCES = test_quantize.c test_filter_vlen.c test_unlim_vars.c test_endians.c test_put_vars_two_unlim_dim.c \
run_unknown.sh run_specific_filters.sh run_filter_vlen.sh run_filterinstall.sh run_mud.sh

test_quantize.c: $(top_srcdir)/nc_test4/tst_quantize.c
rm -f $@
Expand Down Expand Up @@ -252,6 +253,15 @@ run_filterinstall.sh: $(top_srcdir)/nc_test4/tst_filterinstall.sh
chmod a+x $@
rm -f run_filterinstall.tmp

run_mud.sh: $(top_srcdir)/ncdump/tst_mud.sh
rm -f $@ run_mud.tmp
echo "#!/bin/bash" > run_mud.tmp
echo "TESTNCZARR=1" >> run_mud.tmp
cat $(top_srcdir)/nc_test4/tst_mud.sh >> run_mud.tmp
tr -d '\r' < run_mud.tmp > $@
chmod a+x $@
rm -f run_mud.tmp

# Remove directories
clean-local:
rm -fr testdir_*
Expand Down

0 comments on commit 180ed78

Please sign in to comment.