2021-06-10 05:55:11 +08:00
|
|
|
#!/bin/bash
|
2021-05-30 06:40:38 +08:00
|
|
|
|
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-12-24 13:18:56 +08:00
|
|
|
# We need to find the drive letter, if any
|
|
|
|
DL=`${NCPATHCVT} -c -e / | sed -e 's|/cygdrive/\([a-zA-Z]\)/.*|\1|'`
|
|
|
|
if test "x$DL" != x ; then
|
|
|
|
# Lower case drive letter
|
|
|
|
DLL=`echo "$DL" | tr '[:upper:]' '[:lower:]'`
|
|
|
|
DL="-d $DLL"
|
|
|
|
fi
|
|
|
|
|
2021-05-30 06:40:38 +08:00
|
|
|
testcase1() {
|
|
|
|
T="$1"
|
|
|
|
P="$2"
|
2021-09-03 07:04:26 +08:00
|
|
|
|
2021-12-24 13:18:56 +08:00
|
|
|
echo -n "path: $T: |$P| => |" >>tmp_pathcvt.txt
|
|
|
|
${NCPATHCVT} -B"@" ${DL} "$T" -e "$P" >>tmp_pathcvt.txt
|
2021-06-06 04:12:21 +08:00
|
|
|
echo "|" >> tmp_pathcvt.txt
|
2021-05-30 06:40:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
testcase() {
|
|
|
|
testcase1 "-u" "$1"
|
|
|
|
testcase1 "-c" "$1"
|
|
|
|
testcase1 "-m" "$1"
|
2021-06-06 04:12:21 +08:00
|
|
|
testcase1 "-w" "$1"
|
2021-12-24 13:18:56 +08:00
|
|
|
testcase1 "-C" "$1"
|
2021-06-10 05:55:11 +08:00
|
|
|
}
|
2021-05-30 06:40:38 +08:00
|
|
|
|
2021-05-30 06:52:41 +08:00
|
|
|
rm -f tmp_pathcvt.txt
|
|
|
|
|
2021-12-24 13:18:56 +08:00
|
|
|
# '@' will get translated to embedded blank
|
|
|
|
PATHS="/xxx/x/y d:/x/y /cygdrive/d/x/y /d/x/y /cygdrive/d /d /cygdrive/d/git/netcdf-c/dap4_test/test_anon_dim.2.syn d:\\x\\y d:\\x\\y@w\\z"
|
|
|
|
for p in $PATHS ; do
|
|
|
|
testcase $p
|
|
|
|
done
|
|
|
|
exit
|
2021-05-30 06:52:41 +08:00
|
|
|
|
|
|
|
diff -w ${srcdir}/ref_pathcvt.txt ./tmp_pathcvt.txt
|
2021-05-30 06:40:38 +08:00
|
|
|
|
|
|
|
exit 0
|