summaryrefslogtreecommitdiff
path: root/src/internal/WixBuildTools.TestSupport.Native
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/WixBuildTools.TestSupport.Native')
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/AssemblyInfo.cpp17
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h104
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj74
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj.filters33
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.props13
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.targets54
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/packages.config17
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/precomp.cpp3
-rw-r--r--src/internal/WixBuildTools.TestSupport.Native/precomp.h11
9 files changed, 0 insertions, 326 deletions
diff --git a/src/internal/WixBuildTools.TestSupport.Native/AssemblyInfo.cpp b/src/internal/WixBuildTools.TestSupport.Native/AssemblyInfo.cpp
deleted file mode 100644
index 23a48993..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/AssemblyInfo.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
1// 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.
2
3#include "precomp.h"
4
5using namespace System::Reflection;
6using namespace System::Runtime::CompilerServices;
7using namespace System::Runtime::InteropServices;
8
9//
10// General Information about an assembly is controlled through the following
11// set of attributes. Change these attribute values to modify the information
12// associated with an assembly.
13//
14[assembly: AssemblyTitleAttribute("WixBuildTools.TestSupport.Native")];
15[assembly: AssemblyDescriptionAttribute("")];
16[assembly: AssemblyCultureAttribute("")];
17[assembly: ComVisible(false)];
diff --git a/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h b/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h
deleted file mode 100644
index b0206b14..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h
+++ /dev/null
@@ -1,104 +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
5namespace WixBuildTools {
6namespace 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 WixAssert::NotStringEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), ignoreCase);
33 }
34
35 // For some reason, naming these StringEqual methods "Equal" breaks Intellisense in files that call any overload of the Equal method.
36 static void StringEqual(LPCWSTR expected, LPCWSTR actual)
37 {
38 NativeAssert::StringEqual(expected, actual, FALSE);
39 }
40
41 static void StringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase)
42 {
43 WixAssert::StringEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), ignoreCase);
44 }
45
46 static void Succeeded(HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array<LPCSTR>^ zArgs)
47 {
48 array<Object^>^ formatArgs = gcnew array<Object^, 1>(zArgs->Length + 1);
49 formatArgs[0] = NativeAssert::LPSTRToString(zArg);
50 for (int i = 0; i < zArgs->Length; ++i)
51 {
52 formatArgs[i + 1] = NativeAssert::LPSTRToString(zArgs[i]);
53 }
54 WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs);
55 }
56
57 static void Succeeded(HRESULT hr, LPCSTR zFormat, ... array<LPCWSTR>^ wzArgs)
58 {
59 array<Object^>^ formatArgs = gcnew array<Object^, 1>(wzArgs->Length);
60 for (int i = 0; i < wzArgs->Length; ++i)
61 {
62 formatArgs[i] = NativeAssert::LPWSTRToString(wzArgs[i]);
63 }
64 WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs);
65 }
66
67 static void SpecificReturnCode(HRESULT hrExpected, HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array<LPCSTR>^ zArgs)
68 {
69 array<Object^>^ formatArgs = gcnew array<Object^, 1>(zArgs->Length + 1);
70 formatArgs[0] = NativeAssert::LPSTRToString(zArg);
71 for (int i = 0; i < zArgs->Length; ++i)
72 {
73 formatArgs[i + 1] = NativeAssert::LPSTRToString(zArgs[i]);
74 }
75 WixAssert::SpecificReturnCode(hrExpected, hr, gcnew String(zFormat), formatArgs);
76 }
77
78 static void SpecificReturnCode(HRESULT hrExpected, HRESULT hr, LPCSTR zFormat, ... array<LPCWSTR>^ wzArgs)
79 {
80 array<Object^>^ formatArgs = gcnew array<Object^, 1>(wzArgs->Length);
81 for (int i = 0; i < wzArgs->Length; ++i)
82 {
83 formatArgs[i] = NativeAssert::LPWSTRToString(wzArgs[i]);
84 }
85 WixAssert::SpecificReturnCode(hrExpected, hr, gcnew String(zFormat), formatArgs);
86 }
87
88 static void ValidReturnCode(HRESULT hr, ... array<HRESULT>^ validReturnCodes)
89 {
90 Assert::Contains(hr, (IEnumerable<HRESULT>^)validReturnCodes);
91 }
92
93 private:
94 static String^ LPSTRToString(LPCSTR z)
95 {
96 return z ? gcnew String(z) : nullptr;
97 }
98 static String^ LPWSTRToString(LPCWSTR wz)
99 {
100 return wz ? gcnew String(wz) : nullptr;
101 }
102 };
103}
104}
diff --git a/src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj b/src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj
deleted file mode 100644
index 47d79745..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj
+++ /dev/null
@@ -1,74 +0,0 @@
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<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <Import Project="build\WixBuildTools.TestSupport.Native.props" />
6
7 <ItemGroup Label="ProjectConfigurations">
8 <ProjectConfiguration Include="Debug|Win32">
9 <Configuration>Debug</Configuration>
10 <Platform>Win32</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Debug|x64">
13 <Configuration>Debug</Configuration>
14 <Platform>x64</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|Win32">
17 <Configuration>Release</Configuration>
18 <Platform>Win32</Platform>
19 </ProjectConfiguration>
20 <ProjectConfiguration Include="Release|x64">
21 <Configuration>Release</Configuration>
22 <Platform>x64</Platform>
23 </ProjectConfiguration>
24 </ItemGroup>
25
26 <PropertyGroup Label="Globals">
27 <ProjectTypes>{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}</ProjectTypes>
28 <ProjectGuid>{95BABD97-FBDB-453A-AF8A-FA031A07B599}</ProjectGuid>
29 <RootNamespace>WixBuildTools::TestSupport</RootNamespace>
30 <Keyword>ManagedCProj</Keyword>
31 <ConfigurationType>DynamicLibrary</ConfigurationType>
32 <CharacterSet>Unicode</CharacterSet>
33 <CLRSupport>true</CLRSupport>
34 <Description>WixBuildTools C++/CLI Test Support</Description>
35 <SignOutput>false</SignOutput>
36 <IsWixTestSupportProject>true</IsWixTestSupportProject>
37 </PropertyGroup>
38
39 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
40 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
41
42 <PropertyGroup>
43 <ProjectAdditionalIncludeDirectories></ProjectAdditionalIncludeDirectories>
44 <ProjectAdditionalLinkLibraries></ProjectAdditionalLinkLibraries>
45 </PropertyGroup>
46
47 <ItemGroup>
48 <ClCompile Include="AssemblyInfo.cpp" />
49 <ClCompile Include="precomp.cpp">
50 <PrecompiledHeader>Create</PrecompiledHeader>
51 <!-- Warnings from NativeAssert.h from referencing netstandard dlls -->
52 <DisableSpecificWarnings>4564;4691</DisableSpecificWarnings>
53 </ClCompile>
54 </ItemGroup>
55
56 <ItemGroup>
57 <ClInclude Include="precomp.h" />
58 <ClInclude Include="NativeAssert.h" />
59 </ItemGroup>
60
61 <ItemGroup>
62 <None Include="packages.config" />
63 </ItemGroup>
64
65 <ItemGroup>
66 <ProjectReference Include="..\WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj">
67 <Project>{6C57EF2C-979A-4106-A9E5-FE342810619A}</Project>
68 </ProjectReference>
69 </ItemGroup>
70
71 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
72 <Import Project="build\WixBuildTools.TestSupport.Native.targets" />
73 <Target Name="Pack" DependsOnTargets="Build" />
74</Project>
diff --git a/src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj.filters b/src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj.filters
deleted file mode 100644
index 34c1380f..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj.filters
+++ /dev/null
@@ -1,33 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="Source Files">
5 <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6 <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7 </Filter>
8 <Filter Include="Header Files">
9 <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10 <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11 </Filter>
12 <Filter Include="Resource Files">
13 <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14 <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15 </Filter>
16 </ItemGroup>
17 <ItemGroup>
18 <ClInclude Include="precomp.h">
19 <Filter>Header Files</Filter>
20 </ClInclude>
21 <ClInclude Include="NativeAssert.h">
22 <Filter>Header Files</Filter>
23 </ClInclude>
24 </ItemGroup>
25 <ItemGroup>
26 <ClCompile Include="AssemblyInfo.cpp">
27 <Filter>Source Files</Filter>
28 </ClCompile>
29 <ClCompile Include="precomp.cpp">
30 <Filter>Source Files</Filter>
31 </ClCompile>
32 </ItemGroup>
33</Project> \ No newline at end of file
diff --git a/src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.props b/src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.props
deleted file mode 100644
index d9d9dab4..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.props
+++ /dev/null
@@ -1,13 +0,0 @@
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<Project>
5 <PropertyGroup>
6 <RepoRootDir Condition=" '$(RepoRootDir)' == '' ">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), .gitignore))</RepoRootDir>
7 </PropertyGroup>
8 <Import Project="$(RepoRootDir)\packages\xunit.core.2.4.2\build\xunit.core.props" Condition="Exists('$(RepoRootDir)\packages\xunit.core.2.4.2\build\xunit.core.props')" />
9 <Import Project="$(RepoRootDir)\packages\xunit.runner.visualstudio.2.4.5\build\net462\xunit.runner.visualstudio.props" Condition="Exists('$(RepoRootDir)\packages\xunit.runner.visualstudio.2.4.5\build\net462\xunit.runner.visualstudio.props')" />
10 <PropertyGroup>
11 <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12 </PropertyGroup>
13</Project>
diff --git a/src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.targets b/src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.targets
deleted file mode 100644
index 3d28ed57..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.targets
+++ /dev/null
@@ -1,54 +0,0 @@
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<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <ItemGroup>
6 <Reference Include="System" />
7 <Reference Include="System.Core" />
8 </ItemGroup>
9
10 <!-- Include these references only when not referenced by the WixBuildTools.TestSupport.Native.vcxproj -->
11 <ItemGroup Condition="'$(MSBuildProjectName)'!='$(MSBuildThisFileName)'">
12 <Reference Include="WixBuildTools.TestSupport">
13 <HintPath>$(RootBuildFolder)internal\$(Configuration)\$(PlatformTarget)\WixBuildTools.TestSupport.dll</HintPath>
14 </Reference>
15 <Reference Include="WixBuildTools.TestSupport.Native">
16 <HintPath>$(RootBuildFolder)internal\$(Configuration)\$(PlatformTarget)\WixBuildTools.TestSupport.Native.dll</HintPath>
17 </Reference>
18 </ItemGroup>
19
20 <ItemGroup>
21 <Reference Include="xunit.abstractions">
22 <HintPath>$(RootPackagesFolder)xunit.abstractions.2.0.3\lib\netstandard2.0\xunit.abstractions.dll</HintPath>
23 </Reference>
24 <Reference Include="xunit.assert">
25 <HintPath>$(RootPackagesFolder)xunit.assert.2.4.2\lib\netstandard1.1\xunit.assert.dll</HintPath>
26 </Reference>
27 <Reference Include="xunit.core">
28 <HintPath>$(RootPackagesFolder)xunit.extensibility.core.2.4.2\lib\netstandard1.1\xunit.core.dll</HintPath>
29 </Reference>
30 <Reference Include="xunit.execution.desktop">
31 <HintPath>$(RootPackagesFolder)xunit.extensibility.execution.2.4.2\lib\net452\xunit.execution.desktop.dll</HintPath>
32 </Reference>
33 </ItemGroup>
34
35 <Import Project="$(RootPackagesFolder)GitInfo.2.2.0\build\GitInfo.targets" Condition="Exists('$(RootPackagesFolder)GitInfo.2.2.0\build\GitInfo.targets')" />
36 <Import Project="$(RootPackagesFolder)xunit.core.2.4.2\build\xunit.core.targets" Condition="Exists('$(RootPackagesFolder)xunit.core.2.4.2\build\xunit.core.targets')" />
37 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
38 <PropertyGroup>
39 <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>
40 </PropertyGroup>
41 <Error Condition="!Exists('$(RootPackagesFolder)GitInfo.2.2.0\build\GitInfo.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(RootPackagesFolder)GitInfo.2.2.0\build\GitInfo.targets'))" />
42 <Error Condition="!Exists('$(RootPackagesFolder)xunit.core.2.4.2\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '$(RootPackagesFolder)xunit.core.2.4.2\build\xunit.core.props'))" />
43 <Error Condition="!Exists('$(RootPackagesFolder)xunit.core.2.4.2\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(RootPackagesFolder)xunit.core.2.4.2\build\xunit.core.targets'))" />
44 <Error Condition="!Exists('$(RootPackagesFolder)xunit.runner.visualstudio.2.4.5\build\net462\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '$(RootPackagesFolder)xunit.runner.visualstudio.2.4.5\build\net462\xunit.runner.visualstudio.props'))" />
45 </Target>
46
47 <UsingTask AssemblyFile="$(RootPackagesFolder)xunit.runner.msbuild.2.4.2\build\net452\xunit.runner.msbuild.net452.dll" TaskName="Xunit.Runner.MSBuild.xunit" Architecture="x86" Condition=" '$(Platform)'!='x64' " />
48 <UsingTask AssemblyFile="$(RootPackagesFolder)xunit.runner.msbuild.2.4.2\build\net452\xunit.runner.msbuild.net452.dll" TaskName="Xunit.Runner.MSBuild.xunit" Architecture="x64" Condition=" '$(Platform)'=='x64' " />
49 <Target Name="Test">
50 <!-- https://xunit.net/docs/running-tests-in-msbuild -->
51 <!-- https://github.com/xunit/xunit/issues/2188 -->
52 <xunit Assemblies="$(TargetPath)" Xml="$(CppCliTestResultsFile)" />
53 </Target>
54</Project>
diff --git a/src/internal/WixBuildTools.TestSupport.Native/packages.config b/src/internal/WixBuildTools.TestSupport.Native/packages.config
deleted file mode 100644
index 060bff6b..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/packages.config
+++ /dev/null
@@ -1,17 +0,0 @@
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<packages>
5 <!--
6 Update build\WixBuildTools.TestSupport.native.props and build\WixBuildTools.TestSupport.native.targets
7 when any of these versions are updated.
8 -->
9 <package id="GitInfo" version="2.2.0" />
10 <package id="xunit.abstractions" version="2.0.3" />
11 <package id="xunit.assert" version="2.4.2" />
12 <package id="xunit.core" version="2.4.2" />
13 <package id="xunit.extensibility.core" version="2.4.2" />
14 <package id="xunit.extensibility.execution" version="2.4.2" />
15 <package id="xunit.runner.msbuild" version="2.4.2" />
16 <package id="xunit.runner.visualstudio" version="2.4.5" />
17</packages>
diff --git a/src/internal/WixBuildTools.TestSupport.Native/precomp.cpp b/src/internal/WixBuildTools.TestSupport.Native/precomp.cpp
deleted file mode 100644
index 37664a1c..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/precomp.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
1// 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.
2
3#include "precomp.h"
diff --git a/src/internal/WixBuildTools.TestSupport.Native/precomp.h b/src/internal/WixBuildTools.TestSupport.Native/precomp.h
deleted file mode 100644
index f54b55be..00000000
--- a/src/internal/WixBuildTools.TestSupport.Native/precomp.h
+++ /dev/null
@@ -1,11 +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#include <windows.h>
6#include <strsafe.h>
7
8#include "NativeAssert.h"
9
10#pragma managed
11#include <vcclr.h>