Skip to content

Commit 6207df1

Browse files
committed
CDRIVER-2806 test uninstall with MSVC
1 parent 72bf2b8 commit 6207df1

File tree

3 files changed

+70
-15
lines changed

3 files changed

+70
-15
lines changed

.evergreen/config.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,8 +1604,23 @@ tasks:
16041604
script: |
16051605
set -o xtrace
16061606
set -o errexit
1607-
BSON_ONLY=1 cmd.exe /c .\\.evergreen\\install-uninstall-check-mingw.cmd
1608-
cmd.exe /c .\\.evergreen\\install-uninstall-check-mingw.cmd
1607+
CC=mingw BSON_ONLY=1 cmd.exe /c .\\.evergreen\\install-uninstall-check-windows.cmd
1608+
CC=mingw cmd.exe /c .\\.evergreen\\install-uninstall-check-windows.cmd
1609+
1610+
- name: install-uninstall-check-msvc
1611+
depends_on:
1612+
- name: "make-release-archive"
1613+
variant: releng
1614+
commands:
1615+
- command: shell.exec
1616+
type: test
1617+
params:
1618+
working_dir: "mongoc"
1619+
script: |
1620+
set -o xtrace
1621+
set -o errexit
1622+
CC="Visual Studio 14 2015 Win64" BSON_ONLY=1 cmd.exe /c .\\.evergreen\\install-uninstall-check-windows.cmd
1623+
CC="Visual Studio 14 2015 Win64" cmd.exe /c .\\.evergreen\\install-uninstall-check-windows.cmd
16091624
16101625
- name: install-uninstall-check
16111626
depends_on:
@@ -8968,6 +8983,9 @@ buildvariants:
89688983
- name: "install-uninstall-check-mingw"
89698984
distros:
89708985
- windows-64-vs2015-compile
8986+
- name: "install-uninstall-check-msvc"
8987+
distros:
8988+
- windows-64-vs2015-compile
89718989

89728990
- name: clang34ubuntu
89738991
display_name: "clang 3.4 (Ubuntu 14.04)"

.evergreen/install-uninstall-check-mingw.cmd renamed to .evergreen/install-uninstall-check-windows.cmd

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
REM Supported/used environment variables:
2+
REM CC Compiler, "mingw" or "Visual Studio 14 2015 Win64".
3+
REM BSON_ONLY Whether to build only the BSON library.
4+
15
rem Ensure Cygwin executables like sh.exe are not in PATH
26
rem set PATH=C:\Windows\system32;C:\Windows
37

@@ -7,7 +11,6 @@ echo
711
set TAR=C:\cygwin\bin\tar
812
set CMAKE=C:\cmake\bin\cmake
913
set CMAKE_MAKE_PROGRAM=C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin\mingw32-make.exe
10-
set CC=C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin\gcc.exe
1114
rem Ensure Cygwin executables like sh.exe are not in PATH
1215
set PATH=C:\cygwin\bin;C:\Windows\system32;C:\Windows;C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin;C:\mongoc;src\libbson;src\libmongoc
1316

@@ -30,23 +33,37 @@ set PATH=%PATH%;%INSTALL_DIR%\bin
3033

3134
cd %BUILD_DIR%
3235
%TAR% xf ..\..\mongoc.tar.gz -C . --strip-components=1
36+
if errorlevel 1 (
37+
exit /B 1
38+
)
3339

3440
if "%BSON_ONLY%"=="1" (
3541
set BSON_ONLY_OPTION=-DENABLE_MONGOC=OFF
3642
) else (
3743
set BSON_ONLY_OPTION=-DENABLE_MONGOC=ON
3844
)
3945

40-
rem Build libmongoc, with flags that the downstream R driver mongolite uses
41-
%CMAKE% -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_CFLAGS="-std=c99 -pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake %BSON_ONLY_OPTION% .
42-
%CMAKE_MAKE_PROGRAM%
43-
if errorlevel 1 (
44-
exit /B 1
45-
)
46-
47-
%CMAKE_MAKE_PROGRAM% install
48-
if errorlevel 1 (
49-
exit /B 1
46+
echo.%CC%| findstr /I "gcc">Nul && (
47+
rem Build libmongoc, with flags that the downstream R driver mongolite uses
48+
%CMAKE% -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_CFLAGS="-std=c99 -pedantic" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake %BSON_ONLY_OPTION% .
49+
%CMAKE_MAKE_PROGRAM%
50+
if errorlevel 1 (
51+
exit /B 1
52+
)
53+
%CMAKE_MAKE_PROGRAM% install
54+
if errorlevel 1 (
55+
exit /B 1
56+
)
57+
) || (
58+
%CMAKE% -G "%CC%" "-DCMAKE_INSTALL_PREFIX=%INSTALL_DIR%" "-DCMAKE_BUILD_TYPE=Debug" %BSON_ONLY_OPTION% .
59+
MSBuild.exe /m ALL_BUILD.vcxproj
60+
if errorlevel 1 (
61+
exit /B 1
62+
)
63+
MSBuild.exe /m INSTALL.vcxproj
64+
if errorlevel 1 (
65+
exit /B 1
66+
)
5067
)
5168

5269
echo > %INSTALL_DIR%\lib\canary.txt

build/config.yml.template

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,8 +1607,25 @@ tasks:
16071607
script: |
16081608
set -o xtrace
16091609
set -o errexit
1610-
BSON_ONLY=1 cmd.exe /c .\\.evergreen\\install-uninstall-check-mingw.cmd
1611-
cmd.exe /c .\\.evergreen\\install-uninstall-check-mingw.cmd
1610+
export CC="C:/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin/gcc.exe"
1611+
BSON_ONLY=1 cmd.exe /c .\\.evergreen\\install-uninstall-check-windows.cmd
1612+
cmd.exe /c .\\.evergreen\\install-uninstall-check-windows.cmd
1613+
1614+
- name: install-uninstall-check-msvc
1615+
depends_on:
1616+
- name: "make-release-archive"
1617+
variant: releng
1618+
commands:
1619+
- command: shell.exec
1620+
type: test
1621+
params:
1622+
working_dir: "mongoc"
1623+
script: |
1624+
set -o xtrace
1625+
set -o errexit
1626+
export CC="Visual Studio 14 2015 Win64"
1627+
BSON_ONLY=1 cmd.exe /c .\\.evergreen\\install-uninstall-check-windows.cmd
1628+
cmd.exe /c .\\.evergreen\\install-uninstall-check-windows.cmd
16121629

16131630
- name: install-uninstall-check
16141631
depends_on:
@@ -1756,6 +1773,9 @@ buildvariants:
17561773
- name: "install-uninstall-check-mingw"
17571774
distros:
17581775
- windows-64-vs2015-compile
1776+
- name: "install-uninstall-check-msvc"
1777+
distros:
1778+
- windows-64-vs2015-compile
17591779

17601780
- name: clang34ubuntu
17611781
display_name: "clang 3.4 (Ubuntu 14.04)"

0 commit comments

Comments
 (0)