diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-12-02 20:11:21 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-12-03 10:58:32 -0600 |
| commit | 27766738dc62ec95f89af347eebb1723a5943848 (patch) | |
| tree | a113cf0cf3872fbbd752999fb8868ffce39e6f55 /src | |
| parent | e08c0fc700edd3fe31d3a3778c26cac9f0304de4 (diff) | |
| download | wix-27766738dc62ec95f89af347eebb1723a5943848.tar.gz wix-27766738dc62ec95f89af347eebb1723a5943848.tar.bz2 wix-27766738dc62ec95f89af347eebb1723a5943848.zip | |
Add test projects for balutil and bextutil.
For now, they only have test implementations to check for compile errors in header only code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj | 73 | ||||
| -rw-r--r-- | src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj.filters | 33 | ||||
| -rw-r--r-- | src/test/BalUtilUnitTest/TestBAFunctions.cpp | 41 | ||||
| -rw-r--r-- | src/test/BalUtilUnitTest/TestBootstrapperApplication.cpp | 39 | ||||
| -rw-r--r-- | src/test/BalUtilUnitTest/packages.config | 15 | ||||
| -rw-r--r-- | src/test/BalUtilUnitTest/precomp.cpp | 3 | ||||
| -rw-r--r-- | src/test/BalUtilUnitTest/precomp.h | 23 | ||||
| -rw-r--r-- | src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj | 72 | ||||
| -rw-r--r-- | src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj.filters | 30 | ||||
| -rw-r--r-- | src/test/BextUtilUnitTest/TestBundleExtension.cpp | 42 | ||||
| -rw-r--r-- | src/test/BextUtilUnitTest/packages.config | 15 | ||||
| -rw-r--r-- | src/test/BextUtilUnitTest/precomp.cpp | 3 | ||||
| -rw-r--r-- | src/test/BextUtilUnitTest/precomp.h | 19 |
13 files changed, 408 insertions, 0 deletions
diff --git a/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj b/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj new file mode 100644 index 00000000..53d14cd7 --- /dev/null +++ b/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj | |||
| @@ -0,0 +1,73 @@ | |||
| 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 | |||
| 5 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| 6 | <Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" /> | ||
| 7 | <Import Project="..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.38\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.38\build\WixToolset.BootstrapperCore.Native.props')" /> | ||
| 8 | <Import Project="..\..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" /> | ||
| 9 | <ItemGroup Label="ProjectConfigurations"> | ||
| 10 | <ProjectConfiguration Include="Debug|Win32"> | ||
| 11 | <Configuration>Debug</Configuration> | ||
| 12 | <Platform>Win32</Platform> | ||
| 13 | </ProjectConfiguration> | ||
| 14 | <ProjectConfiguration Include="Release|Win32"> | ||
| 15 | <Configuration>Release</Configuration> | ||
| 16 | <Platform>Win32</Platform> | ||
| 17 | </ProjectConfiguration> | ||
| 18 | </ItemGroup> | ||
| 19 | <PropertyGroup Label="Globals"> | ||
| 20 | <ProjectTypes>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}</ProjectTypes> | ||
| 21 | <ProjectGuid>{9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}</ProjectGuid> | ||
| 22 | <RootNamespace>UnitTest</RootNamespace> | ||
| 23 | <Keyword>ManagedCProj</Keyword> | ||
| 24 | <ConfigurationType>DynamicLibrary</ConfigurationType> | ||
| 25 | <CharacterSet>Unicode</CharacterSet> | ||
| 26 | <CLRSupport>true</CLRSupport> | ||
| 27 | </PropertyGroup> | ||
| 28 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
| 29 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
| 30 | <PropertyGroup> | ||
| 31 | <ProjectAdditionalIncludeDirectories>..\..\balutil\inc</ProjectAdditionalIncludeDirectories> | ||
| 32 | <ProjectAdditionalLinkLibraries>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib</ProjectAdditionalLinkLibraries> | ||
| 33 | </PropertyGroup> | ||
| 34 | <ItemGroup> | ||
| 35 | <ClCompile Include="precomp.cpp"> | ||
| 36 | <PrecompiledHeader>Create</PrecompiledHeader> | ||
| 37 | <!-- Warnings from referencing netstandard dlls --> | ||
| 38 | <DisableSpecificWarnings>4564;4691</DisableSpecificWarnings> | ||
| 39 | </ClCompile> | ||
| 40 | <ClCompile Include="TestBAFunctions.cpp" /> | ||
| 41 | <ClCompile Include="TestBootstrapperApplication.cpp" /> | ||
| 42 | </ItemGroup> | ||
| 43 | <ItemGroup> | ||
| 44 | <ClInclude Include="precomp.h" /> | ||
| 45 | </ItemGroup> | ||
| 46 | <ItemGroup> | ||
| 47 | <None Include="packages.config" /> | ||
| 48 | </ItemGroup> | ||
| 49 | <ItemGroup> | ||
| 50 | <Reference Include="System" /> | ||
| 51 | <Reference Include="System.Core" /> | ||
| 52 | <Reference Include="WixBuildTools.TestSupport"> | ||
| 53 | <HintPath>..\..\..\packages\WixBuildTools.TestSupport.4.0.47\lib\net472\WixBuildTools.TestSupport.dll</HintPath> | ||
| 54 | </Reference> | ||
| 55 | <Reference Include="WixBuildTools.TestSupport.Native"> | ||
| 56 | <HintPath>..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\lib\net472\WixBuildTools.TestSupport.Native.dll</HintPath> | ||
| 57 | </Reference> | ||
| 58 | </ItemGroup> | ||
| 59 | <ItemGroup> | ||
| 60 | <ProjectReference Include="..\..\balutil\balutil.vcxproj" /> | ||
| 61 | </ItemGroup> | ||
| 62 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
| 63 | <Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets')" /> | ||
| 64 | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
| 65 | <PropertyGroup> | ||
| 66 | <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> | ||
| 67 | </PropertyGroup> | ||
| 68 | <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props'))" /> | ||
| 69 | <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets'))" /> | ||
| 70 | <Error Condition="!Exists('..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.38\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.38\build\WixToolset.BootstrapperCore.Native.props'))" /> | ||
| 71 | <Error Condition="!Exists('..\..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props'))" /> | ||
| 72 | </Target> | ||
| 73 | </Project> | ||
diff --git a/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj.filters b/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj.filters new file mode 100644 index 00000000..85f31076 --- /dev/null +++ b/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj.filters | |||
| @@ -0,0 +1,33 @@ | |||
| 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;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</Extensions> | ||
| 15 | </Filter> | ||
| 16 | </ItemGroup> | ||
| 17 | <ItemGroup> | ||
| 18 | <ClCompile Include="precomp.cpp"> | ||
| 19 | <Filter>Source Files</Filter> | ||
| 20 | </ClCompile> | ||
| 21 | <ClCompile Include="TestBAFunctions.cpp"> | ||
| 22 | <Filter>Source Files</Filter> | ||
| 23 | </ClCompile> | ||
| 24 | <ClCompile Include="TestBootstrapperApplication.cpp"> | ||
| 25 | <Filter>Source Files</Filter> | ||
| 26 | </ClCompile> | ||
| 27 | </ItemGroup> | ||
| 28 | <ItemGroup> | ||
| 29 | <ClInclude Include="precomp.h"> | ||
| 30 | <Filter>Header Files</Filter> | ||
| 31 | </ClInclude> | ||
| 32 | </ItemGroup> | ||
| 33 | </Project> \ No newline at end of file | ||
diff --git a/src/test/BalUtilUnitTest/TestBAFunctions.cpp b/src/test/BalUtilUnitTest/TestBAFunctions.cpp new file mode 100644 index 00000000..927a8d10 --- /dev/null +++ b/src/test/BalUtilUnitTest/TestBAFunctions.cpp | |||
| @@ -0,0 +1,41 @@ | |||
| 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 | #include "BalBaseBAFunctions.h" | ||
| 5 | #include "BalBaseBAFunctionsProc.h" | ||
| 6 | |||
| 7 | class CTestBAFunctions : public CBalBaseBAFunctions | ||
| 8 | { | ||
| 9 | public: | ||
| 10 | CTestBAFunctions( | ||
| 11 | __in HMODULE hModule, | ||
| 12 | __in IBootstrapperEngine* pEngine, | ||
| 13 | __in const BA_FUNCTIONS_CREATE_ARGS* pArgs | ||
| 14 | ) : CBalBaseBAFunctions(hModule, pEngine, pArgs) | ||
| 15 | { | ||
| 16 | } | ||
| 17 | }; | ||
| 18 | |||
| 19 | HRESULT CreateBAFunctions( | ||
| 20 | __in HMODULE hModule, | ||
| 21 | __in IBootstrapperEngine* pEngine, | ||
| 22 | __in const BA_FUNCTIONS_CREATE_ARGS* pArgs, | ||
| 23 | __in BA_FUNCTIONS_CREATE_RESULTS* pResults, | ||
| 24 | __out IBAFunctions** ppApplication | ||
| 25 | ) | ||
| 26 | { | ||
| 27 | HRESULT hr = S_OK; | ||
| 28 | CTestBAFunctions* pApplication = NULL; | ||
| 29 | |||
| 30 | pApplication = new CTestBAFunctions(hModule, pEngine, pArgs); | ||
| 31 | ExitOnNull(pApplication, hr, E_OUTOFMEMORY, "Failed to create new test bafunctions object."); | ||
| 32 | |||
| 33 | pResults->pfnBAFunctionsProc = BalBaseBAFunctionsProc; | ||
| 34 | pResults->pvBAFunctionsProcContext = pApplication; | ||
| 35 | *ppApplication = pApplication; | ||
| 36 | pApplication = NULL; | ||
| 37 | |||
| 38 | LExit: | ||
| 39 | ReleaseObject(pApplication); | ||
| 40 | return hr; | ||
| 41 | } | ||
diff --git a/src/test/BalUtilUnitTest/TestBootstrapperApplication.cpp b/src/test/BalUtilUnitTest/TestBootstrapperApplication.cpp new file mode 100644 index 00000000..13d22e72 --- /dev/null +++ b/src/test/BalUtilUnitTest/TestBootstrapperApplication.cpp | |||
| @@ -0,0 +1,39 @@ | |||
| 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 | #include "BalBaseBootstrapperApplication.h" | ||
| 5 | #include "BalBaseBootstrapperApplicationProc.h" | ||
| 6 | |||
| 7 | class CTestBootstrapperApplication : public CBalBaseBootstrapperApplication | ||
| 8 | { | ||
| 9 | public: | ||
| 10 | CTestBootstrapperApplication( | ||
| 11 | __in IBootstrapperEngine* pEngine, | ||
| 12 | __in const BOOTSTRAPPER_CREATE_ARGS* pArgs | ||
| 13 | ) : CBalBaseBootstrapperApplication(pEngine, pArgs) | ||
| 14 | { | ||
| 15 | } | ||
| 16 | }; | ||
| 17 | |||
| 18 | HRESULT CreateBootstrapperApplication( | ||
| 19 | __in IBootstrapperEngine* pEngine, | ||
| 20 | __in const BOOTSTRAPPER_CREATE_ARGS* pArgs, | ||
| 21 | __inout BOOTSTRAPPER_CREATE_RESULTS* pResults, | ||
| 22 | __out IBootstrapperApplication** ppApplication | ||
| 23 | ) | ||
| 24 | { | ||
| 25 | HRESULT hr = S_OK; | ||
| 26 | CTestBootstrapperApplication* pApplication = NULL; | ||
| 27 | |||
| 28 | pApplication = new CTestBootstrapperApplication(pEngine, pArgs); | ||
| 29 | ExitOnNull(pApplication, hr, E_OUTOFMEMORY, "Failed to create new test bootstrapper application object."); | ||
| 30 | |||
| 31 | pResults->pfnBootstrapperApplicationProc = BalBaseBootstrapperApplicationProc; | ||
| 32 | pResults->pvBootstrapperApplicationProcContext = pApplication; | ||
| 33 | *ppApplication = pApplication; | ||
| 34 | pApplication = NULL; | ||
| 35 | |||
| 36 | LExit: | ||
| 37 | ReleaseObject(pApplication); | ||
| 38 | return hr; | ||
| 39 | } | ||
diff --git a/src/test/BalUtilUnitTest/packages.config b/src/test/BalUtilUnitTest/packages.config new file mode 100644 index 00000000..b8423837 --- /dev/null +++ b/src/test/BalUtilUnitTest/packages.config | |||
| @@ -0,0 +1,15 @@ | |||
| 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 | <packages> | ||
| 4 | <package id="xunit.abstractions" version="2.0.3" /> | ||
| 5 | <package id="xunit.assert" version="2.4.1" /> | ||
| 6 | <package id="xunit.core" version="2.4.1" /> | ||
| 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.msbuild" version="2.4.1" /> | ||
| 10 | <package id="xunit.runner.visualstudio" version="2.4.1" /> | ||
| 11 | <package id="WixBuildTools.TestSupport" version="4.0.47" /> | ||
| 12 | <package id="WixBuildTools.TestSupport.Native" version="4.0.47" /> | ||
| 13 | <package id="WixToolset.BootstrapperCore.Native" version="4.0.38" targetFramework="native" /> | ||
| 14 | <package id="WixToolset.DUtil" version="4.0.55" targetFramework="native" /> | ||
| 15 | </packages> \ No newline at end of file | ||
diff --git a/src/test/BalUtilUnitTest/precomp.cpp b/src/test/BalUtilUnitTest/precomp.cpp new file mode 100644 index 00000000..37664a1c --- /dev/null +++ b/src/test/BalUtilUnitTest/precomp.cpp | |||
| @@ -0,0 +1,3 @@ | |||
| 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/test/BalUtilUnitTest/precomp.h b/src/test/BalUtilUnitTest/precomp.h new file mode 100644 index 00000000..a84391f9 --- /dev/null +++ b/src/test/BalUtilUnitTest/precomp.h | |||
| @@ -0,0 +1,23 @@ | |||
| 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 <msiquery.h> | ||
| 7 | #include <CommCtrl.h> | ||
| 8 | |||
| 9 | #include <dutil.h> | ||
| 10 | #include <locutil.h> | ||
| 11 | #include <thmutil.h> | ||
| 12 | |||
| 13 | #include <BootstrapperEngine.h> | ||
| 14 | #include <BootstrapperApplication.h> | ||
| 15 | |||
| 16 | #include "IBootstrapperEngine.h" | ||
| 17 | #include "IBootstrapperApplication.h" | ||
| 18 | #include "balutil.h" | ||
| 19 | #include "balretry.h" | ||
| 20 | #include "BAFunctions.h" | ||
| 21 | |||
| 22 | #pragma managed | ||
| 23 | #include <vcclr.h> | ||
diff --git a/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj b/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj new file mode 100644 index 00000000..15a1f51d --- /dev/null +++ b/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj | |||
| @@ -0,0 +1,72 @@ | |||
| 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 | |||
| 5 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| 6 | <Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" /> | ||
| 7 | <Import Project="..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.38\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.38\build\WixToolset.BootstrapperCore.Native.props')" /> | ||
| 8 | <Import Project="..\..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" /> | ||
| 9 | <ItemGroup Label="ProjectConfigurations"> | ||
| 10 | <ProjectConfiguration Include="Debug|Win32"> | ||
| 11 | <Configuration>Debug</Configuration> | ||
| 12 | <Platform>Win32</Platform> | ||
| 13 | </ProjectConfiguration> | ||
| 14 | <ProjectConfiguration Include="Release|Win32"> | ||
| 15 | <Configuration>Release</Configuration> | ||
| 16 | <Platform>Win32</Platform> | ||
| 17 | </ProjectConfiguration> | ||
| 18 | </ItemGroup> | ||
| 19 | <PropertyGroup Label="Globals"> | ||
| 20 | <ProjectTypes>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}</ProjectTypes> | ||
| 21 | <ProjectGuid>{B69E6422-49B0-4E28-92F9-B8A7410A6ED9}</ProjectGuid> | ||
| 22 | <RootNamespace>UnitTest</RootNamespace> | ||
| 23 | <Keyword>ManagedCProj</Keyword> | ||
| 24 | <ConfigurationType>DynamicLibrary</ConfigurationType> | ||
| 25 | <CharacterSet>Unicode</CharacterSet> | ||
| 26 | <CLRSupport>true</CLRSupport> | ||
| 27 | </PropertyGroup> | ||
| 28 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
| 29 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
| 30 | <PropertyGroup> | ||
| 31 | <ProjectAdditionalIncludeDirectories>..\..\bextutil\inc</ProjectAdditionalIncludeDirectories> | ||
| 32 | <ProjectAdditionalLinkLibraries></ProjectAdditionalLinkLibraries> | ||
| 33 | </PropertyGroup> | ||
| 34 | <ItemGroup> | ||
| 35 | <ClCompile Include="precomp.cpp"> | ||
| 36 | <PrecompiledHeader>Create</PrecompiledHeader> | ||
| 37 | <!-- Warnings from referencing netstandard dlls --> | ||
| 38 | <DisableSpecificWarnings>4564;4691</DisableSpecificWarnings> | ||
| 39 | </ClCompile> | ||
| 40 | <ClCompile Include="TestBundleExtension.cpp" /> | ||
| 41 | </ItemGroup> | ||
| 42 | <ItemGroup> | ||
| 43 | <ClInclude Include="precomp.h" /> | ||
| 44 | </ItemGroup> | ||
| 45 | <ItemGroup> | ||
| 46 | <None Include="packages.config" /> | ||
| 47 | </ItemGroup> | ||
| 48 | <ItemGroup> | ||
| 49 | <Reference Include="System" /> | ||
| 50 | <Reference Include="System.Core" /> | ||
| 51 | <Reference Include="WixBuildTools.TestSupport"> | ||
| 52 | <HintPath>..\..\..\packages\WixBuildTools.TestSupport.4.0.47\lib\net472\WixBuildTools.TestSupport.dll</HintPath> | ||
| 53 | </Reference> | ||
| 54 | <Reference Include="WixBuildTools.TestSupport.Native"> | ||
| 55 | <HintPath>..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\lib\net472\WixBuildTools.TestSupport.Native.dll</HintPath> | ||
| 56 | </Reference> | ||
| 57 | </ItemGroup> | ||
| 58 | <ItemGroup> | ||
| 59 | <ProjectReference Include="..\..\balutil\balutil.vcxproj" /> | ||
| 60 | </ItemGroup> | ||
| 61 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
| 62 | <Import Project="..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets" Condition="Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets')" /> | ||
| 63 | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
| 64 | <PropertyGroup> | ||
| 65 | <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> | ||
| 66 | </PropertyGroup> | ||
| 67 | <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.props'))" /> | ||
| 68 | <Error Condition="!Exists('..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixBuildTools.TestSupport.Native.4.0.47\build\WixBuildTools.TestSupport.Native.targets'))" /> | ||
| 69 | <Error Condition="!Exists('..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.38\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.38\build\WixToolset.BootstrapperCore.Native.props'))" /> | ||
| 70 | <Error Condition="!Exists('..\..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.DUtil.4.0.55\build\WixToolset.DUtil.props'))" /> | ||
| 71 | </Target> | ||
| 72 | </Project> | ||
diff --git a/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj.filters b/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj.filters new file mode 100644 index 00000000..f1711f81 --- /dev/null +++ b/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj.filters | |||
| @@ -0,0 +1,30 @@ | |||
| 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;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</Extensions> | ||
| 15 | </Filter> | ||
| 16 | </ItemGroup> | ||
| 17 | <ItemGroup> | ||
| 18 | <ClCompile Include="precomp.cpp"> | ||
| 19 | <Filter>Source Files</Filter> | ||
| 20 | </ClCompile> | ||
| 21 | <ClCompile Include="TestBundleExtension.cpp"> | ||
| 22 | <Filter>Source Files</Filter> | ||
| 23 | </ClCompile> | ||
| 24 | </ItemGroup> | ||
| 25 | <ItemGroup> | ||
| 26 | <ClInclude Include="precomp.h"> | ||
| 27 | <Filter>Header Files</Filter> | ||
| 28 | </ClInclude> | ||
| 29 | </ItemGroup> | ||
| 30 | </Project> \ No newline at end of file | ||
diff --git a/src/test/BextUtilUnitTest/TestBundleExtension.cpp b/src/test/BextUtilUnitTest/TestBundleExtension.cpp new file mode 100644 index 00000000..921303bb --- /dev/null +++ b/src/test/BextUtilUnitTest/TestBundleExtension.cpp | |||
| @@ -0,0 +1,42 @@ | |||
| 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 | #include "BextBaseBundleExtension.h" | ||
| 5 | #include "BextBaseBundleExtensionProc.h" | ||
| 6 | |||
| 7 | class CTestBundleExtension : public CBextBaseBundleExtension | ||
| 8 | { | ||
| 9 | public: | ||
| 10 | CTestBundleExtension( | ||
| 11 | __in IBundleExtensionEngine* pEngine | ||
| 12 | ) : CBextBaseBundleExtension(pEngine) | ||
| 13 | { | ||
| 14 | } | ||
| 15 | }; | ||
| 16 | |||
| 17 | HRESULT TestBundleExtensionCreate( | ||
| 18 | __in IBundleExtensionEngine* pEngine, | ||
| 19 | __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs, | ||
| 20 | __inout BUNDLE_EXTENSION_CREATE_RESULTS* pResults, | ||
| 21 | __out IBundleExtension** ppBundleExtension | ||
| 22 | ) | ||
| 23 | { | ||
| 24 | HRESULT hr = S_OK; | ||
| 25 | CTestBundleExtension* pExtension = NULL; | ||
| 26 | |||
| 27 | pExtension = new CTestBundleExtension(pEngine); | ||
| 28 | ExitOnNull(pExtension, hr, E_OUTOFMEMORY, "Failed to create new CTestBundleExtension."); | ||
| 29 | |||
| 30 | hr = pExtension->Initialize(pArgs); | ||
| 31 | ExitOnFailure(hr, "CTestBundleExtension initialization failed"); | ||
| 32 | |||
| 33 | pResults->pfnBundleExtensionProc = BextBaseBundleExtensionProc; | ||
| 34 | pResults->pvBundleExtensionProcContext = pExtension; | ||
| 35 | |||
| 36 | *ppBundleExtension = pExtension; | ||
| 37 | pExtension = NULL; | ||
| 38 | |||
| 39 | LExit: | ||
| 40 | ReleaseObject(pExtension); | ||
| 41 | return hr; | ||
| 42 | } | ||
diff --git a/src/test/BextUtilUnitTest/packages.config b/src/test/BextUtilUnitTest/packages.config new file mode 100644 index 00000000..b8423837 --- /dev/null +++ b/src/test/BextUtilUnitTest/packages.config | |||
| @@ -0,0 +1,15 @@ | |||
| 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 | <packages> | ||
| 4 | <package id="xunit.abstractions" version="2.0.3" /> | ||
| 5 | <package id="xunit.assert" version="2.4.1" /> | ||
| 6 | <package id="xunit.core" version="2.4.1" /> | ||
| 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.msbuild" version="2.4.1" /> | ||
| 10 | <package id="xunit.runner.visualstudio" version="2.4.1" /> | ||
| 11 | <package id="WixBuildTools.TestSupport" version="4.0.47" /> | ||
| 12 | <package id="WixBuildTools.TestSupport.Native" version="4.0.47" /> | ||
| 13 | <package id="WixToolset.BootstrapperCore.Native" version="4.0.38" targetFramework="native" /> | ||
| 14 | <package id="WixToolset.DUtil" version="4.0.55" targetFramework="native" /> | ||
| 15 | </packages> \ No newline at end of file | ||
diff --git a/src/test/BextUtilUnitTest/precomp.cpp b/src/test/BextUtilUnitTest/precomp.cpp new file mode 100644 index 00000000..37664a1c --- /dev/null +++ b/src/test/BextUtilUnitTest/precomp.cpp | |||
| @@ -0,0 +1,3 @@ | |||
| 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/test/BextUtilUnitTest/precomp.h b/src/test/BextUtilUnitTest/precomp.h new file mode 100644 index 00000000..a6586f70 --- /dev/null +++ b/src/test/BextUtilUnitTest/precomp.h | |||
| @@ -0,0 +1,19 @@ | |||
| 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 <msiquery.h> | ||
| 7 | |||
| 8 | #include <dutil.h> | ||
| 9 | #include <strutil.h> | ||
| 10 | |||
| 11 | #include <BundleExtensionEngine.h> | ||
| 12 | #include <BundleExtension.h> | ||
| 13 | |||
| 14 | #include "IBundleExtensionEngine.h" | ||
| 15 | #include "IBundleExtension.h" | ||
| 16 | #include "bextutil.h" | ||
| 17 | |||
| 18 | #pragma managed | ||
| 19 | #include <vcclr.h> | ||
