Skip to content

Commit

Permalink
Fix pull request Unidata#374 (dap4.dmh)
Browse files Browse the repository at this point in the history
1. When running under windows (as opposed to cygwin)
   we need to make sure to not user /cygdrive/ file paths.
   This was ocurring in libdap4/d4read.c, but may occur
   elsewhere.
2. Shell scripts in the git repo are not being checked-out
   with the executable mode set. Had core.filemode set to false.
   Was a major hassle to fix.
  • Loading branch information
DennisHeimbigner committed Apr 4, 2017
1 parent f73efea commit 6d88091
Show file tree
Hide file tree
Showing 116 changed files with 458 additions and 100 deletions.
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -753,15 +753,11 @@ ENDIF(USE_HDF5 OR ENABLE_NETCDF_4)

# Option to Build DAP2+DAP4 Clients
OPTION(ENABLE_DAP "Enable DAP2 and DAP4 Client." ON)
OPTION(ENABLE_DAP4 "Enable DAP4 Client." OFF) # Temporary
IF(ENABLE_DAP)
SET(USE_DAP ON)
SET(ENABLE_DAP2 ON)
IF(ENABLE_NETCDF_4)
IF(ENABLE_DAP4)
SET(ENABLE_DAP4 ON)
ENDIF()
ELSE()
SET(ENABLE_DAP4 ON)
IF(NOT ENABLE_NETCDF_4)
SET(ENABLE_DAP4 OFF)
ENDIF()
FIND_PACKAGE(CURL)
Expand Down Expand Up @@ -1201,8 +1197,8 @@ CHECK_SYMBOL_EXISTS(vprintf "stdio.h" HAVE_VPRINTF)
SET(HAVE_ST_BLKSIZE ${HAVE_STRUCT_STAT_ST_BLKSIZE})

# Type checks
CHECK_TYPE_SIZE("void*" SIZEOF_VOIDSTAR)
# Alias for automake consistency
# Aliases for automake consistency
SET(SIZEOF_VOIDSTAR ${CMAKE_SIZEOF_VOID_P})
SET(SIZEOF_VOIDP ${SIZEOF_VOIDSTAR})
CHECK_TYPE_SIZE("char" SIZEOF_CHAR)
CHECK_TYPE_SIZE("double" SIZEOF_DOUBLE)
Expand Down
Empty file modified RELEASE_NOTES.md
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion cf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ FLAGS="$FLAGS -DCMAKE_INSTALL_PREFIX=d:/ignore"

if test "x$DAP" = x ; then
FLAGS="$FLAGS -DENABLE_DAP=false"
else
FLAGS="$FLAGS -DENABLE_DAP=true"
fi
if test "x$NC4" = x ; then
FLAGS="$FLAGS -DENABLE_NETCDF_4=false"
Expand All @@ -26,7 +28,6 @@ FLAGS="$FLAGS -DENABLE_CONVERSION_WARNINGS=false"
FLAGS="$FLAGS -DENABLE_DAP_REMOTE_TESTS=true"
FLAGS="$FLAGS -DENABLE_TESTS=true"
FLAGS="$FLAGS -DENABLE_EXAMPLES=false"
#FLAGS="$FLAGS -DENABLE_DAP4=true"
#FLAGS="$FLAGS -DENABLE_HDF4=true"

rm -fr build
Expand Down
3 changes: 3 additions & 0 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ are set when opening a binary file on Windows. */
/* The size of `ushort', as computed by sizeof. */
#cmakedefine SIZEOF_USHORT ${SIZEOF_USHORT}

/* The size of `void*', as computed by sizeof. */
#cmakedefine SIZEOF_VOIDP ${SIZEOF_VOIDP}

/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,11 @@ AC_C_BIGENDIAN
SLEEPCMD=""
PLTFORMOUT="$(uname | cut -d '_' -f 1)"
if test "$PLTFORMOUT" = "CYGWIN"; then
ISCYGWIN=yes
SLEEPCMD="sleep 5"
AC_MSG_NOTICE([Pausing between sizeof() checks to mitigate a Cygwin issue.])
fi
AM_CONDITIONAL(ISCYGWIN, [test "x$ISCYGWIN" = xyes])

