@joebigelow / wix / commits / e3940e85

Update DUtilUnitTest to reference WixBuildTools.TestSupport.Native.

Sean Hall committed Jul 15, 2020 at 21:31 UTC e3940e85379b44ab8f68d01cbb6b11db8b0bad77
7 files changed +16 -121
src/dutil/dutil.vcxproj
+2 -2
@@ -51,7 +51,7 @@
51 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
52
53 <ImportGroup Label="Shared">
54 - <Import Project="..\..\packages\Nerdbank.GitVersioning.2.0.41\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.0.41\build\Nerdbank.GitVersioning.targets')" />
54 + <Import Project="..\..\packages\Nerdbank.GitVersioning.3.1.91\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.3.1.91\build\Nerdbank.GitVersioning.targets')" />
55 </ImportGroup>
56
57 <Import Project="..\NativeMultiTargeting.Build.props" />
@@ -196,6 +196,6 @@
196 <PropertyGroup>
197 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
198 </PropertyGroup>
199 - <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.0.41\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.0.41\build\Nerdbank.GitVersioning.targets'))" />
199 + <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.3.1.91\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.3.1.91\build\Nerdbank.GitVersioning.targets'))" />
200 </Target>
201 </Project>
\ No newline at end of file
src/dutil/packages.config
+1 -1
@@ -1,4 +1,4 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <packages>
3 - <package id="Nerdbank.GitVersioning" version="2.0.41" targetFramework="native" developmentDependency="true" />
3 + <package id="Nerdbank.GitVersioning" version="3.1.91" targetFramework="native" developmentDependency="true" />
4 </packages>
\ No newline at end of file
src/test/DUtilUnitTest/DUtilUnitTest.vcxproj
+9 -23
@@ -3,8 +3,7 @@
3
4
5 <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6 - <Import Project="..\..\..\packages\xunit.core.2.4.1\build\xunit.core.props" Condition="Exists('..\..\..\packages\xunit.core.2.4.1\build\xunit.core.props')" />
7 - <Import Project="..\..\..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props')" />
6 + <Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\build\WixBuildTools.TestSupport.Native.props" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\build\WixBuildTools.TestSupport.Native.props')" />
7 <ItemGroup Label="ProjectConfigurations">
8 <ProjectConfiguration Include="Debug|Win32">
9 <Configuration>Debug</Configuration>
@@ -21,10 +20,8 @@
20 <RootNamespace>DUtilUnitTests</RootNamespace>
21 <Keyword>ManagedCProj</Keyword>
22 <ConfigurationType>DynamicLibrary</ConfigurationType>
24 - <PlatformToolset>v142</PlatformToolset>
23 <CharacterSet>Unicode</CharacterSet>
24 <CLRSupport>true</CLRSupport>
27 - <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -46,7 +43,7 @@
43 <ClCompile Include="PathUtilTest.cpp" />
44 <ClCompile Include="precomp.cpp">
45 <PrecompiledHeader>Create</PrecompiledHeader>
49 - <!-- Warnings from NativeAssert.h from referencing netstandard dlls -->
46 + <!-- Warnings from referencing netstandard dlls -->
47 <DisableSpecificWarnings>4564;4691</DisableSpecificWarnings>
48 </ClCompile>
49 <ClCompile Include="SceUtilTest.cpp" Condition=" Exists('$(SqlCESdkIncludePath)') " />
@@ -56,7 +53,6 @@
53 <ItemGroup>
54 <ClInclude Include="precomp.h" />
55 <ClInclude Include="error.h" />
59 - <ClInclude Include="NativeAssert.h" />
56 </ItemGroup>
57 <ItemGroup>
58 <None Include="packages.config" />
@@ -65,33 +61,23 @@
61 <ItemGroup>
62 <Reference Include="System" />
63 <Reference Include="System.Core" />
68 - <Reference Include="xunit.abstractions">
69 - <HintPath>..\..\..\packages\xunit.abstractions.2.0.3\lib\netstandard2.0\xunit.abstractions.dll</HintPath>
70 - </Reference>
71 - <Reference Include="xunit.assert">
72 - <HintPath>..\..\..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
73 - </Reference>
74 - <Reference Include="xunit.core">
75 - <HintPath>..\..\..\packages\xunit.extensibility.core.2.4.1\lib\netstandard1.1\xunit.core.dll</HintPath>
76 - </Reference>
77 - <Reference Include="xunit.execution.desktop">
78 - <HintPath>..\..\..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll</HintPath>
79 - </Reference>
64 <Reference Include="WixBuildTools.TestSupport">
81 - <HintPath>..\..\..\packages\WixBuildTools.TestSupport.4.0.37\lib\net472\WixBuildTools.TestSupport.dll</HintPath>
65 + <HintPath>..\..\..\packages\WixBuildTools.TestSupport.4.0.40\lib\net472\WixBuildTools.TestSupport.dll</HintPath>
66 + </Reference>
67 + <Reference Include="WixBuildTools.TestSupport.Native">
68 + <HintPath>..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\lib\net472\WixBuildTools.TestSupport.Native.dll</HintPath>
69 </Reference>
70 </ItemGroup>
71 <ItemGroup>
72 <ProjectReference Include="..\..\dutil\dutil.vcxproj" />
73 </ItemGroup>
74 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
88 - <Import Project="..\..\..\packages\xunit.core.2.4.1\build\xunit.core.targets" Condition="Exists('..\..\..\packages\xunit.core.2.4.1\build\xunit.core.targets')" />
75 + <Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\build\WixBuildTools.TestSupport.Native.targets" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\build\WixBuildTools.TestSupport.Native.targets')" />
76 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
77 <PropertyGroup>
78 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
79 </PropertyGroup>
93 - <Error Condition="!Exists('..\..\..\packages\xunit.core.2.4.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.core.2.4.1\build\xunit.core.props'))" />
94 - <Error Condition="!Exists('..\..\..\packages\xunit.core.2.4.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.core.2.4.1\build\xunit.core.targets'))" />
95 - <Error Condition="!Exists('..\..\..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props'))" />
80 + <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\build\WixBuildTools.TestSupport.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\build\WixBuildTools.TestSupport.Native.props'))" />
81 + <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\build\WixBuildTools.TestSupport.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.40\build\WixBuildTools.TestSupport.Native.targets'))" />
82 </Target>
83 </Project>
\ No newline at end of file
src/test/DUtilUnitTest/DUtilUnitTest.vcxproj.filters
-3
@@ -70,8 +70,5 @@
70 <ClInclude Include="error.h">
71 <Filter>Header Files</Filter>
72 </ClInclude>
73 - <ClInclude Include="NativeAssert.h">
74 - <Filter>Header Files</Filter>
75 - </ClInclude>
73 </ItemGroup>
74 </Project>
\ No newline at end of file
src/test/DUtilUnitTest/NativeAssert.h deleted
-85
@@ -1,85 +0,0 @@
1 -#pragma once
2 -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
3 -
4 -
5 -namespace WixBuildTools {
6 -namespace TestSupport {
7 -
8 - using namespace System;
9 - using namespace System::Collections::Generic;
10 - using namespace System::Linq;
11 - using namespace Xunit;
12 -
13 - public ref class NativeAssert : WixAssert
14 - {
15 - public:
16 - static void NotNull(LPCWSTR wz)
17 - {
18 - if (!wz)
19 - {
20 - Assert::NotNull(nullptr);
21 - }
22 - }
23 -
24 - // For some reason, naming these NotStringEqual methods "NotEqual" breaks Intellisense in files that call any overload of the NotEqual method.
25 - static void NotStringEqual(LPCWSTR expected, LPCWSTR actual)
26 - {
27 - NativeAssert::NotStringEqual(expected, actual, FALSE);
28 - }
29 -
30 - static void NotStringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase)
31 - {
32 - IEqualityComparer<String^>^ comparer = ignoreCase ? StringComparer::InvariantCultureIgnoreCase : StringComparer::InvariantCulture;
33 - Assert::NotEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), comparer);
34 - }
35 -
36 - // For some reason, naming these StringEqual methods "Equal" breaks Intellisense in files that call any overload of the Equal method.
37 - static void StringEqual(LPCWSTR expected, LPCWSTR actual)
38 - {
39 - NativeAssert::StringEqual(expected, actual, FALSE);
40 - }
41 -
42 - static void StringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase)
43 - {
44 - IEqualityComparer<String^>^ comparer = ignoreCase ? StringComparer::InvariantCultureIgnoreCase : StringComparer::InvariantCulture;
45 - Assert::Equal(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), comparer);
46 - }
47 -
48 - static void Succeeded(HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array<LPCSTR>^ zArgs)
49 - {
50 - array<Object^>^ formatArgs = gcnew array<Object^, 1>(zArgs->Length + 1);
51 - formatArgs[0] = NativeAssert::LPSTRToString(zArg);
52 - for (int i = 0; i < zArgs->Length; ++i)
53 - {
54 - formatArgs[i + 1] = NativeAssert::LPSTRToString(zArgs[i]);
55 - }
56 - WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs);
57 - }
58 -
59 - static void Succeeded(HRESULT hr, LPCSTR zFormat, ... array<LPCWSTR>^ wzArgs)
60 - {
61 - array<Object^>^ formatArgs = gcnew array<Object^, 1>(wzArgs->Length);
62 - for (int i = 0; i < wzArgs->Length; ++i)
63 - {
64 - formatArgs[i] = NativeAssert::LPWSTRToString(wzArgs[i]);
65 - }
66 - WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs);
67 - }
68 -
69 - static void ValidReturnCode(HRESULT hr, ... array<HRESULT>^ validReturnCodes)
70 - {
71 - Assert::Contains(hr, (IEnumerable<HRESULT>^)validReturnCodes);
72 - }
73 -
74 - private:
75 - static String^ LPSTRToString(LPCSTR z)
76 - {
77 - return z ? gcnew String(z) : nullptr;
78 - }
79 - static String^ LPWSTRToString(LPCWSTR wz)
80 - {
81 - return wz ? gcnew String(wz) : nullptr;
82 - }
83 - };
84 -}
85 -}
src/test/DUtilUnitTest/packages.config
+4 -5
@@ -1,7 +1,5 @@
1 -<?xml version="1.0" encoding="utf-8"?>
1 +<?xml version="1.0" encoding="utf-8"?>
2 <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 -
4 -
3 <packages>
4 <package id="xunit.abstractions" version="2.0.3" />
5 <package id="xunit.assert" version="2.4.1" />
@@ -9,5 +7,6 @@
7 <package id="xunit.extensibility.core" version="2.4.1" />
8 <package id="xunit.extensibility.execution" version="2.4.1" />
9 <package id="xunit.runner.visualstudio" version="2.4.1" />
12 - <package id="WixBuildTools.TestSupport" version="4.0.37" />
13 -</packages>
10 + <package id="WixBuildTools.TestSupport" version="4.0.40" />
11 + <package id="WixBuildTools.TestSupport.Native" version="4.0.40" />
12 +</packages>
\ No newline at end of file
src/test/DUtilUnitTest/precomp.h
-2
@@ -23,7 +23,5 @@
23 #include <regutil.h>
24 #include <uriutil.h>
25
26 -#include "NativeAssert.h"
27 -
26 #pragma managed
27 #include <vcclr.h>