Skip to content

Commit 800e1ad

Browse files
committed
Finish the missing code to handle VS in test_common.in
Now the testsuite should be able to run.
1 parent 4d8ea75 commit 800e1ad

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,6 +1887,13 @@ FILE(COPY ${netCDF_SOURCE_DIR}/include/netcdf_meta.h
18871887
SET(EXTRA_DIST ${EXTRA_DIST} ${CMAKE_SOURCE_DIR}/test_common.in)
18881888
SET(TOPSRCDIR "${CMAKE_SOURCE_DIR}")
18891889
SET(TOPBUILDDIR "${CMAKE_BINARY_DIR}")
1890+
IF(MSVC)
1891+
# Seems this is always upper-case by this point :-(
1892+
SET(VS_CONFIGURATION "/${CMAKE_BUILD_TYPE}")
1893+
ELSE()
1894+
SET(VS_CONFIGURATION "")
1895+
ENDIF()
1896+
18901897
configure_file(${CMAKE_SOURCE_DIR}/test_common.in ${CMAKE_BINARY_DIR}/test_common.sh @ONLY NEWLINE_STYLE LF)
18911898

18921899
#####

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,7 @@ AC_SUBST(HAS_MMAP,[$enable_mmap])
13501350
AC_SUBST(HAS_JNA,[$enable_jna])
13511351
AC_SUBST(RELAX_COORD_BOUND,[$enable_relax_coord_bound])
13521352
AC_SUBST(HAS_ERANGE_FILL,[$enable_erange_fill])
1353+
AC_SUBST(VS_CONFIGURATION,[])
13531354

13541355
# Include some specifics for netcdf on windows.
13551356
#AH_VERBATIM([_WIN32_STRICMP],

examples/CDL/do_comps.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# This shell script runs the cmp test on the example programs.
33
# $Id: do_comps.sh,v 1.1 2006/06/27 17:44:54 ed Exp $
44

5+
. ../../test_common.sh
6+
57
set -e
68

79
##
@@ -11,13 +13,13 @@ set -e
1113
echo ""
1214
echo "*** Creating example data files from CDL scripts."
1315
echo "*** creating simple_xy.nc..."
14-
../../ncgen/ncgen -b -o simple_xy.nc $srcdir/simple_xy.cdl
16+
../../ncgen${VS}/ncgen -b -o simple_xy.nc $srcdir/simple_xy.cdl
1517

1618
echo "*** checking sfc_pres_temp.nc..."
17-
../../ncgen/ncgen -b -o sfc_pres_temp.nc $srcdir/sfc_pres_temp.cdl
19+
../../ncgen${VS}/ncgen -b -o sfc_pres_temp.nc $srcdir/sfc_pres_temp.cdl
1820

1921
echo "*** checking pres_temp_4D.nc..."
20-
../../ncgen/ncgen -b -o pres_temp_4D.nc $srcdir/pres_temp_4D.cdl
22+
../../ncgen${VS}/ncgen -b -o pres_temp_4D.nc $srcdir/pres_temp_4D.cdl
2123

2224
echo "*** All example creations worked!"
2325

ncdump/tst_netcdf4.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ ${NCDUMP} tst_nans.nc | sed 's/e+0/e+/g' > tst_nans.cdl ; ERR
7474
diff -b tst_nans.cdl $srcdir/ref_tst_nans.cdl ; ERR
7575

7676
# Do unicode test only if it exists => BUILD_UTF8 is true
77-
if test -f ./tst_unicode -o -f ./tst_unicode.exe ; then
77+
if test -f ./tst_unicode -o -f ./tst_unicode.exe -o -f ${execdir}/tst_unicode.exe; then
7878
echo "*** dumping tst_unicode.nc to tst_unicode.cdl..."
7979
${execdir}/tst_unicode ; ERR
8080
${NCDUMP} tst_unicode.nc | sed 's/e+0/e+/g' > tst_unicode.cdl ; ERR

test_common.in

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ if test "x$SETX" = x1 ; then set -x ; fi
5959
top_srcdir="$TOPSRCDIR"
6060
top_builddir="$TOPBUILDDIR"
6161

62-
# Currently not used, but left as a Visual Studio placeholder.
63-
# VS=Debug
62+
# Only set via CMake builds, where it must contain a leading '/'
63+
export VS=@VS_CONFIGURATION@
6464

6565
# srcdir may or may not be defined, but if not, then create it
6666
if test "x$srcdir" = x ; then
@@ -77,6 +77,11 @@ builddir=`pwd`
7777
# execdir is an alias for builddir
7878
execdir="${builddir}"
7979

80+
# VS build dir support
81+
if test -d "${execdir}${VS}"; then
82+
execdir="${execdir}${VS}"
83+
fi
84+
8085
# pick off the last component as the relative name of this directory
8186
thisdir=`basename $srcdir`
8287

0 commit comments

Comments
 (0)