$SLEEPCMD
AC_CHECK_SIZEOF(short)
Expand Down
2 changes: 1 addition & 1 deletion dap4_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ IF(ENABLE_TESTS)
BUILD_BIN_TEST(findtestserver4)

IF(BUILD_UTILITIES)
add_sh_test(dap4_test test_remote)
# disable for now add_sh_test(dap4_test test_remote)
ENDIF(BUILD_UTILITIES)
ENDIF(ENABLE_DAP_REMOTE_TESTS)
ENDIF(ENABLE_TESTS)
Expand Down
Empty file modified dap4_test/d4test_common.sh
100644 → 100755
Empty file.
Empty file modified dap4_test/maketests.sh
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions dap4_test/test_data.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ fi

finish


3 changes: 2 additions & 1 deletion dap4_test/test_hyrax.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if test "x${RESET}" = x1 ; then rm -fr ${BASELINEH}/*.dmp ; fi
for f in $F ; do
URL="dap4://test.opendap.org:8080/opendap/nc4_test_files/${f}${FRAG}"
echo "testing: $URL"
if ! ../ncdump/ncdump ${URL} > ./results/${f}.hyrax; then
if ! ${NCDUMP} "${URL}" > ./results/${f}.hyrax; then
failure "${URL}"
fi
if test "x${TEST}" = x1 ; then
Expand All @@ -44,3 +44,4 @@ done

echo "*** Pass"
exit 0

1 change: 1 addition & 0 deletions dap4_test/test_meta.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ fi

finish


1 change: 1 addition & 0 deletions dap4_test/test_parse.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ finish

exit 0


5 changes: 4 additions & 1 deletion dap4_test/test_raw.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi

. ${srcdir}/d4test_common.sh

set -x

# Compute the set of testfiles
PUSHD ${srcdir}/daptestfiles
F=`ls -1d *.dap`
Expand Down Expand Up @@ -42,7 +44,7 @@ if test "x${RESET}" = x1 ; then rm -fr ${BASELINERAW}/*.dmp ; fi
for f in $F ; do
echo "testing: $f"
URL="[dap4]file:${DAPTESTFILES}/${f}"
if ! ${VG} ${NCDUMP} ${URL} > ./results/${f}.dmp; then
if ! ${VG} ${NCDUMP} "${URL}" > ./results/${f}.dmp; then
failure "${URL}"
fi
if test "x${TEST}" = x1 ; then
Expand All @@ -63,3 +65,4 @@ for f in $F ; do
done

finish

3 changes: 2 additions & 1 deletion dap4_test/test_remote.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ for f in $F ; do
if test "x$NOCSUM" = x1; then
URL="[ucar.checksummode=none]${URL}"
fi
if ! ${VG} ${NCDUMP} ${URL} > ./results/${f}.dmp; then
if ! ${VG} ${NCDUMP} "${URL}" > ./results/${f}.dmp; then
failure "${URL}"
fi
if test "x${TEST}" = x1 ; then
Expand All @@ -81,3 +81,4 @@ for f in $F ; do
done

finish

Empty file modified dap4_test/test_test.sh
100644 → 100755
Empty file.
89 changes: 89 additions & 0 deletions dap4_test/tst_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/sh

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

. ${srcdir}/d4test_common.sh

cd ${DAPTESTFILES}
F=`ls -1 *.dap | sed -e 's/[.]dap//g' | tr '\r\n' ' '`
cd $WD

if test "x${RESET}" = x1 ; then rm -fr ${BASELINE}/*.d4d ; fi
for f in $F ; do
echo "testing: ${f}"
if ! ${VG} ${execdir}/test_data ${DAPTESTFILES}/${f} ./results/${f}.nc ; then
failure "${execdir}/test_data ${DAPTESTFILES}/${f} ./results/${f}.nc"
fi
${NCDUMP} ./results/${f}.nc > ./results/${f}.d4d
if test "x${TEST}" = x1 ; then
if ! diff -wBb ${BASELINE}/${f}.d4d ./results/${f}.d4d ; then
failure "diff -wBb ${BASELINE}/${f}.d4d ./results/${f}.d4d"
fi
elif test "x${RESET}" = x1 ; then
echo "${f}:"
cp ./results/${f}.d4d ${BASELINE}/${f}.d4d
fi
done

# Remove empty lines and trim lines in a cdl file
trim() {
if test $# != 2 ; then
echo "simplify: too few args"
else
rm -f $2
while read -r iline; do
oline=`echo $iline | sed -e 's/^[\t ]*\([^\t ]*\)[\t ]*$/\\1/'`
if test "x$oline" = x ; then continue ; fi
echo "$oline" >> $2
done < $1
fi
}

# Do cleanup on the baseline file
baseclean() {
if test $# != 2 ; then
echo "simplify: too few args"
else
rm -f $2
while read -r iline; do
oline=`echo $iline | tr "'" '"'`
echo "$oline" >> $2
done < $1
fi
}

# Do cleanup on the result file
resultclean() {
if test $# != 2 ; then
echo "simplify: too few args"
else
rm -f $2
while read -r iline; do
oline=`echo $iline | sed -e 's|^\(netcdf.*\)[.]nc\(.*\)$|\\1\\2|'`
echo "$oline" >> $2
done < $1
fi
}

if test "x${CDLDIFF}" = x1 ; then
for f in $F ; do
STEM=`echo $f | cut -d. -f 1`
if ! test -e ${CDLTESTFILES}/${STEM}.cdl ; then
echo "Not found: ${CDLTESTFILES}/${STEM}.cdl"
continue
fi
echo "diff -wBb ${CDLTESTFILES}/${STEM}.cdl ./results/${f}.d4d"
rm -f ./b1 ./b2 ./r1 ./r2
trim ${CDLTESTFILES}/${STEM}.cdl ./b1
trim ./results/${f}.d4d ./r1
baseclean b1 b2
resultclean r1 r2
if ! diff -wBb ./b2 ./r2 ; then
failure "${f}"
fi
done
fi

finish

54 changes: 54 additions & 0 deletions dap4_test/tst_meta.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/sh

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

. ${srcdir}/d4test_common.sh

cd ${DMRTESTFILES}
F=`ls -1 *.dmr | sed -e 's/[.]dmr//g' | tr '\r\n' ' '`
cd $WD

CDL=
for f in ${F} ; do
STEM=`echo $f | cut -d. -f 1`
if test -e ${CDLTESTFILES}/${STEM}.cdl ; then
CDL="${CDL} ${STEM}"
else
echo "Not found: ${CDLTESTFILES}/${STEM}.cdl"
fi
done

if test "x${RESET}" = x1 ; then rm -fr ${BASELINE}/*.d4m ; fi

for f in ${F} ; do
echo "checking: $f"
if ! ${VG} ${execdir}/test_meta ${DMRTESTFILES}/${f}.dmr ./results/${f} ; then
failure "${execdir}/test_meta ${DMRTESTFILES}/${f}.dmr ./results/${f}"
fi
${NCDUMP} -h ./results/${f} > ./results/${f}.d4m
if test "x${TEST}" = x1 ; then
if ! diff -wBb ${BASELINE}/${f}.d4m ./results/${f}.d4m ; then
failure "diff -wBb ${BASELINE}/${f}.ncdump ./results/${f}.d4m"
fi
elif test "x${RESET}" = x1 ; then
echo "${f}:"
cp ./results/${f}.d4m ${BASELINE}/${f}.d4m
fi
done

if test "x${CDLDIFF}" = x1 ; then
for f in $CDL ; do
echo "diff -wBb ${CDLTESTFILES}/${f}.cdl ./results/${f}.d4m"
rm -f ./tmp
cat ${CDLTESTFILES}/${f}.cdl \
cat >./tmp
echo diff -wBbu ./tmp ./results/${f}.d4m
if ! diff -wBbu ./tmp ./results/${f}.d4m ; then
failure "${f}"
fi
done
fi

finish

42 changes: 42 additions & 0 deletions dap4_test/tst_parse.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

. ${srcdir}/d4test_common.sh

cd ${DMRTESTFILES}
F=`ls -1 *.dmr | sed -e 's/[.]dmr//' |tr '\r\n' ' '`
cd $WD

if test "x${RESET}" = x1 ; then rm -fr ${BASELINE}/*.d4p ; fi
for f in $F ; do
echo "testing: $f"
if ! ${VG} ${execdir}/test_parse ${DMRTESTFILES}/${f}.dmr > ./results/${f}.d4p ; then
failure "${f}"
fi
if test "x${TEST}" = x1 ; then
if ! diff -wBb ${BASELINE}/${f}.d4p ./results/${f}.d4p ; then
failure "${f}"
fi
elif test "x${DIFF}" = x1 ; then
echo "diff -wBb ${DMRTESTFILES}/${f}.dmr ./results/${f}.d4p"
rm -f ./tmp
cat ./results/${f}.d4p \
| sed -e '/<Dimensions>/d' -e '/<Types>'/d -e '/<Variables>'/d -e '/<Groups>'/d \
| sed -e '/<\/Dimensions>/d' -e '/<\/Types>'/d -e '/<\/Variables>'/d -e '/<\/Groups>'/d \
| sed -e '/_edu.ucar.opaque.size/,+2d' \
| cat > ./tmp
if ! diff -wBb ${DMRTESTFILES}/${f}.dmr ./tmp ; then
failure "${f}"
fi
elif test "x${RESET}" = x1 ; then
echo "${f}:"
cp ./results/${f}.d4p ${BASELINE}/${f}.d4p
fi
done

finish

exit 0

67 changes: 67 additions & 0 deletions dap4_test/tst_raw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/sh

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

. ${srcdir}/d4test_common.sh

set -x

# Compute the set of testfiles
PUSHD ${srcdir}/daptestfiles
F=`ls -1d *.dap`
POPD
F=`echo $F | tr '\r\n' ' '`
F=`echo $F | sed -e s/.dap//g`

# Do cleanup on the baseline file
baseclean() {
if test $# != 2 ; then
echo "simplify: too few args"
else
rm -f $2
while read -r iline; do
oline=`echo $iline | tr "'" '"'`
echo "$oline" >> $2
done < $1
fi
}

# Do cleanup on the result file
resultclean() {
if test $# != 2 ; then
echo "simplify: too few args"
else
rm -f $2
while read -r iline; do
oline=`echo $iline | sed -e 's|^\(netcdf.*\)[.]nc\(.*\)$|\\1\\2|'`
echo "$oline" >> $2
done < $1
fi
}

if test "x${RESET}" = x1 ; then rm -fr ${BASELINERAW}/*.dmp ; fi
for f in $F ; do
echo "testing: $f"
URL="[dap4]file:${DAPTESTFILES}/${f}"
if ! ${VG} ${NCDUMP} "${URL}" > ./results/${f}.dmp; then
failure "${URL}"
fi
if test "x${TEST}" = x1 ; then
if ! diff -wBb ${BASELINERAW}/${f}.dmp ./results/${f}.dmp ; then
failure "diff ${f}.dmp"
fi
elif test "x${RESET}" = x1 ; then
echo "${f}:"
cp ./results/${f}.dmp ${BASELINERAW}/${f}.dmp
elif test "x${DIFF}" = x1 ; then
echo "hdrtest: ${f}"
rm -f ./tr1 ./tr2 ./tb1 ./tb2
baseclean
if ! diff -wBb ./${BASELINERAW}/${f}.dmp ./${BASELINE}/${f}.ncdump ; then
failure diff -wBb ./${BASELINERAW}/${f}.dmp ./${BASELINE}/${f}.ncdump
fi
fi
done

finish
Empty file modified docs/Doxyfile.developer
100755 → 100644
Empty file.
Empty file modified docs/footer.html
100755 → 100644
Empty file.
Empty file modified docs/install.md
100755 → 100644
Empty file.
Empty file modified docs/old/netcdf-cxx.texi
100755 → 100644
Empty file.
Empty file modified docs/old/netcdf-cxx4.texi
100755 → 100644
Empty file.
Empty file modified docs/old/netcdf-f90.texi
100755 → 100644
Empty file.
Empty file modified docs/old/netcdf-install.texi
100755 → 100644
Empty file.
Empty file modified docs/old/netcdf-internal.texi
100755 → 100644
Empty file.
Loading

0 comments on commit 6d88091

Please sign in to comment.