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 | |
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.
-rw-r--r-- | balutil.sln | 24 | ||||
-rw-r--r-- | nuget.config | 1 | ||||
-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 |
15 files changed, 433 insertions, 0 deletions
diff --git a/balutil.sln b/balutil.sln index 9bca316a..5d1923e1 100644 --- a/balutil.sln +++ b/balutil.sln | |||
@@ -13,6 +13,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mbanative", "src\mbanative\ | |||
13 | EndProject | 13 | EndProject |
14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Mba.Core", "src\test\WixToolsetTest.Mba.Core\WixToolsetTest.Mba.Core.csproj", "{F54997F7-10D7-409B-B9F2-DB546490EDC0}" | 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Mba.Core", "src\test\WixToolsetTest.Mba.Core\WixToolsetTest.Mba.Core.csproj", "{F54997F7-10D7-409B-B9F2-DB546490EDC0}" |
15 | EndProject | 15 | EndProject |
16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BalUtilUnitTest", "src\test\BalUtilUnitTest\BalUtilUnitTest.vcxproj", "{9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}" | ||
17 | EndProject | ||
18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BextUtilUnitTest", "src\test\BextUtilUnitTest\BextUtilUnitTest.vcxproj", "{B69E6422-49B0-4E28-92F9-B8A7410A6ED9}" | ||
19 | EndProject | ||
16 | Global | 20 | Global |
17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | 21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
18 | Debug|ARM = Debug|ARM | 22 | Debug|ARM = Debug|ARM |
@@ -105,6 +109,26 @@ Global | |||
105 | {F54997F7-10D7-409B-B9F2-DB546490EDC0}.Release|x64.Build.0 = Release|Any CPU | 109 | {F54997F7-10D7-409B-B9F2-DB546490EDC0}.Release|x64.Build.0 = Release|Any CPU |
106 | {F54997F7-10D7-409B-B9F2-DB546490EDC0}.Release|x86.ActiveCfg = Release|Any CPU | 110 | {F54997F7-10D7-409B-B9F2-DB546490EDC0}.Release|x86.ActiveCfg = Release|Any CPU |
107 | {F54997F7-10D7-409B-B9F2-DB546490EDC0}.Release|x86.Build.0 = Release|Any CPU | 111 | {F54997F7-10D7-409B-B9F2-DB546490EDC0}.Release|x86.Build.0 = Release|Any CPU |
112 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Debug|ARM.ActiveCfg = Debug|Win32 | ||
113 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Debug|ARM64.ActiveCfg = Debug|Win32 | ||
114 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Debug|x64.ActiveCfg = Debug|Win32 | ||
115 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Debug|x86.ActiveCfg = Debug|Win32 | ||
116 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Debug|x86.Build.0 = Debug|Win32 | ||
117 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Release|ARM.ActiveCfg = Release|Win32 | ||
118 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Release|ARM64.ActiveCfg = Release|Win32 | ||
119 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Release|x64.ActiveCfg = Release|Win32 | ||
120 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Release|x86.ActiveCfg = Release|Win32 | ||
121 | {9B507AF9-035E-4DB6-8C0C-5DCC3FEF2631}.Release|x86.Build.0 = Release|Win32 | ||
122 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Debug|ARM.ActiveCfg = Debug|Win32 | ||
123 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Debug|ARM64.ActiveCfg = Debug|Win32 | ||
124 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Debug|x64.ActiveCfg = Debug|Win32 | ||
125 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Debug|x86.ActiveCfg = Debug|Win32 | ||
126 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Debug|x86.Build.0 = Debug|Win32 | ||
127 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Release|ARM.ActiveCfg = Release|Win32 | ||
128 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Release|ARM64.ActiveCfg = Release|Win32 | ||
129 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Release|x64.ActiveCfg = Release|Win32 | ||
130 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Release|x86.ActiveCfg = Release|Win32 | ||
131 | {B69E6422-49B0-4E28-92F9-B8A7410A6ED9}.Release|x86.Build.0 = Release|Win32 | ||
108 | EndGlobalSection | 132 | EndGlobalSection |
109 | GlobalSection(SolutionProperties) = preSolution | 133 | GlobalSection(SolutionProperties) = preSolution |
110 | HideSolutionNode = FALSE | 134 | HideSolutionNode = FALSE |
diff --git a/nuget.config b/nuget.config index 0a24a6a3..2c6c5608 100644 --- a/nuget.config +++ b/nuget.config | |||
@@ -2,6 +2,7 @@ | |||
2 | <configuration> | 2 | <configuration> |
3 | <packageSources> | 3 | <packageSources> |
4 | <clear /> | 4 | <clear /> |
5 | <add key="wixbuildtools" value="https://ci.appveyor.com/nuget/wixbuildtools" /> | ||
5 | <add key="wixtoolset-burn" value="https://ci.appveyor.com/nuget/wixtoolset-burn" /> | 6 | <add key="wixtoolset-burn" value="https://ci.appveyor.com/nuget/wixtoolset-burn" /> |
6 | <add key="wixtoolset-dutil" value="https://ci.appveyor.com/nuget/wixtoolset-dutil" /> | 7 | <add key="wixtoolset-dutil" value="https://ci.appveyor.com/nuget/wixtoolset-dutil" /> |
7 | <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | 8 | <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> |
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> | ||