Skip to content

Commit 327eed8

Browse files
committed
Resurrect support for the SSL tests
1 parent e5779dc commit 327eed8

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

projects/client/Unit/RabbitMQ.Client.Unit.csproj

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,30 @@
3737
<WarningLevel>4</WarningLevel>
3838
</PropertyGroup>
3939

40+
<!-- SSL test support -->
41+
42+
<!-- I'd use the Choose construct for this, but it seems broken on Mono -->
43+
<PropertyGroup Condition="'$(SSL_CERTS_DIR)' == ''">
44+
<SSLAvail>false</SSLAvail>
45+
</PropertyGroup>
46+
<PropertyGroup Condition="'$(SSL_CERTS_DIR)' != ''">
47+
<SSLAvail>true</SSLAvail>
48+
<SSLCertsDir>$(SSL_CERTS_DIR)</SSLCertsDir>
49+
</PropertyGroup>
50+
51+
<Target Name="ImportSSL" Condition="$(SSLAvail)">
52+
<!-- import cacert into certmgr -->
53+
<Exec Command="certmgr -add -c Trust $(SSLCertsDir)/testca/cacert.cer"/>
54+
</Target>
55+
4056
<!-- Running the tests -->
41-
<Target Name="RunUnitTests">
57+
<Target Name="RunUnitTests" DependsOnTargets="ImportSSL">
4258
<Exec Command='$(PropLaunchExe)..\..\..\lib\nunit\nunit-console.exe "build\bin\$(AssemblyName).dll"' WorkingDirectory="$(MSBuildProjectDirectory)" ContinueOnError="true" />
43-
</Target>
44-
45-
<!-- Clean test result file -->
46-
<Target Name="CleanTestResults">
47-
<Delete Files="TestResult.xml" />
59+
</Target>
60+
61+
<!-- Clean test result file -->
62+
<Target Name="CleanTestResults">
63+
<Delete Files="TestResult.xml" />
4864
</Target>
4965

5066
<!-- Visual Studio generated reference and file list -->
@@ -75,12 +91,12 @@
7591

7692
<!-- Microsoft CSharp targets -->
7793
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
78-
94+
7995
<!-- Custom AfterBuild -->
80-
<Target Name="AfterBuild" DependsOnTargets="RunUnitTests" />
81-
82-
<!-- Custom BeforeClean -->
96+
<Target Name="AfterBuild" DependsOnTargets="RunUnitTests" />
97+
98+
<!-- Custom BeforeClean -->
8399
<Target Name="BeforeClean" DependsOnTargets="CleanTestResults" />
84100

85101
</Project>
86-
102+

0 commit comments

Comments
 (0)