netcdf-c/unit_test/run_auxmisc.sh
Dennis Heimbigner 61e6e3970f Provide an auxilliary function that allows users to parse the _NCProperties attribute.
re: Discussion https://github.com/Unidata/netcdf-c/discussions/3085

This discussion raised the issue of the best way to distinguish
a netcdfd-c created file and an HDF5 created file. The
recommended way is to use the _NCProperties attribute.  In order
for users to process this attribute, I have added a parser for
the attribute to the netcdf_aux.h file.
2025-02-10 18:52:09 -07:00

32 lines
818 B
Bash
Executable File

#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
set -e
# List of provenance strings to parse
# Start with some edge cases
TESTS=
TESTS="$TESTS abc=2\|z\=17,yyy=|zzz"
TESTS="$TESTS version=2,netcdf=4.7.4-development,hdf5=1.10.4"
TESTS="$TESTS version=2,netcdf=4.6.2-development,hdf5=1.10.1"
TESTS="$TESTS version=1|netcdf=4.6.2-development|hdf5=1.8.1"
# Test provenance parsing
testprov() {
rm -f tmp_provparse.txt
for t in $TESTS ; do
${execdir}/test_auxmisc -P ${t} >> tmp_provparse.txt
done
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
cat ${srcdir}/ref_provparse.txt
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
cat tmp_provparse.txt
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
# Verify
#diff ref_provparse.txt tmp_provparse.txt
}
testprov