From c843b47d6233153fa961c6d0e61edf7cedf255bb Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 8 Nov 2022 14:58:05 -0800 Subject: Separate WixInternal content from official WixToolset namespace --- .../burn/test/BalUtilUnitTest/BAFunctionsTests.cpp | 4 +- .../test/BalUtilUnitTest/BalUtilUnitTest.vcxproj | 4 +- .../BootstrapperApplicationTests.cpp | 4 +- .../test/BextUtilUnitTest/BextUtilUnitTest.vcxproj | 4 +- .../test/BextUtilUnitTest/BundleExtensionTests.cpp | 4 +- .../BaseBootstrapperApplicationFactoryFixture.cs | 2 +- .../WixToolsetTest.Mba.Core.csproj | 2 +- .../test/WixToolsetTest.Data/SerializeFixture.cs | 2 +- .../WindowsInstallerTableDefinitionsFixture.cs | 2 +- .../WixToolsetTest.Data/WixToolsetTest.Data.csproj | 2 +- src/burn/test/BurnUnitTest/BurnTestException.h | 2 +- src/burn/test/BurnUnitTest/BurnTestFixture.h | 4 +- src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj | 4 +- src/burn/test/BurnUnitTest/RegistrationTest.cpp | 2 +- src/burn/test/BurnUnitTest/RelatedBundleTest.cpp | 2 +- src/burn/test/BurnUnitTest/TestRegistryFixture.cpp | 2 +- src/burn/test/BurnUnitTest/TestRegistryFixture.h | 2 +- src/clean.cmd | 6 +- .../test/WixToolsetTest.Bal/BalExtensionFixture.cs | 4 +- .../test/WixToolsetTest.Bal/InternalUIBAFixture.cs | 4 +- .../WixToolsetTest.Bal/WixToolsetTest.Bal.csproj | 2 +- .../WixToolsetTest.Dnc.HostGenerator.csproj | 2 +- .../WixToolsetTest.ManagedHost/DncHostFixture.cs | 4 +- .../WixToolsetTest.ManagedHost/MbaHostFixture.cs | 2 +- .../test/WixToolsetTest.ManagedHost/TestEngine.cs | 4 +- .../WixToolsetTest.ManagedHost.csproj | 2 +- .../ComPlusExtensionFixture.cs | 4 +- .../WixToolsetTest.ComPlus.csproj | 2 +- .../DependencyExtensionFixture.cs | 4 +- .../WixToolsetTest.Dependency.csproj | 2 +- .../DifxAppExtensionFixture.cs | 4 +- .../WixToolsetTest.DifxApp.csproj | 2 +- .../DirectXExtensionFixture.cs | 4 +- .../WixToolsetTest.DirectX.csproj | 2 +- .../FirewallExtensionFixture.cs | 4 +- .../WixToolsetTest.Firewall.csproj | 2 +- .../WixToolsetTest.Http/HttpExtensionFixture.cs | 4 +- .../WixToolsetTest.Http/WixToolsetTest.Http.csproj | 2 +- .../test/WixToolsetTest.Iis/IisExtensionFixture.cs | 4 +- .../WixToolsetTest.Iis/WixToolsetTest.Iis.csproj | 2 +- .../WixToolsetTest.Msmq/MsmqExtensionFixture.cs | 4 +- .../WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj | 2 +- .../WixToolsetTest.Netfx/NetfxExtensionFixture.cs | 4 +- .../WixToolsetTest.Netfx.csproj | 2 +- .../PowerShellExtensionFixture.cs | 4 +- .../WixToolsetTest.Powershell.csproj | 2 +- .../test/WixToolsetTest.Sql/SqlExtensionFixture.cs | 4 +- .../WixToolsetTest.Sql/WixToolsetTest.Sql.csproj | 2 +- .../test/WixToolsetTest.UI/UIExtensionFixture.cs | 4 +- .../WixToolsetTest.UI/WixToolsetTest.UI.csproj | 2 +- .../WixToolsetTest.Util/UtilExtensionFixture.cs | 4 +- .../WixToolsetTest.Util/WixToolsetTest.Util.csproj | 2 +- .../VisualStudioExtensionFixture.cs | 4 +- .../WixToolsetTest.VisualStudio.csproj | 2 +- .../SetBuildNumber/Directory.Packages.props.pp | 10 +- .../AssemblyInfo.cpp | 17 - .../NativeAssert.h | 104 ------ .../WixBuildTools.TestSupport.Native.vcxproj | 74 ---- ...ixBuildTools.TestSupport.Native.vcxproj.filters | 33 -- .../build/WixBuildTools.TestSupport.Native.props | 13 - .../build/WixBuildTools.TestSupport.Native.targets | 54 --- .../packages.config | 17 - .../WixBuildTools.TestSupport.Native/precomp.cpp | 3 - .../WixBuildTools.TestSupport.Native/precomp.h | 11 - src/internal/WixBuildTools.TestSupport/Builder.cs | 158 --------- .../DisposableFileSystem.cs | 93 ----- .../WixBuildTools.TestSupport/DotnetRunner.cs | 57 ---- .../ExternalExecutable.cs | 374 --------------------- .../ExternalExecutableResult.cs | 19 -- .../WixBuildTools.TestSupport/FakeBuildEngine.cs | 33 -- .../WixBuildTools.TestSupport/MsbuildRunner.cs | 112 ------ .../MsbuildRunnerResult.cs | 19 -- .../WixBuildTools.TestSupport/MsbuildUtilities.cs | 101 ------ src/internal/WixBuildTools.TestSupport/Pushd.cs | 46 --- src/internal/WixBuildTools.TestSupport/Query.cs | 172 ---------- .../WixBuildTools.TestSupport/RobocopyRunner.cs | 16 - src/internal/WixBuildTools.TestSupport/TestData.cs | 78 ----- .../TestDataFolderFileSystem.cs | 42 --- .../WixBuildTools.TestSupport/VswhereRunner.cs | 41 --- .../WixBuildTools.TestSupport.csproj | 27 -- .../XunitExtensions/SkipTestException.cs | 15 - .../XunitExtensions/SkippableFactAttribute.cs | 13 - .../XunitExtensions/SkippableFactDiscoverer.cs | 23 -- .../XunitExtensions/SkippableFactMessageBus.cs | 40 --- .../XunitExtensions/SkippableFactTestCase.cs | 40 --- .../XunitExtensions/SkippableTheoryAttribute.cs | 12 - .../XunitExtensions/SkippableTheoryDiscoverer.cs | 41 --- .../XunitExtensions/SkippableTheoryTestCase.cs | 41 --- .../XunitExtensions/SpecificReturnCodeException.cs | 20 -- .../XunitExtensions/SucceededException.cs | 19 -- .../XunitExtensions/WixAssert.cs | 201 ----------- .../BaseToolsetTask.cs | 178 ++++++++++ .../WixCommandLineBuilder.cs | 104 ++++++ .../WixInternal.BaseBuildTasks.Sources.csproj | 36 ++ .../AssemblyInfo.cpp | 17 + .../WixInternal.TestSupport.Native/NativeAssert.h | 104 ++++++ .../WixInternal.TestSupport.Native.vcxproj | 74 ++++ .../WixInternal.TestSupport.Native.vcxproj.filters | 33 ++ .../build/WixInternal.TestSupport.Native.props | 13 + .../build/WixInternal.TestSupport.Native.targets | 54 +++ .../WixInternal.TestSupport.Native/packages.config | 17 + .../WixInternal.TestSupport.Native/precomp.cpp | 3 + .../WixInternal.TestSupport.Native/precomp.h | 11 + src/internal/WixInternal.TestSupport/Builder.cs | 158 +++++++++ .../DisposableFileSystem.cs | 93 +++++ .../WixInternal.TestSupport/DotnetRunner.cs | 57 ++++ .../WixInternal.TestSupport/ExternalExecutable.cs | 374 +++++++++++++++++++++ .../ExternalExecutableResult.cs | 19 ++ .../WixInternal.TestSupport/FakeBuildEngine.cs | 33 ++ .../WixInternal.TestSupport/MsbuildRunner.cs | 112 ++++++ .../WixInternal.TestSupport/MsbuildRunnerResult.cs | 19 ++ .../WixInternal.TestSupport/MsbuildUtilities.cs | 101 ++++++ src/internal/WixInternal.TestSupport/Pushd.cs | 46 +++ src/internal/WixInternal.TestSupport/Query.cs | 172 ++++++++++ .../WixInternal.TestSupport/RobocopyRunner.cs | 16 + src/internal/WixInternal.TestSupport/TestData.cs | 78 +++++ .../TestDataFolderFileSystem.cs | 42 +++ .../WixInternal.TestSupport/VswhereRunner.cs | 41 +++ .../WixInternal.TestSupport.csproj | 27 ++ .../XunitExtensions/SkipTestException.cs | 15 + .../XunitExtensions/SkippableFactAttribute.cs | 13 + .../XunitExtensions/SkippableFactDiscoverer.cs | 23 ++ .../XunitExtensions/SkippableFactMessageBus.cs | 40 +++ .../XunitExtensions/SkippableFactTestCase.cs | 40 +++ .../XunitExtensions/SkippableTheoryAttribute.cs | 12 + .../XunitExtensions/SkippableTheoryDiscoverer.cs | 41 +++ .../XunitExtensions/SkippableTheoryTestCase.cs | 41 +++ .../XunitExtensions/SpecificReturnCodeException.cs | 20 ++ .../XunitExtensions/SucceededException.cs | 19 ++ .../XunitExtensions/WixAssert.cs | 201 +++++++++++ .../BaseToolsetTask.cs | 178 ---------- .../WixCommandLineBuilder.cs | 104 ------ .../WixToolset.BaseBuildTasks.Sources.csproj | 36 -- src/internal/internal.cmd | 12 +- src/internal/internal.sln | 6 +- src/internal/internal_t.proj | 8 +- src/libs/dutil/test/DUtilUnitTest/AppUtilTests.cpp | 2 +- .../dutil/test/DUtilUnitTest/ApupUtilTests.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp | 4 +- .../dutil/test/DUtilUnitTest/DUtilUnitTest.vcxproj | 4 +- src/libs/dutil/test/DUtilUnitTest/DictUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/DirUtilTests.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/EnvUtilTests.cpp | 4 +- src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/GuidUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/IniUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/LocUtilTests.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/MonUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/ProcUtilTest.cpp | 4 +- src/libs/dutil/test/DUtilUnitTest/RegUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/StrUtilTest.cpp | 2 +- src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp | 2 +- .../WixToolsetTest.Versioning.csproj | 2 +- src/test/burn/WixTestTools/BundleVerifier.cs | 2 +- src/test/burn/WixTestTools/MSIExec.cs | 2 +- src/test/burn/WixTestTools/RuntimeFactAttribute.cs | 2 +- src/test/burn/WixTestTools/TestTool.cs | 2 +- src/test/burn/WixTestTools/WixTestContext.cs | 2 +- src/test/burn/WixTestTools/WixTestTools.csproj | 2 +- .../BasicFunctionalityTests.cs | 2 +- src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs | 2 +- .../burn/WixToolsetTest.BurnE2E/LayoutTests.cs | 2 +- .../burn/WixToolsetTest.BurnE2E/LongPathTests.cs | 2 +- .../Utilities/TestExeTool.cs | 2 +- .../burn/WixToolsetTest.BurnE2E/VariableTests.cs | 2 +- .../WixToolsetTest.BurnE2E.csproj | 2 +- .../WixToolsetTest.MsiE2E.csproj | 2 +- src/test/wix/WixE2E/WixE2E.csproj | 2 +- src/test/wix/WixE2E/WixE2EFixture.cs | 2 +- .../WixToolset.HeatTasks.csproj | 2 +- src/tools/test/WixToolsetTest.Heat/HeatFixture.cs | 2 +- src/tools/test/WixToolsetTest.Heat/HeatRunner.cs | 2 +- .../WixToolsetTest.Heat/WixToolsetTest.Heat.csproj | 2 +- .../WixToolsetTest.HeatTasks/MsbuildHeatFixture.cs | 4 +- .../WixToolsetTest.HeatTasks.csproj | 4 +- .../BundleExtractor.cs | 156 +++++++++ .../ExtractBAContainerResult.cs | 156 +++++++++ .../TestMessageListener.cs | 57 ++++ .../WixInternal.Core.TestPackage.csproj | 36 ++ .../WixInternal.Core.TestPackage.v3.ncrunchproject | 5 + src/wix/WixInternal.Core.TestPackage/WixRunner.cs | 90 +++++ .../WixRunnerResult.cs | 62 ++++ .../XmlNodeExtensions.cs | 115 +++++++ .../WixToolset.BuildTasks.csproj | 2 +- .../WixToolset.Core.TestPackage/BundleExtractor.cs | 156 --------- .../ExtractBAContainerResult.cs | 156 --------- .../TestMessageListener.cs | 55 --- src/wix/WixToolset.Core.TestPackage/WixRunner.cs | 90 ----- .../WixToolset.Core.TestPackage/WixRunnerResult.cs | 62 ---- .../WixToolset.Core.TestPackage.csproj | 36 -- .../WixToolset.Core.TestPackage.v3.ncrunchproject | 5 - .../XmlNodeExtensions.cs | 115 ------- src/wix/pack_t.proj | 2 +- .../CompileCoreTestExtensionWixlib.csproj | 2 +- .../test/CompileCoreTestExtensionWixlib/Program.cs | 2 +- .../WixBuildTaskFixture.cs | 2 +- .../WixToolsetTest.BuildTasks.csproj | 2 +- .../ConvertSymbolsFixture.cs | 2 +- .../WixToolsetTest.Converters.Symbolizer.csproj | 2 +- .../WixToolsetTest.Converters/BitnessFixture.cs | 2 +- .../BootstrapperApplicationFixture.cs | 2 +- .../BundleCacheFixture.cs | 2 +- .../WixToolsetTest.Converters/ConditionFixture.cs | 2 +- .../WixToolsetTest.Converters/ConverterFixture.cs | 2 +- .../ConverterIntegrationFixture.cs | 4 +- .../CustomActionFixture.cs | 2 +- .../CustomTableFixture.cs | 2 +- .../WixToolsetTest.Converters/DependencyFixture.cs | 2 +- .../DirectXExtensionFixture.cs | 2 +- .../WixToolsetTest.Converters/DirectoryFixture.cs | 2 +- .../WixToolsetTest.Converters/ExePackageFixture.cs | 2 +- .../WixToolsetTest.Converters/FeatureFixture.cs | 2 +- .../FirewallExtensionFixture.cs | 2 +- .../WixToolsetTest.Converters/IncludeFixture.cs | 2 +- .../LocalizationFixture.cs | 2 +- .../WixToolsetTest.Converters/MsuPackageFixture.cs | 2 +- .../ProductPackageFixture.cs | 4 +- .../WixToolsetTest.Converters/PropertyFixture.cs | 2 +- .../WixToolsetTest.Converters/RegistryFixture.cs | 2 +- .../RemotePayloadFixture.cs | 2 +- .../WixToolsetTest.Converters/SequenceFixture.cs | 2 +- .../test/WixToolsetTest.Converters/TagFixture.cs | 2 +- .../UIExtensionFixture.cs | 2 +- .../UtilExtensionFixture.cs | 2 +- .../VSExtensionFixture.cs | 2 +- .../WixToolsetTest.Converters/VariableFixture.cs | 2 +- .../Wix4ConversionFixture.cs | 2 +- .../WixToolsetTest.Converters.csproj | 4 +- .../WixToolsetTest.Core.Native/CabinetFixture.cs | 4 +- .../CertificateHashesFixture.cs | 16 +- .../WixToolsetTest.Core.Native.csproj | 2 +- .../WixToolsetTest.Core/ParserHelperFixture.cs | 2 +- .../WixToolsetTest.Core/PreprocessorFixture.cs | 2 +- .../WixToolsetTest.Core/WixToolsetTest.Core.csproj | 2 +- .../AdvertisedTypeLibVersionFixture.cs | 4 +- .../ApprovedExeFixture.cs | 4 +- .../BadInputFixture.cs | 4 +- .../BindVariablesFixture.cs | 4 +- .../BootstrapperApplicationFixture.cs | 4 +- .../BundleExtractionFixture.cs | 4 +- .../BundleFixture.cs | 4 +- .../BundleManifestFixture.cs | 4 +- .../BundlePackageFixture.cs | 4 +- .../BurnRemotePayloadSubcommandFixture.cs | 4 +- .../WixToolsetTest.CoreIntegration/CabFixture.cs | 4 +- .../WixToolsetTest.CoreIntegration/ClassFixture.cs | 4 +- .../CommandLineFixture.cs | 4 +- .../ComponentFixture.cs | 4 +- .../ContainerFixture.cs | 4 +- .../CopyFileFixture.cs | 4 +- .../CustomActionFixture.cs | 4 +- .../CustomTableFixture.cs | 4 +- .../DecompileFixture.cs | 4 +- .../DependencyExtensionFixture.cs | 4 +- .../DirectoryFixture.cs | 4 +- .../ExePackageFixture.cs | 4 +- .../ExtensionFixture.cs | 4 +- .../FeatureFixture.cs | 4 +- .../LanguageFixture.cs | 4 +- .../LinkerFixture.cs | 4 +- .../WixToolsetTest.CoreIntegration/MediaFixture.cs | 4 +- .../ModuleFixture.cs | 4 +- .../MsiCabinetFixture.cs | 4 +- .../WixToolsetTest.CoreIntegration/MsiFixture.cs | 4 +- .../MsiPackageFixture.cs | 4 +- .../MsiQueryFixture.cs | 4 +- .../MsiTransactionFixture.cs | 4 +- .../MsuPackageFixture.cs | 4 +- .../PackagePayloadFixture.cs | 4 +- .../WixToolsetTest.CoreIntegration/PatchFixture.cs | 4 +- .../PayloadFixture.cs | 4 +- .../PreprocessorFixture.cs | 4 +- .../RegistryFixture.cs | 4 +- .../RollbackBoundaryFixture.cs | 4 +- .../ShortcutFixture.cs | 4 +- .../SigningFixture.cs | 4 +- .../SoftwareTagFixture.cs | 4 +- .../TestXmlFixture.cs | 4 +- .../TransformFixture.cs | 4 +- .../WixToolsetTest.CoreIntegration/UIFixture.cs | 4 +- .../UnadvertisedTypeLibVersionFixture.cs | 4 +- .../UpgradeFixture.cs | 4 +- .../ValidationFixture.cs | 4 +- .../VariableResolverFixture.cs | 2 +- .../VersionFixture.cs | 4 +- .../WarningFixture.cs | 4 +- .../WixToolsetTest.CoreIntegration.csproj | 4 +- .../WixiplFixture.cs | 4 +- .../WixlibFixture.cs | 4 +- .../WixlibQueryFixture.cs | 4 +- src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 2 +- .../WixToolsetTest.Sdk/MsbuildValidationFixture.cs | 2 +- .../WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj | 4 +- src/wix/wix.cmd | 2 +- src/wix/wix.sln | 2 +- 297 files changed, 3491 insertions(+), 3489 deletions(-) delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/AssemblyInfo.cpp delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/WixBuildTools.TestSupport.Native.vcxproj.filters delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.props delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.targets delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/packages.config delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/precomp.cpp delete mode 100644 src/internal/WixBuildTools.TestSupport.Native/precomp.h delete mode 100644 src/internal/WixBuildTools.TestSupport/Builder.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/DisposableFileSystem.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/DotnetRunner.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/ExternalExecutable.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/ExternalExecutableResult.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/FakeBuildEngine.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/MsbuildRunner.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/MsbuildRunnerResult.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/Pushd.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/Query.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/RobocopyRunner.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/TestData.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/VswhereRunner.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/WixBuildTools.TestSupport.csproj delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SkipTestException.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactAttribute.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactMessageBus.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactTestCase.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/SucceededException.cs delete mode 100644 src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs create mode 100644 src/internal/WixInternal.BaseBuildTasks.Sources/BaseToolsetTask.cs create mode 100644 src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs create mode 100644 src/internal/WixInternal.BaseBuildTasks.Sources/WixInternal.BaseBuildTasks.Sources.csproj create mode 100644 src/internal/WixInternal.TestSupport.Native/AssemblyInfo.cpp create mode 100644 src/internal/WixInternal.TestSupport.Native/NativeAssert.h create mode 100644 src/internal/WixInternal.TestSupport.Native/WixInternal.TestSupport.Native.vcxproj create mode 100644 src/internal/WixInternal.TestSupport.Native/WixInternal.TestSupport.Native.vcxproj.filters create mode 100644 src/internal/WixInternal.TestSupport.Native/build/WixInternal.TestSupport.Native.props create mode 100644 src/internal/WixInternal.TestSupport.Native/build/WixInternal.TestSupport.Native.targets create mode 100644 src/internal/WixInternal.TestSupport.Native/packages.config create mode 100644 src/internal/WixInternal.TestSupport.Native/precomp.cpp create mode 100644 src/internal/WixInternal.TestSupport.Native/precomp.h create mode 100644 src/internal/WixInternal.TestSupport/Builder.cs create mode 100644 src/internal/WixInternal.TestSupport/DisposableFileSystem.cs create mode 100644 src/internal/WixInternal.TestSupport/DotnetRunner.cs create mode 100644 src/internal/WixInternal.TestSupport/ExternalExecutable.cs create mode 100644 src/internal/WixInternal.TestSupport/ExternalExecutableResult.cs create mode 100644 src/internal/WixInternal.TestSupport/FakeBuildEngine.cs create mode 100644 src/internal/WixInternal.TestSupport/MsbuildRunner.cs create mode 100644 src/internal/WixInternal.TestSupport/MsbuildRunnerResult.cs create mode 100644 src/internal/WixInternal.TestSupport/MsbuildUtilities.cs create mode 100644 src/internal/WixInternal.TestSupport/Pushd.cs create mode 100644 src/internal/WixInternal.TestSupport/Query.cs create mode 100644 src/internal/WixInternal.TestSupport/RobocopyRunner.cs create mode 100644 src/internal/WixInternal.TestSupport/TestData.cs create mode 100644 src/internal/WixInternal.TestSupport/TestDataFolderFileSystem.cs create mode 100644 src/internal/WixInternal.TestSupport/VswhereRunner.cs create mode 100644 src/internal/WixInternal.TestSupport/WixInternal.TestSupport.csproj create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SkipTestException.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactAttribute.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactMessageBus.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactTestCase.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SpecificReturnCodeException.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/SucceededException.cs create mode 100644 src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs delete mode 100644 src/internal/WixToolset.BaseBuildTasks.Sources/BaseToolsetTask.cs delete mode 100644 src/internal/WixToolset.BaseBuildTasks.Sources/WixCommandLineBuilder.cs delete mode 100644 src/internal/WixToolset.BaseBuildTasks.Sources/WixToolset.BaseBuildTasks.Sources.csproj create mode 100644 src/wix/WixInternal.Core.TestPackage/BundleExtractor.cs create mode 100644 src/wix/WixInternal.Core.TestPackage/ExtractBAContainerResult.cs create mode 100644 src/wix/WixInternal.Core.TestPackage/TestMessageListener.cs create mode 100644 src/wix/WixInternal.Core.TestPackage/WixInternal.Core.TestPackage.csproj create mode 100644 src/wix/WixInternal.Core.TestPackage/WixInternal.Core.TestPackage.v3.ncrunchproject create mode 100644 src/wix/WixInternal.Core.TestPackage/WixRunner.cs create mode 100644 src/wix/WixInternal.Core.TestPackage/WixRunnerResult.cs create mode 100644 src/wix/WixInternal.Core.TestPackage/XmlNodeExtensions.cs delete mode 100644 src/wix/WixToolset.Core.TestPackage/BundleExtractor.cs delete mode 100644 src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs delete mode 100644 src/wix/WixToolset.Core.TestPackage/TestMessageListener.cs delete mode 100644 src/wix/WixToolset.Core.TestPackage/WixRunner.cs delete mode 100644 src/wix/WixToolset.Core.TestPackage/WixRunnerResult.cs delete mode 100644 src/wix/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj delete mode 100644 src/wix/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.v3.ncrunchproject delete mode 100644 src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs (limited to 'src') diff --git a/src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp b/src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp index 9920564e..2ae539ee 100644 --- a/src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp +++ b/src/api/burn/test/BalUtilUnitTest/BAFunctionsTests.cpp @@ -4,8 +4,8 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; -using namespace WixBuildTools::TestSupport::XunitExtensions; +using namespace WixInternal::TestSupport; +using namespace WixInternal::TestSupport::XunitExtensions; namespace BalUtilTests { diff --git a/src/api/burn/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj b/src/api/burn/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj index d6c03a43..94586fbd 100644 --- a/src/api/burn/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj +++ b/src/api/burn/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj @@ -3,7 +3,7 @@ - + @@ -61,5 +61,5 @@ - + diff --git a/src/api/burn/test/BalUtilUnitTest/BootstrapperApplicationTests.cpp b/src/api/burn/test/BalUtilUnitTest/BootstrapperApplicationTests.cpp index 396682ee..70b01a42 100644 --- a/src/api/burn/test/BalUtilUnitTest/BootstrapperApplicationTests.cpp +++ b/src/api/burn/test/BalUtilUnitTest/BootstrapperApplicationTests.cpp @@ -4,8 +4,8 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; -using namespace WixBuildTools::TestSupport::XunitExtensions; +using namespace WixInternal::TestSupport; +using namespace WixInternal::TestSupport::XunitExtensions; namespace BalUtilTests { diff --git a/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj b/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj index c27fb442..d437dc36 100644 --- a/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj +++ b/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj @@ -2,7 +2,7 @@ - + @@ -57,5 +57,5 @@ - + diff --git a/src/api/burn/test/BextUtilUnitTest/BundleExtensionTests.cpp b/src/api/burn/test/BextUtilUnitTest/BundleExtensionTests.cpp index fde9d2b6..5c5c5812 100644 --- a/src/api/burn/test/BextUtilUnitTest/BundleExtensionTests.cpp +++ b/src/api/burn/test/BextUtilUnitTest/BundleExtensionTests.cpp @@ -4,8 +4,8 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; -using namespace WixBuildTools::TestSupport::XunitExtensions; +using namespace WixInternal::TestSupport; +using namespace WixInternal::TestSupport::XunitExtensions; namespace BextUtilTests { diff --git a/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs b/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs index 39a92024..7074c166 100644 --- a/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs +++ b/src/api/burn/test/WixToolsetTest.Mba.Core/BaseBootstrapperApplicationFactoryFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.Mba.Core using System; using System.Collections.Generic; using System.Runtime.InteropServices; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Mba.Core; using Xunit; diff --git a/src/api/burn/test/WixToolsetTest.Mba.Core/WixToolsetTest.Mba.Core.csproj b/src/api/burn/test/WixToolsetTest.Mba.Core/WixToolsetTest.Mba.Core.csproj index 7aeb8aad..7c21734f 100644 --- a/src/api/burn/test/WixToolsetTest.Mba.Core/WixToolsetTest.Mba.Core.csproj +++ b/src/api/burn/test/WixToolsetTest.Mba.Core/WixToolsetTest.Mba.Core.csproj @@ -13,6 +13,6 @@ - + diff --git a/src/api/wix/test/WixToolsetTest.Data/SerializeFixture.cs b/src/api/wix/test/WixToolsetTest.Data/SerializeFixture.cs index 98317446..8c8a23b4 100644 --- a/src/api/wix/test/WixToolsetTest.Data/SerializeFixture.cs +++ b/src/api/wix/test/WixToolsetTest.Data/SerializeFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.Data using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Data; using WixToolset.Data.Bind; using WixToolset.Data.Symbols; diff --git a/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs b/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs index efb777ee..71775fa2 100644 --- a/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs +++ b/src/api/wix/test/WixToolsetTest.Data/WindowsInstallerTableDefinitionsFixture.cs @@ -2,7 +2,7 @@ namespace WixToolsetTest.Data { - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Data.WindowsInstaller; using Xunit; diff --git a/src/api/wix/test/WixToolsetTest.Data/WixToolsetTest.Data.csproj b/src/api/wix/test/WixToolsetTest.Data/WixToolsetTest.Data.csproj index 8198ac8f..ea26bea8 100644 --- a/src/api/wix/test/WixToolsetTest.Data/WixToolsetTest.Data.csproj +++ b/src/api/wix/test/WixToolsetTest.Data/WixToolsetTest.Data.csproj @@ -12,6 +12,6 @@ - + diff --git a/src/burn/test/BurnUnitTest/BurnTestException.h b/src/burn/test/BurnUnitTest/BurnTestException.h index e813f95c..b9467926 100644 --- a/src/burn/test/BurnUnitTest/BurnTestException.h +++ b/src/burn/test/BurnUnitTest/BurnTestException.h @@ -13,7 +13,7 @@ namespace Test namespace Bootstrapper { using namespace System; - using namespace WixBuildTools::TestSupport; + using namespace WixInternal::TestSupport; public ref struct BurnTestException : public SucceededException { diff --git a/src/burn/test/BurnUnitTest/BurnTestFixture.h b/src/burn/test/BurnUnitTest/BurnTestFixture.h index 470c81c1..35acba67 100644 --- a/src/burn/test/BurnUnitTest/BurnTestFixture.h +++ b/src/burn/test/BurnUnitTest/BurnTestFixture.h @@ -13,7 +13,7 @@ namespace Test namespace Bootstrapper { using namespace System; - using namespace WixBuildTools::TestSupport; + using namespace WixInternal::TestSupport; public ref class BurnTestFixture : IDisposable { @@ -31,7 +31,7 @@ namespace Bootstrapper PlatformInitialize(); - this->testDirectory = WixBuildTools::TestSupport::TestData::Get(); + this->testDirectory = WixInternal::TestSupport::TestData::Get(); LogInitialize(::GetModuleHandleW(L"BurnUnitTest.dll")); diff --git a/src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj b/src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj index fe86f042..46708c26 100644 --- a/src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj +++ b/src/burn/test/BurnUnitTest/BurnUnitTest.vcxproj @@ -2,7 +2,7 @@ - + @@ -99,5 +99,5 @@ - + diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp index 869e5114..f95c011f 100644 --- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp @@ -23,7 +23,7 @@ namespace Bootstrapper using namespace System; using namespace System::IO; using namespace Xunit; - using namespace WixBuildTools::TestSupport; + using namespace WixInternal::TestSupport; public ref class RegistrationTest : BurnUnitTest, IClassFixture { diff --git a/src/burn/test/BurnUnitTest/RelatedBundleTest.cpp b/src/burn/test/BurnUnitTest/RelatedBundleTest.cpp index 3d1964c3..310a958a 100644 --- a/src/burn/test/BurnUnitTest/RelatedBundleTest.cpp +++ b/src/burn/test/BurnUnitTest/RelatedBundleTest.cpp @@ -16,7 +16,7 @@ namespace Bootstrapper using namespace System; using namespace System::IO; using namespace Xunit; - using namespace WixBuildTools::TestSupport; + using namespace WixInternal::TestSupport; public ref class RelatedBundleTest : BurnUnitTest, IClassFixture { diff --git a/src/burn/test/BurnUnitTest/TestRegistryFixture.cpp b/src/burn/test/BurnUnitTest/TestRegistryFixture.cpp index 89704d09..fe82c4af 100644 --- a/src/burn/test/BurnUnitTest/TestRegistryFixture.cpp +++ b/src/burn/test/BurnUnitTest/TestRegistryFixture.cpp @@ -165,7 +165,7 @@ LExit: return ls; } -namespace WixBuildTools +namespace WixInternal { namespace TestSupport { diff --git a/src/burn/test/BurnUnitTest/TestRegistryFixture.h b/src/burn/test/BurnUnitTest/TestRegistryFixture.h index 2f283f3e..da070680 100644 --- a/src/burn/test/BurnUnitTest/TestRegistryFixture.h +++ b/src/burn/test/BurnUnitTest/TestRegistryFixture.h @@ -1,7 +1,7 @@ #pragma once // 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. -namespace WixBuildTools +namespace WixInternal { namespace TestSupport { diff --git a/src/clean.cmd b/src/clean.cmd index d0d9ebd8..0eacc32c 100644 --- a/src/clean.cmd +++ b/src/clean.cmd @@ -17,8 +17,9 @@ if exist global.json (del global.json) if exist ..\Directory.Packages.props (del ..\Directory.Packages.props) if exist ..\global.json (del ..\global.json) -if exist "%_NUGET_CACHE%\wixbuildtools.testsupport" rd /s/q "%_NUGET_CACHE%\wixbuildtools.testsupport" -if exist "%_NUGET_CACHE%\wixtoolset.basebuildtasks.sources" rd /s/q "%_NUGET_CACHE%\wixtoolset.basebuildtasks.sources" +if exist "%_NUGET_CACHE%\wixinternal.basebuildtasks.sources" rd /s/q "%_NUGET_CACHE%\wixinternal.basebuildtasks.sources" +if exist "%_NUGET_CACHE%\wixinternal.testsupport" rd /s/q "%_NUGET_CACHE%\wixinternal.testsupport" +if exist "%_NUGET_CACHE%\wixinternal.core.testpackage" rd /s/q "%_NUGET_CACHE%\wixinternal.core.testpackage" if exist "%_NUGET_CACHE%\wixtoolset.bal.wixext" rd /s/q "%_NUGET_CACHE%\wixtoolset.bal.wixext" if exist "%_NUGET_CACHE%\wixtoolset.balutil" rd /s/q "%_NUGET_CACHE%\wixtoolset.balutil" if exist "%_NUGET_CACHE%\wixtoolset.bextutil" rd /s/q "%_NUGET_CACHE%\wixtoolset.bextutil" @@ -28,7 +29,6 @@ if exist "%_NUGET_CACHE%\wixtoolset.core" rd /s/q "%_NUGET_CACHE%\wixtoolset.cor if exist "%_NUGET_CACHE%\wixtoolset.core.burn" rd /s/q "%_NUGET_CACHE%\wixtoolset.core.burn" if exist "%_NUGET_CACHE%\wixtoolset.core.extensioncache" rd /s/q "%_NUGET_CACHE%\wixtoolset.core.extensioncache" if exist "%_NUGET_CACHE%\wixtoolset.core.native" rd /s/q "%_NUGET_CACHE%\wixtoolset.core.native" -if exist "%_NUGET_CACHE%\wixtoolset.core.testpackage" rd /s/q "%_NUGET_CACHE%\wixtoolset.core.testpackage" if exist "%_NUGET_CACHE%\wixtoolset.core.windowsinstaller" rd /s/q "%_NUGET_CACHE%\wixtoolset.core.windowsinstaller" if exist "%_NUGET_CACHE%\wixtoolset.data" rd /s/q "%_NUGET_CACHE%\wixtoolset.data" if exist "%_NUGET_CACHE%\wixtoolset.dependency.wixext" rd /s/q "%_NUGET_CACHE%\wixtoolset.dependency.wixext" diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs index 63b9b4a8..329722a4 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs @@ -6,9 +6,9 @@ namespace WixToolsetTest.Bal using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; using WixToolset.Bal; - using WixToolset.Core.TestPackage; + using WixInternal.Core.TestPackage; + using WixInternal.TestSupport; using Xunit; public class BalExtensionFixture diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/InternalUIBAFixture.cs b/src/ext/Bal/test/WixToolsetTest.Bal/InternalUIBAFixture.cs index dba78da4..b7609d19 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/InternalUIBAFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/InternalUIBAFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.Bal using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class InternalUIBAFixture diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj b/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj index 0022fc7e..644fb625 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj +++ b/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj @@ -20,6 +20,6 @@ - + diff --git a/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/WixToolsetTest.Dnc.HostGenerator.csproj b/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/WixToolsetTest.Dnc.HostGenerator.csproj index 45c76232..1cbf702d 100644 --- a/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/WixToolsetTest.Dnc.HostGenerator.csproj +++ b/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/WixToolsetTest.Dnc.HostGenerator.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs index 02059faa..fe644d2d 100644 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.ManagedHost { using System; - using WixBuildTools.TestSupport; - using WixBuildTools.TestSupport.XunitExtensions; + using WixInternal.TestSupport; + using WixInternal.TestSupport.XunitExtensions; using Xunit; public class DncHostFixture diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs index b4ebe1c6..6f7709b5 100644 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs @@ -2,7 +2,7 @@ namespace WixToolsetTest.ManagedHost { - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using Xunit; public class MbaHostFixture diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs index 0ca2b40f..8be62e92 100644 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs +++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.ManagedHost using System.Collections.Generic; using System.Diagnostics; using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; public class TestEngine { diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj b/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj index e06c0440..16a05fec 100644 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj +++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj @@ -12,6 +12,6 @@ - + diff --git a/src/ext/ComPlus/test/WixToolsetTest.ComPlus/ComPlusExtensionFixture.cs b/src/ext/ComPlus/test/WixToolsetTest.ComPlus/ComPlusExtensionFixture.cs index d0b8daba..17c5eb0f 100644 --- a/src/ext/ComPlus/test/WixToolsetTest.ComPlus/ComPlusExtensionFixture.cs +++ b/src/ext/ComPlus/test/WixToolsetTest.ComPlus/ComPlusExtensionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.ComPlus { using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.ComPlus; using Xunit; diff --git a/src/ext/ComPlus/test/WixToolsetTest.ComPlus/WixToolsetTest.ComPlus.csproj b/src/ext/ComPlus/test/WixToolsetTest.ComPlus/WixToolsetTest.ComPlus.csproj index 08008025..a9e9dbef 100644 --- a/src/ext/ComPlus/test/WixToolsetTest.ComPlus/WixToolsetTest.ComPlus.csproj +++ b/src/ext/ComPlus/test/WixToolsetTest.ComPlus/WixToolsetTest.ComPlus.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs b/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs index 9e837cff..6190a4e0 100644 --- a/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs +++ b/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.Dependency { using System.Linq; using System.Text.RegularExpressions; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Dependency; using Xunit; diff --git a/src/ext/Dependency/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj b/src/ext/Dependency/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj index ac4624b1..70b56f45 100644 --- a/src/ext/Dependency/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj +++ b/src/ext/Dependency/test/WixToolsetTest.Dependency/WixToolsetTest.Dependency.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs index d8f1c9ea..7bdd039b 100644 --- a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs +++ b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/DifxAppExtensionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.DifxApp { using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.DifxApp; using Xunit; diff --git a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj index 47329768..d7176efa 100644 --- a/src/ext/DifxApp/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj +++ b/src/ext/DifxApp/test/WixToolsetTest.DifxApp/WixToolsetTest.DifxApp.csproj @@ -19,6 +19,6 @@ - + diff --git a/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs b/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs index f936cdfe..64013ca6 100644 --- a/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs +++ b/src/ext/DirectX/test/WixToolsetTest.DirectX/DirectXExtensionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.DirectX { using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.DirectX; using Xunit; diff --git a/src/ext/DirectX/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj b/src/ext/DirectX/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj index dd8b9695..31a35320 100644 --- a/src/ext/DirectX/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj +++ b/src/ext/DirectX/test/WixToolsetTest.DirectX/WixToolsetTest.DirectX.csproj @@ -19,6 +19,6 @@ - + diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs index f7df46e6..c2c2bbc3 100644 --- a/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs +++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/FirewallExtensionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.Firewall { using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Firewall; using Xunit; diff --git a/src/ext/Firewall/test/WixToolsetTest.Firewall/WixToolsetTest.Firewall.csproj b/src/ext/Firewall/test/WixToolsetTest.Firewall/WixToolsetTest.Firewall.csproj index 03270860..e46020a6 100644 --- a/src/ext/Firewall/test/WixToolsetTest.Firewall/WixToolsetTest.Firewall.csproj +++ b/src/ext/Firewall/test/WixToolsetTest.Firewall/WixToolsetTest.Firewall.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs b/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs index 40b49327..14b40bc8 100644 --- a/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs +++ b/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs @@ -2,8 +2,8 @@ namespace WixToolsetTest.Http { - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Http; using Xunit; diff --git a/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj b/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj index df955ca3..b23ef481 100644 --- a/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj +++ b/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs b/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs index 541426a8..4684a821 100644 --- a/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs +++ b/src/ext/Iis/test/WixToolsetTest.Iis/IisExtensionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.Iis { using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Iis; using Xunit; diff --git a/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj b/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj index d6a60a38..a39e5b0b 100644 --- a/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj +++ b/src/ext/Iis/test/WixToolsetTest.Iis/WixToolsetTest.Iis.csproj @@ -19,6 +19,6 @@ - + diff --git a/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs b/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs index c9d40d10..674d6a66 100644 --- a/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs +++ b/src/ext/Msmq/test/WixToolsetTest.Msmq/MsmqExtensionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.Msmq { using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Msmq; using Xunit; diff --git a/src/ext/Msmq/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj b/src/ext/Msmq/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj index 5e4a5ca9..e7b6f21e 100644 --- a/src/ext/Msmq/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj +++ b/src/ext/Msmq/test/WixToolsetTest.Msmq/WixToolsetTest.Msmq.csproj @@ -19,6 +19,6 @@ - + diff --git a/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs b/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs index a03d47d6..dea42bd5 100644 --- a/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs +++ b/src/ext/NetFx/test/WixToolsetTest.Netfx/NetfxExtensionFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.Netfx { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Netfx; using Xunit; diff --git a/src/ext/NetFx/test/WixToolsetTest.Netfx/WixToolsetTest.Netfx.csproj b/src/ext/NetFx/test/WixToolsetTest.Netfx/WixToolsetTest.Netfx.csproj index 8b13d357..4e509cce 100644 --- a/src/ext/NetFx/test/WixToolsetTest.Netfx/WixToolsetTest.Netfx.csproj +++ b/src/ext/NetFx/test/WixToolsetTest.Netfx/WixToolsetTest.Netfx.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs b/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs index b2f27ecf..eafda99f 100644 --- a/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs +++ b/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs @@ -2,8 +2,8 @@ namespace WixToolsetTest.PowerShell { - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.PowerShell; using Xunit; diff --git a/src/ext/PowerShell/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj b/src/ext/PowerShell/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj index 84241a14..347ca1ed 100644 --- a/src/ext/PowerShell/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj +++ b/src/ext/PowerShell/test/WixToolsetTest.PowerShell/WixToolsetTest.Powershell.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/Sql/test/WixToolsetTest.Sql/SqlExtensionFixture.cs b/src/ext/Sql/test/WixToolsetTest.Sql/SqlExtensionFixture.cs index aa9d7a1f..5576576d 100644 --- a/src/ext/Sql/test/WixToolsetTest.Sql/SqlExtensionFixture.cs +++ b/src/ext/Sql/test/WixToolsetTest.Sql/SqlExtensionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.Sql { using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Sql; using Xunit; diff --git a/src/ext/Sql/test/WixToolsetTest.Sql/WixToolsetTest.Sql.csproj b/src/ext/Sql/test/WixToolsetTest.Sql/WixToolsetTest.Sql.csproj index de502438..6c848683 100644 --- a/src/ext/Sql/test/WixToolsetTest.Sql/WixToolsetTest.Sql.csproj +++ b/src/ext/Sql/test/WixToolsetTest.Sql/WixToolsetTest.Sql.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs index 9c0e2ed6..4fd203c5 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.UI using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data.WindowsInstaller; using WixToolset.UI; using Xunit; diff --git a/src/ext/UI/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj b/src/ext/UI/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj index 22366c79..675f14f8 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj +++ b/src/ext/UI/test/WixToolsetTest.UI/WixToolsetTest.UI.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs index 3da5f671..18bb2c7d 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.Util using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Util; using Xunit; diff --git a/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj b/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj index 2cf3c02a..16d0e138 100644 --- a/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj +++ b/src/ext/Util/test/WixToolsetTest.Util/WixToolsetTest.Util.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs index dc76e8fb..fdfd2e0e 100644 --- a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs +++ b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs @@ -2,8 +2,8 @@ namespace WixToolsetTest.VisualStudio { - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.VisualStudio; using Xunit; diff --git a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/WixToolsetTest.VisualStudio.csproj b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/WixToolsetTest.VisualStudio.csproj index dffbb462..2b0a7c1c 100644 --- a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/WixToolsetTest.VisualStudio.csproj +++ b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/WixToolsetTest.VisualStudio.csproj @@ -16,6 +16,6 @@ - + diff --git a/src/internal/SetBuildNumber/Directory.Packages.props.pp b/src/internal/SetBuildNumber/Directory.Packages.props.pp index f59c9742..a14cf55a 100644 --- a/src/internal/SetBuildNumber/Directory.Packages.props.pp +++ b/src/internal/SetBuildNumber/Directory.Packages.props.pp @@ -6,9 +6,9 @@ - - - + + + @@ -28,7 +28,7 @@ - + @@ -83,7 +83,7 @@ - + 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 @@ -// 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. - -#include "precomp.h" - -using namespace System::Reflection; -using namespace System::Runtime::CompilerServices; -using namespace System::Runtime::InteropServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitleAttribute("WixBuildTools.TestSupport.Native")]; -[assembly: AssemblyDescriptionAttribute("")]; -[assembly: AssemblyCultureAttribute("")]; -[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 @@ -#pragma once -// 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. - - -namespace WixBuildTools { -namespace TestSupport { - - using namespace System; - using namespace System::Collections::Generic; - using namespace System::Linq; - using namespace Xunit; - - public ref class NativeAssert : WixAssert - { - public: - static void NotNull(LPCWSTR wz) - { - if (!wz) - { - Assert::NotNull(nullptr); - } - } - - // For some reason, naming these NotStringEqual methods "NotEqual" breaks Intellisense in files that call any overload of the NotEqual method. - static void NotStringEqual(LPCWSTR expected, LPCWSTR actual) - { - NativeAssert::NotStringEqual(expected, actual, FALSE); - } - - static void NotStringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase) - { - WixAssert::NotStringEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), ignoreCase); - } - - // For some reason, naming these StringEqual methods "Equal" breaks Intellisense in files that call any overload of the Equal method. - static void StringEqual(LPCWSTR expected, LPCWSTR actual) - { - NativeAssert::StringEqual(expected, actual, FALSE); - } - - static void StringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase) - { - WixAssert::StringEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), ignoreCase); - } - - static void Succeeded(HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array^ zArgs) - { - array^ formatArgs = gcnew array(zArgs->Length + 1); - formatArgs[0] = NativeAssert::LPSTRToString(zArg); - for (int i = 0; i < zArgs->Length; ++i) - { - formatArgs[i + 1] = NativeAssert::LPSTRToString(zArgs[i]); - } - WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs); - } - - static void Succeeded(HRESULT hr, LPCSTR zFormat, ... array^ wzArgs) - { - array^ formatArgs = gcnew array(wzArgs->Length); - for (int i = 0; i < wzArgs->Length; ++i) - { - formatArgs[i] = NativeAssert::LPWSTRToString(wzArgs[i]); - } - WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs); - } - - static void SpecificReturnCode(HRESULT hrExpected, HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array^ zArgs) - { - array^ formatArgs = gcnew array(zArgs->Length + 1); - formatArgs[0] = NativeAssert::LPSTRToString(zArg); - for (int i = 0; i < zArgs->Length; ++i) - { - formatArgs[i + 1] = NativeAssert::LPSTRToString(zArgs[i]); - } - WixAssert::SpecificReturnCode(hrExpected, hr, gcnew String(zFormat), formatArgs); - } - - static void SpecificReturnCode(HRESULT hrExpected, HRESULT hr, LPCSTR zFormat, ... array^ wzArgs) - { - array^ formatArgs = gcnew array(wzArgs->Length); - for (int i = 0; i < wzArgs->Length; ++i) - { - formatArgs[i] = NativeAssert::LPWSTRToString(wzArgs[i]); - } - WixAssert::SpecificReturnCode(hrExpected, hr, gcnew String(zFormat), formatArgs); - } - - static void ValidReturnCode(HRESULT hr, ... array^ validReturnCodes) - { - Assert::Contains(hr, (IEnumerable^)validReturnCodes); - } - - private: - static String^ LPSTRToString(LPCSTR z) - { - return z ? gcnew String(z) : nullptr; - } - static String^ LPWSTRToString(LPCWSTR wz) - { - return wz ? gcnew String(wz) : nullptr; - } - }; -} -} 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 @@ - - - - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} - {95BABD97-FBDB-453A-AF8A-FA031A07B599} - WixBuildTools::TestSupport - ManagedCProj - DynamicLibrary - Unicode - true - WixBuildTools C++/CLI Test Support - false - true - - - - - - - - - - - - - - Create - - 4564;4691 - - - - - - - - - - - - - - - {6C57EF2C-979A-4106-A9E5-FE342810619A} - - - - - - - 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 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - \ 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 @@ - - - - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), .gitignore)) - - - - - v4.7.2 - - 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 @@ - - - - - - - - - - - - - $(RootBuildFolder)internal\$(Configuration)\$(PlatformTarget)\WixBuildTools.TestSupport.dll - - - $(RootBuildFolder)internal\$(Configuration)\$(PlatformTarget)\WixBuildTools.TestSupport.Native.dll - - - - - - $(RootPackagesFolder)xunit.abstractions.2.0.3\lib\netstandard2.0\xunit.abstractions.dll - - - $(RootPackagesFolder)xunit.assert.2.4.2\lib\netstandard1.1\xunit.assert.dll - - - $(RootPackagesFolder)xunit.extensibility.core.2.4.2\lib\netstandard1.1\xunit.core.dll - - - $(RootPackagesFolder)xunit.extensibility.execution.2.4.2\lib\net452\xunit.execution.desktop.dll - - - - - - - - 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}. - - - - - - - - - - - - - - - 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 @@ - - - - - - - - - - - - - - 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 @@ -// 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. - -#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 @@ -#pragma once -// 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. - - -#include -#include - -#include "NativeAssert.h" - -#pragma managed -#include diff --git a/src/internal/WixBuildTools.TestSupport/Builder.cs b/src/internal/WixBuildTools.TestSupport/Builder.cs deleted file mode 100644 index 31df0084..00000000 --- a/src/internal/WixBuildTools.TestSupport/Builder.cs +++ /dev/null @@ -1,158 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.Collections.Generic; - using System.IO; - - public class Builder - { - public Builder(string sourceFolder, Type extensionType = null, string[] bindPaths = null, string outputFile = null) - { - this.SourceFolder = sourceFolder; - this.ExtensionType = extensionType; - this.BindPaths = bindPaths; - this.OutputFile = outputFile ?? "test.msi"; - } - - public string[] BindPaths { get; set; } - - public Type ExtensionType { get; set; } - - public string OutputFile { get; set; } - - public string SourceFolder { get; } - - public string[] BuildAndQuery(Action buildFunc, params string[] tables) - { - var sourceFiles = Directory.GetFiles(this.SourceFolder, "*.wxs"); - var wxlFiles = Directory.GetFiles(this.SourceFolder, "*.wxl"); - - using (var fs = new DisposableFileSystem()) - { - var intermediateFolder = fs.GetFolder(); - var outputPath = Path.Combine(intermediateFolder, "bin", this.OutputFile); - - var args = new List - { - "build", - "-o", outputPath, - "-intermediateFolder", intermediateFolder, - }; - - if (this.ExtensionType != null) - { - args.Add("-ext"); - args.Add(Path.GetFullPath(new Uri(this.ExtensionType.Assembly.CodeBase).LocalPath)); - } - - args.AddRange(sourceFiles); - - foreach (var wxlFile in wxlFiles) - { - args.Add("-loc"); - args.Add(wxlFile); - } - - foreach (var bindPath in this.BindPaths) - { - args.Add("-bindpath"); - args.Add(bindPath); - } - - buildFunc(args.ToArray()); - - return Query.QueryDatabase(outputPath, tables); - } - } - - public void BuildAndDecompileAndBuild(Action buildFunc, Action decompileFunc, string decompilePath) - { - var sourceFiles = Directory.GetFiles(this.SourceFolder, "*.wxs"); - var wxlFiles = Directory.GetFiles(this.SourceFolder, "*.wxl"); - - using (var fs = new DisposableFileSystem()) - { - var intermediateFolder = fs.GetFolder(); - var outputFolder = Path.Combine(intermediateFolder, "bin"); - var decompileExtractFolder = Path.Combine(intermediateFolder, "decompiled", "extract"); - var decompileIntermediateFolder = Path.Combine(intermediateFolder, "decompiled", "obj"); - var decompileBuildFolder = Path.Combine(intermediateFolder, "decompiled", "bin"); - var outputPath = Path.Combine(outputFolder, this.OutputFile); - var decompileBuildPath = Path.Combine(decompileBuildFolder, this.OutputFile); - - // First build. - var firstBuildArgs = new List - { - "build", - "-o", outputPath, - "-intermediateFolder", intermediateFolder, - }; - - if (this.ExtensionType != null) - { - firstBuildArgs.Add("-ext"); - firstBuildArgs.Add(Path.GetFullPath(new Uri(this.ExtensionType.Assembly.CodeBase).LocalPath)); - } - - firstBuildArgs.AddRange(sourceFiles); - - foreach (var wxlFile in wxlFiles) - { - firstBuildArgs.Add("-loc"); - firstBuildArgs.Add(wxlFile); - } - - foreach (var bindPath in this.BindPaths) - { - firstBuildArgs.Add("-bindpath"); - firstBuildArgs.Add(bindPath); - } - - buildFunc(firstBuildArgs.ToArray()); - - // Decompile built output. - var decompileArgs = new List - { - "msi", "decompile", - outputPath, - "-intermediateFolder", decompileIntermediateFolder, - "-x", decompileExtractFolder, - "-o", decompilePath - }; - - if (this.ExtensionType != null) - { - decompileArgs.Add("-ext"); - decompileArgs.Add(Path.GetFullPath(new Uri(this.ExtensionType.Assembly.CodeBase).LocalPath)); - } - - decompileFunc(decompileArgs.ToArray()); - - // Build decompiled output. - var secondBuildArgs = new List - { - "build", - decompilePath, - "-o", decompileBuildPath, - "-intermediateFolder", decompileIntermediateFolder - }; - - if (this.ExtensionType != null) - { - secondBuildArgs.Add("-ext"); - secondBuildArgs.Add(Path.GetFullPath(new Uri(this.ExtensionType.Assembly.CodeBase).LocalPath)); - } - - secondBuildArgs.Add("-bindpath"); - secondBuildArgs.Add(outputFolder); - - secondBuildArgs.Add("-bindpath"); - secondBuildArgs.Add(decompileExtractFolder); - - buildFunc(secondBuildArgs.ToArray()); - } - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/DisposableFileSystem.cs b/src/internal/WixBuildTools.TestSupport/DisposableFileSystem.cs deleted file mode 100644 index f096db72..00000000 --- a/src/internal/WixBuildTools.TestSupport/DisposableFileSystem.cs +++ /dev/null @@ -1,93 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.Collections.Generic; - using System.IO; - - public class DisposableFileSystem : IDisposable - { - protected bool Disposed { get; private set; } - - private List CleanupPaths { get; } = new List(); - - public bool Keep { get; } - - public DisposableFileSystem(bool keep = false) - { - this.Keep = keep; - } - - protected string GetFile(bool create = false) - { - var path = Path.GetTempFileName(); - - if (!create) - { - File.Delete(path); - } - - this.CleanupPaths.Add(path); - - return path; - } - - public string GetFolder(bool create = false) - { - var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - - if (create) - { - Directory.CreateDirectory(path); - } - - this.CleanupPaths.Add(path); - - return path; - } - - - #region // IDisposable - - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (this.Disposed) - { - return; - } - - if (disposing && !this.Keep) - { - foreach (var path in this.CleanupPaths) - { - try - { - if (File.Exists(path)) - { - File.Delete(path); - } - else if (Directory.Exists(path)) - { - Directory.Delete(path, true); - } - } - catch - { - // Best effort delete, so ignore any failures. - } - } - } - - this.Disposed = true; - } - - #endregion - } -} diff --git a/src/internal/WixBuildTools.TestSupport/DotnetRunner.cs b/src/internal/WixBuildTools.TestSupport/DotnetRunner.cs deleted file mode 100644 index 82391178..00000000 --- a/src/internal/WixBuildTools.TestSupport/DotnetRunner.cs +++ /dev/null @@ -1,57 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.Collections.Generic; - using System.IO; - - public class DotnetRunner : ExternalExecutable - { - private static readonly object InitLock = new object(); - private static bool Initialized; - private static DotnetRunner Instance; - - public static ExternalExecutableResult Execute(string command, string[] arguments = null) => - InitAndExecute(command, arguments); - - private static ExternalExecutableResult InitAndExecute(string command, string[] arguments) - { - lock (InitLock) - { - if (!Initialized) - { - Initialized = true; - var dotnetPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"); - if (String.IsNullOrEmpty(dotnetPath) || !File.Exists(dotnetPath)) - { - dotnetPath = "dotnet"; - } - - Instance = new DotnetRunner(dotnetPath); - } - } - - return Instance.ExecuteCore(command, arguments); - } - - private DotnetRunner(string exePath) : base(exePath) { } - - private ExternalExecutableResult ExecuteCore(string command, string[] arguments) - { - var total = new List - { - command, - }; - - if (arguments != null) - { - total.AddRange(arguments); - } - - var args = CombineArguments(total); - var mergeErrorIntoOutput = true; - return this.Run(args, mergeErrorIntoOutput); - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/ExternalExecutable.cs b/src/internal/WixBuildTools.TestSupport/ExternalExecutable.cs deleted file mode 100644 index 4a932645..00000000 --- a/src/internal/WixBuildTools.TestSupport/ExternalExecutable.cs +++ /dev/null @@ -1,374 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.ComponentModel; - using System.Diagnostics; - using System.IO; - using System.Runtime.InteropServices; - using System.Text; - using System.Threading.Tasks; - using Microsoft.Win32.SafeHandles; - - public abstract class ExternalExecutable - { - private readonly string exePath; - - protected ExternalExecutable(string exePath) - { - this.exePath = exePath; - } - - protected ExternalExecutableResult Run(string args, bool mergeErrorIntoOutput = false, string workingDirectory = null) - { - // https://github.com/dotnet/runtime/issues/58492 - // Process.Start doesn't currently support starting a process with a long path, - // but the way to support long paths doesn't support searching for the executable if it was a relative path. - // Avoid the managed way of doing this even if the target isn't a long path to help verify that the native way works. - if (!Path.IsPathRooted(this.exePath)) - { - return this.RunManaged(args, mergeErrorIntoOutput, workingDirectory); - } - - // https://web.archive.org/web/20150331190801/https://support.microsoft.com/en-us/kb/190351 - var commandLine = $"\"{this.exePath}\" {args}"; - var currentDirectory = workingDirectory ?? Path.GetDirectoryName(this.exePath); - if (String.IsNullOrEmpty(currentDirectory)) - { - currentDirectory = null; - } - var processInfo = new PROCESS_INFORMATION(); - var startInfo = new STARTUPINFOW - { - cb = Marshal.SizeOf(typeof(STARTUPINFOW)), - dwFlags = StartupInfoFlags.STARTF_FORCEOFFFEEDBACK | StartupInfoFlags.STARTF_USESTDHANDLES, - hStdInput = GetStdHandle(StdHandleType.STD_INPUT_HANDLE), - }; - SafeFileHandle hStdOutputParent = null; - SafeFileHandle hStdErrorParent = null; - - try - { - CreatePipeForProcess(out hStdOutputParent, out startInfo.hStdOutput); - - if (!mergeErrorIntoOutput) - { - CreatePipeForProcess(out hStdErrorParent, out startInfo.hStdError); - } - else - { - if (!DuplicateHandle(GetCurrentProcess(), startInfo.hStdOutput, GetCurrentProcess(), out startInfo.hStdError, 0, true, DuplicateHandleOptions.DUPLICATE_SAME_ACCESS)) - { - throw new Win32Exception(); - } - } - - if (!CreateProcessW(this.exePath, commandLine, IntPtr.Zero, IntPtr.Zero, true, CreateProcessFlags.CREATE_NO_WINDOW, IntPtr.Zero, - currentDirectory, ref startInfo, ref processInfo)) - { - throw new Win32Exception(); - } - - startInfo.Dispose(); - - return GetResultFromNative(mergeErrorIntoOutput, hStdOutputParent, hStdErrorParent, processInfo.hProcess, this.exePath, args); - } - finally - { - hStdErrorParent?.Dispose(); - hStdOutputParent?.Dispose(); - - startInfo.Dispose(); - processInfo.Dispose(); - } - } - - private static ExternalExecutableResult GetResultFromNative(bool mergeErrorIntoOutput, SafeFileHandle hStdOutputParent, SafeFileHandle hStdErrorParent, IntPtr hProcess, string fileName, string args) - { - using (var outputStream = new StreamReader(new FileStream(hStdOutputParent, FileAccess.Read))) - using (var errorStream = mergeErrorIntoOutput ? null : new StreamReader(new FileStream(hStdErrorParent, FileAccess.Read))) - { - var outputTask = Task.Run(() => ReadProcessStreamLines(outputStream)); - var errorTask = Task.Run(() => ReadProcessStreamLines(errorStream)); - - while (!outputTask.Wait(100) || !errorTask.Wait(100)) { Task.Yield(); } - var standardOutput = outputTask.Result; - var standardError = errorTask.Result; - - if (WaitForSingleObject(hProcess, -1) != 0) - { - throw new Win32Exception(); - } - - if (!GetExitCodeProcess(hProcess, out var exitCode)) - { - throw new Win32Exception(); - } - - return new ExternalExecutableResult - { - ExitCode = exitCode, - StandardError = standardError, - StandardOutput = standardOutput, - FileName = fileName, - Arguments = args, - }; - } - } - - private static string[] ReadProcessStreamLines(StreamReader streamReader) - { - if (streamReader == null) - { - return null; - } - - var lines = new List(); - while (true) - { - var line = streamReader.ReadLine(); - if (line == null) - { - break; - } - - lines.Add(line); - } - - return lines.ToArray(); - } - - protected ExternalExecutableResult RunManaged(string args, bool mergeErrorIntoOutput = false, string workingDirectory = null) - { - var startInfo = new ProcessStartInfo(this.exePath, args) - { - CreateNoWindow = true, - RedirectStandardError = true, - RedirectStandardOutput = true, - UseShellExecute = false, - WorkingDirectory = workingDirectory ?? Path.GetDirectoryName(this.exePath), - }; - - using (var process = Process.Start(startInfo)) - { - // This implementation of merging the streams does not guarantee that lines are retrieved in the same order that they were written. - // If the process is simultaneously writing to both streams, this is impossible to do anyway. - var standardOutput = new ConcurrentQueue(); - var standardError = mergeErrorIntoOutput ? standardOutput : new ConcurrentQueue(); - - process.ErrorDataReceived += (s, e) => { if (e.Data != null) { standardError.Enqueue(e.Data); } }; - process.OutputDataReceived += (s, e) => { if (e.Data != null) { standardOutput.Enqueue(e.Data); } }; - - process.BeginErrorReadLine(); - process.BeginOutputReadLine(); - - process.WaitForExit(); - - return new ExternalExecutableResult - { - ExitCode = process.ExitCode, - StandardError = mergeErrorIntoOutput ? null : standardError.ToArray(), - StandardOutput = standardOutput.ToArray(), - FileName = this.exePath, - Arguments = args, - }; - } - } - - // This is internal because it assumes backslashes aren't used as escape characters and there aren't any double quotes. - internal static string CombineArguments(IEnumerable arguments) - { - if (arguments == null) - { - return null; - } - - var sb = new StringBuilder(); - - foreach (var arg in arguments) - { - if (sb.Length > 0) - { - sb.Append(' '); - } - - if (arg.IndexOf(' ') > -1) - { - sb.Append("\""); - sb.Append(arg); - sb.Append("\""); - } - else - { - sb.Append(arg); - } - } - - return sb.ToString(); - } - - private static void CreatePipeForProcess(out SafeFileHandle hReadPipe, out IntPtr hWritePipe) - { - var securityAttributes = new SECURITY_ATTRIBUTES - { - nLength = Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES)), - bInheritHandle = true, - }; - - if (!CreatePipe(out var hReadTemp, out hWritePipe, ref securityAttributes, 0)) - { - throw new Win32Exception(); - } - - // Only the handle passed to the process should be inheritable, so have to duplicate the other handle to get an uninheritable one. - if (!DuplicateHandle(GetCurrentProcess(), hReadTemp, GetCurrentProcess(), out var hReadPipePtr, 0, false, DuplicateHandleOptions.DUPLICATE_CLOSE_SOURCE | DuplicateHandleOptions.DUPLICATE_SAME_ACCESS)) - { - throw new Win32Exception(); - } - - hReadPipe = new SafeFileHandle(hReadPipePtr, true); - } - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - private extern static IntPtr GetStdHandle(StdHandleType nStdHandle); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private extern static bool CreatePipe(out IntPtr hReadPipe, out IntPtr hWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private extern static bool CreateProcessW( - string lpApplicationName, - string lpCommandLine, - IntPtr lpProcessAttributes, - IntPtr lpThreadAttributes, - [MarshalAs(UnmanagedType.Bool)] bool bInheritHandles, - CreateProcessFlags dwCreationFlags, - IntPtr lpEnvironment, - string lpCurrentDirectory, - ref STARTUPINFOW lpStartupInfo, - ref PROCESS_INFORMATION lpProcessInformation); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)] - private extern static IntPtr GetCurrentProcess(); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private extern static bool GetExitCodeProcess(IntPtr hHandle, out int lpExitCode); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - private extern static int WaitForSingleObject(IntPtr hHandle, int dwMilliseconds); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private extern static bool CloseHandle(IntPtr hObject); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private extern static bool DuplicateHandle(IntPtr hSourceProcessHandle, IntPtr hSourceHandle, IntPtr hTargetProcessHandle, out IntPtr lpTargetHandle, int dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, DuplicateHandleOptions dwOptions); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - private struct SECURITY_ATTRIBUTES - { - public int nLength; - public IntPtr lpSecurityDescriptor; - [MarshalAs(UnmanagedType.Bool)] - public bool bInheritHandle; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - private struct STARTUPINFOW - { - public int cb; - public string lpReserved; - public string lpDesktop; - public string lpTitle; - public int dwX; - public int dwY; - public int dwXSize; - public int dwYSize; - public int dwXCountChars; - public int dwYCountChars; - public int dwFillAttribute; - public StartupInfoFlags dwFlags; - public short wShowWindow; - public short cbReserved2; - public IntPtr lpReserved2; - public IntPtr hStdInput; - public IntPtr hStdOutput; - public IntPtr hStdError; - - public void Dispose() - { - // This makes assumptions based on how it's used above. - if (this.hStdError != IntPtr.Zero) - { - CloseHandle(this.hStdError); - this.hStdError = IntPtr.Zero; - } - - if (this.hStdOutput != IntPtr.Zero) - { - CloseHandle(this.hStdOutput); - this.hStdOutput = IntPtr.Zero; - } - } - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - private struct PROCESS_INFORMATION - { - public IntPtr hProcess; - public IntPtr hThread; - public int dwProcessId; - public int dwThreadId; - - public void Dispose() - { - if (this.hProcess != IntPtr.Zero) - { - CloseHandle(this.hProcess); - this.hProcess = IntPtr.Zero; - } - - if (this.hThread != IntPtr.Zero) - { - CloseHandle(this.hThread); - this.hThread = IntPtr.Zero; - } - } - } - - private enum StdHandleType - { - STD_INPUT_HANDLE = -10, - STD_OUTPUT_HANDLE = -11, - STD_ERROR_HANDLE = -12, - } - - [Flags] - private enum CreateProcessFlags - { - None = 0x0, - CREATE_NO_WINDOW = 0x08000000, - } - - [Flags] - private enum StartupInfoFlags - { - None = 0x0, - STARTF_FORCEOFFFEEDBACK = 0x80, - STARTF_USESTDHANDLES = 0x100, - } - - private enum DuplicateHandleOptions - { - DUPLICATE_CLOSE_SOURCE = 1, - DUPLICATE_SAME_ACCESS = 2, - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/ExternalExecutableResult.cs b/src/internal/WixBuildTools.TestSupport/ExternalExecutableResult.cs deleted file mode 100644 index 950ee4bd..00000000 --- a/src/internal/WixBuildTools.TestSupport/ExternalExecutableResult.cs +++ /dev/null @@ -1,19 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System.Diagnostics; - - public class ExternalExecutableResult - { - public int ExitCode { get; set; } - - public string[] StandardError { get; set; } - - public string[] StandardOutput { get; set; } - - public string FileName { get; set; } - - public string Arguments { get; set; } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/FakeBuildEngine.cs b/src/internal/WixBuildTools.TestSupport/FakeBuildEngine.cs deleted file mode 100644 index 20545970..00000000 --- a/src/internal/WixBuildTools.TestSupport/FakeBuildEngine.cs +++ /dev/null @@ -1,33 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System.Collections; - using System.Text; - using Microsoft.Build.Framework; - - public class FakeBuildEngine : IBuildEngine - { - private readonly StringBuilder output = new StringBuilder(); - - public int ColumnNumberOfTaskNode => 0; - - public bool ContinueOnError => false; - - public int LineNumberOfTaskNode => 0; - - public string ProjectFileOfTaskNode => "fake_wix.targets"; - - public string Output => this.output.ToString(); - - public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) => throw new System.NotImplementedException(); - - public void LogCustomEvent(CustomBuildEventArgs e) => this.output.AppendLine(e.Message); - - public void LogErrorEvent(BuildErrorEventArgs e) => this.output.AppendLine(e.Message); - - public void LogMessageEvent(BuildMessageEventArgs e) => this.output.AppendLine(e.Message); - - public void LogWarningEvent(BuildWarningEventArgs e) => this.output.AppendLine(e.Message); - } -} diff --git a/src/internal/WixBuildTools.TestSupport/MsbuildRunner.cs b/src/internal/WixBuildTools.TestSupport/MsbuildRunner.cs deleted file mode 100644 index ac7caf0e..00000000 --- a/src/internal/WixBuildTools.TestSupport/MsbuildRunner.cs +++ /dev/null @@ -1,112 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.Collections.Generic; - using System.IO; - - public class MsbuildRunner : ExternalExecutable - { - private static readonly string VswhereFindArguments = "-property installationPath -version [17.0,18.0)"; - private static readonly string MsbuildCurrentRelativePath = @"MSBuild\Current\Bin\MSBuild.exe"; - private static readonly string MsbuildCurrentRelativePath64 = @"MSBuild\Current\Bin\amd64\MSBuild.exe"; - - private static readonly object InitLock = new object(); - - private static bool Initialized; - private static MsbuildRunner MsbuildCurrentRunner; - private static MsbuildRunner MsbuildCurrentRunner64; - - public static MsbuildRunnerResult Execute(string projectPath, string[] arguments = null, bool x64 = false) => - InitAndExecute(String.Empty, projectPath, arguments, x64); - - public static MsbuildRunnerResult ExecuteWithMsbuildCurrent(string projectPath, string[] arguments = null, bool x64 = false) => - InitAndExecute("Current", projectPath, arguments, x64); - - private static MsbuildRunnerResult InitAndExecute(string msbuildVersion, string projectPath, string[] arguments, bool x64) - { - lock (InitLock) - { - if (!Initialized) - { - Initialized = true; - var vswhereResult = VswhereRunner.Execute(VswhereFindArguments, true); - if (vswhereResult.ExitCode != 0) - { - throw new InvalidOperationException($"Failed to execute vswhere.exe, exit code: {vswhereResult.ExitCode}. Output:\r\n{String.Join("\r\n", vswhereResult.StandardOutput)}"); - } - - string msbuildCurrentPath = null; - string msbuildCurrentPath64 = null; - - foreach (var installPath in vswhereResult.StandardOutput) - { - if (msbuildCurrentPath == null) - { - var path = Path.Combine(installPath, MsbuildCurrentRelativePath); - if (File.Exists(path)) - { - msbuildCurrentPath = path; - } - } - - if (msbuildCurrentPath64 == null) - { - var path = Path.Combine(installPath, MsbuildCurrentRelativePath64); - if (File.Exists(path)) - { - msbuildCurrentPath64 = path; - } - } - } - - if (msbuildCurrentPath != null) - { - MsbuildCurrentRunner = new MsbuildRunner(msbuildCurrentPath); - } - - if (msbuildCurrentPath64 != null) - { - MsbuildCurrentRunner64 = new MsbuildRunner(msbuildCurrentPath64); - } - } - } - - MsbuildRunner runner = x64 ? MsbuildCurrentRunner64 : MsbuildCurrentRunner; - - if (runner == null) - { - throw new InvalidOperationException($"Failed to find an installed{(x64 ? " 64-bit" : String.Empty)} MSBuild{msbuildVersion}"); - } - - return runner.ExecuteCore(projectPath, arguments); - } - - private MsbuildRunner(string exePath) : base(exePath) { } - - private MsbuildRunnerResult ExecuteCore(string projectPath, string[] arguments) - { - var total = new List - { - projectPath, - }; - - if (arguments != null) - { - total.AddRange(arguments); - } - - var args = CombineArguments(total); - var mergeErrorIntoOutput = true; - var workingFolder = Path.GetDirectoryName(projectPath); - var result = this.Run(args, mergeErrorIntoOutput, workingFolder); - - return new MsbuildRunnerResult - { - ExitCode = result.ExitCode, - Output = result.StandardOutput, - }; - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/MsbuildRunnerResult.cs b/src/internal/WixBuildTools.TestSupport/MsbuildRunnerResult.cs deleted file mode 100644 index fb61122d..00000000 --- a/src/internal/WixBuildTools.TestSupport/MsbuildRunnerResult.cs +++ /dev/null @@ -1,19 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using Xunit; - - public class MsbuildRunnerResult - { - public int ExitCode { get; set; } - - public string[] Output { get; set; } - - public void AssertSuccess() - { - Assert.True(0 == this.ExitCode, $"MSBuild failed unexpectedly. Output:{Environment.NewLine}{String.Join(Environment.NewLine, this.Output)}"); - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs b/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs deleted file mode 100644 index 3271cc20..00000000 --- a/src/internal/WixBuildTools.TestSupport/MsbuildUtilities.cs +++ /dev/null @@ -1,101 +0,0 @@ -// 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. - -namespace WixToolsetTest.Sdk -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - - public enum BuildSystem - { - DotNetCoreSdk, - MSBuild, - MSBuild64, - } - - public static class MsbuildUtilities - { - public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", string verbosityLevel = "normal", bool suppressValidation = true) - { - var allArgs = new List - { - $"-verbosity:{verbosityLevel}", - $"-p:Configuration={configuration}", - $"-p:SuppressValidation={suppressValidation}", - // Node reuse means that child msbuild processes can stay around after the build completes. - // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. - "-nr:false", - $"-bl:{Path.ChangeExtension(projectPath, ".binlog")}" - }; - - if (arguments != null) - { - allArgs.AddRange(arguments); - } - - switch (buildSystem) - { - case BuildSystem.DotNetCoreSdk: - { - allArgs.Add(projectPath); - var result = DotnetRunner.Execute("msbuild", allArgs.ToArray()); - return new MsbuildRunnerResult - { - ExitCode = result.ExitCode, - Output = result.StandardOutput, - }; - } - case BuildSystem.MSBuild: - case BuildSystem.MSBuild64: - { - return MsbuildRunner.Execute(projectPath, allArgs.ToArray(), buildSystem == BuildSystem.MSBuild64); - } - default: - { - throw new NotImplementedException(); - } - } - } - - public static string GetQuotedPropertySwitch(BuildSystem buildSystem, string propertyName, string valueToQuote) - { - switch (buildSystem) - { - case BuildSystem.DotNetCoreSdk: - { - // If the value ends with a backslash, double-escape it (it should end up with four backslashes). - if (valueToQuote?.EndsWith("\\") == true) - { - valueToQuote += @"\\\"; - } - - return $"-p:{propertyName}=\\\"{valueToQuote}\\\""; - } - case BuildSystem.MSBuild: - case BuildSystem.MSBuild64: - { - // If the value ends with a backslash, escape it. - if (valueToQuote?.EndsWith("\\") == true) - { - valueToQuote += @"\"; - } - - return $"-p:{propertyName}=\"{valueToQuote}\""; - } - default: - { - throw new NotImplementedException(); - } - } - } - - public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem) - { - var expectedToolExe = buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; - var expectedToolCommand = $"{expectedToolExe} {operation}"; - return result.Output.Where(line => line.Contains(expectedToolCommand)); - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/Pushd.cs b/src/internal/WixBuildTools.TestSupport/Pushd.cs deleted file mode 100644 index d0545215..00000000 --- a/src/internal/WixBuildTools.TestSupport/Pushd.cs +++ /dev/null @@ -1,46 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.IO; - - public class Pushd : IDisposable - { - protected bool Disposed { get; private set; } - - public Pushd(string path) - { - this.PreviousDirectory = Directory.GetCurrentDirectory(); - - Directory.SetCurrentDirectory(path); - } - - public string PreviousDirectory { get; } - - #region // IDisposable - - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (this.Disposed) - { - return; - } - - if (disposing) - { - Directory.SetCurrentDirectory(this.PreviousDirectory); - } - - this.Disposed = true; - } - - #endregion - } -} diff --git a/src/internal/WixBuildTools.TestSupport/Query.cs b/src/internal/WixBuildTools.TestSupport/Query.cs deleted file mode 100644 index 101a8890..00000000 --- a/src/internal/WixBuildTools.TestSupport/Query.cs +++ /dev/null @@ -1,172 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Text; - using WixToolset.Dtf.Compression.Cab; - using WixToolset.Dtf.WindowsInstaller; - - public class Query - { - public static string[] QueryDatabase(string path, string[] tables) - { - var results = new List(); - var resultsByTable = QueryDatabaseByTable(path, tables); - var sortedTables = tables.ToList(); - sortedTables.Sort(); - foreach (var tableName in sortedTables) - { - var rows = resultsByTable[tableName]; - rows?.ForEach(r => results.Add($"{tableName}:{r}")); - } - return results.ToArray(); - } - - /// - /// Returns rows from requested tables formatted to facilitate testing. - /// If the table did not exist in the database, its list will be null. - /// - /// - /// - /// - public static Dictionary> QueryDatabaseByTable(string path, string[] tables) - { - var results = new Dictionary>(); - - if (tables?.Length > 0) - { - var sb = new StringBuilder(); - using (var db = new Database(path)) - { - foreach (var table in tables) - { - if (table == "_SummaryInformation") - { - var entries = new List(); - results.Add(table, entries); - - entries.Add($"Title\t{db.SummaryInfo.Title}"); - entries.Add($"Subject\t{db.SummaryInfo.Subject}"); - entries.Add($"Author\t{db.SummaryInfo.Author}"); - entries.Add($"Keywords\t{db.SummaryInfo.Keywords}"); - entries.Add($"Comments\t{db.SummaryInfo.Comments}"); - entries.Add($"Template\t{db.SummaryInfo.Template}"); - entries.Add($"CodePage\t{db.SummaryInfo.CodePage}"); - entries.Add($"PageCount\t{db.SummaryInfo.PageCount}"); - entries.Add($"WordCount\t{db.SummaryInfo.WordCount}"); - entries.Add($"CharacterCount\t{db.SummaryInfo.CharacterCount}"); - entries.Add($"Security\t{db.SummaryInfo.Security}"); - - continue; - } - - if (!db.IsTablePersistent(table)) - { - results.Add(table, null); - continue; - } - - var rows = new List(); - results.Add(table, rows); - - using (var view = db.OpenView("SELECT * FROM `{0}`", table)) - { - view.Execute(); - - Record record; - while ((record = view.Fetch()) != null) - { - sb.Clear(); - - using (record) - { - for (var i = 0; i < record.FieldCount; ++i) - { - if (i > 0) - { - sb.Append("\t"); - } - - sb.Append(record[i + 1]?.ToString()); - } - } - - rows.Add(sb.ToString()); - } - } - rows.Sort(); - } - } - } - - return results; - } - - public static CabFileInfo[] GetCabinetFiles(string path) - { - var cab = new CabInfo(path); - - var result = cab.GetFiles(); - - return result.Select(c => c).ToArray(); - } - - public static void ExtractStream(string path, string streamName, string outputPath) - { - Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); - - using (var db = new Database(path)) - using (var view = db.OpenView("SELECT `Data` FROM `_Streams` WHERE `Name` = '{0}'", streamName)) - { - view.Execute(); - - using (var record = view.Fetch()) - { - record.GetStream(1, outputPath); - } - } - } - - public static void ExtractSubStorage(string path, string subStorageName, string outputPath) - { - Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); - - using (var db = new Database(path)) - using (var view = db.OpenView("SELECT `Name`, `Data` FROM `_Storages` WHERE `Name` = '{0}'", subStorageName)) - { - view.Execute(); - - using (var record = view.Fetch()) - { - var name = record.GetString(1); - record.GetStream(2, outputPath); - } - } - } - - public static string[] GetSubStorageNames(string path) - { - var result = new List(); - - using (var db = new Database(path)) - using (var view = db.OpenView("SELECT `Name` FROM `_Storages`")) - { - view.Execute(); - - Record record; - while ((record = view.Fetch()) != null) - { - var name = record.GetString(1); - result.Add(name); - } - } - - result.Sort(); - return result.ToArray(); - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/RobocopyRunner.cs b/src/internal/WixBuildTools.TestSupport/RobocopyRunner.cs deleted file mode 100644 index 49d53351..00000000 --- a/src/internal/WixBuildTools.TestSupport/RobocopyRunner.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - public class RobocopyRunner : ExternalExecutable - { - private static readonly RobocopyRunner Instance = new RobocopyRunner(); - - private RobocopyRunner() : base("robocopy") { } - - public static ExternalExecutableResult Execute(string args) - { - return Instance.Run(args); - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/TestData.cs b/src/internal/WixBuildTools.TestSupport/TestData.cs deleted file mode 100644 index fc1ae4cc..00000000 --- a/src/internal/WixBuildTools.TestSupport/TestData.cs +++ /dev/null @@ -1,78 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.IO; - using System.Reflection; - using System.Runtime.CompilerServices; - - public class TestData - { - public static void CreateFile(string path, long size, bool fill = false) - { - // Ensure the directory exists. - path = Path.GetFullPath(path); - Directory.CreateDirectory(Path.GetDirectoryName(path)); - - using (var file = File.OpenWrite(path)) - { - if (fill) - { - var random = new Random(); - var bytes = new byte[4096]; - var generated = 0L; - - // Put fill bytes in the file so it doesn't compress trivially. - while (generated < size) - { - var generate = (int)Math.Min(size - generated, bytes.Length); - - random.NextBytes(bytes); - - file.Write(bytes, 0, generate); - - generated += generate; - } - } - else - { - file.SetLength(size); - } - } - } - - public static string Get(params string[] paths) - { - var localPath = Path.GetDirectoryName(new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath); - return Path.Combine(localPath, Path.Combine(paths)); - } - - public static string GetUnitTestLogsFolder([CallerFilePath] string path = "", [CallerMemberName] string method = "") - { - var startingPath = Path.GetDirectoryName(new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath); - var buildPath = startingPath; - - while (!String.IsNullOrEmpty(buildPath)) - { - var folderName = Path.GetFileName(buildPath); - if (String.Equals("build", folderName, StringComparison.OrdinalIgnoreCase)) - { - break; - } - - buildPath = Path.GetDirectoryName(buildPath); - } - - if (String.IsNullOrEmpty(buildPath)) - { - throw new InvalidOperationException($"Could not find the 'build' folder in the test path: {startingPath}. Cannot get test logs folder without being able to find the build folder."); - } - - var testLogsFolder = Path.Combine(buildPath, "logs", "UnitTests", $"{Path.GetFileNameWithoutExtension(path)}_{method}"); - Directory.CreateDirectory(testLogsFolder); - - return testLogsFolder; - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs b/src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs deleted file mode 100644 index 15b7631d..00000000 --- a/src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - - /// - /// This class builds on top of DisposableFileSystem - /// to make it easy to write a test that needs a whole folder of test data copied to a temp location - /// that will automatically be cleaned up at the end of the test. - /// - public class TestDataFolderFileSystem : IDisposable - { - private DisposableFileSystem fileSystem; - - public string BaseFolder { get; private set; } - - public void Dispose() - { - this.fileSystem?.Dispose(); - } - - public void Initialize(string sourceDirectoryPath) - { - if (this.fileSystem != null) - { - throw new InvalidOperationException(); - } - this.fileSystem = new DisposableFileSystem(); - - this.BaseFolder = this.fileSystem.GetFolder(); - - RobocopyFolder(sourceDirectoryPath, this.BaseFolder); - } - - public static ExternalExecutableResult RobocopyFolder(string sourceFolderPath, string destinationFolderPath) - { - var args = $"\"{sourceFolderPath}\" \"{destinationFolderPath}\" /E /R:1 /W:1"; - return RobocopyRunner.Execute(args); - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/VswhereRunner.cs b/src/internal/WixBuildTools.TestSupport/VswhereRunner.cs deleted file mode 100644 index 0197e125..00000000 --- a/src/internal/WixBuildTools.TestSupport/VswhereRunner.cs +++ /dev/null @@ -1,41 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.IO; - - public class VswhereRunner : ExternalExecutable - { - private static readonly string VswhereRelativePath = @"Microsoft Visual Studio\Installer\vswhere.exe"; - - private static readonly object InitLock = new object(); - private static bool Initialized; - private static VswhereRunner Instance; - - public static ExternalExecutableResult Execute(string args, bool mergeErrorIntoOutput = false) => - InitAndExecute(args, mergeErrorIntoOutput); - - private static ExternalExecutableResult InitAndExecute(string args, bool mergeErrorIntoOutput) - { - lock (InitLock) - { - if (!Initialized) - { - Initialized = true; - var vswherePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), VswhereRelativePath); - if (!File.Exists(vswherePath)) - { - throw new InvalidOperationException($"Failed to find vswhere at: {vswherePath}"); - } - - Instance = new VswhereRunner(vswherePath); - } - } - - return Instance.Run(args, mergeErrorIntoOutput); - } - - private VswhereRunner(string exePath) : base(exePath) { } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/WixBuildTools.TestSupport.csproj b/src/internal/WixBuildTools.TestSupport/WixBuildTools.TestSupport.csproj deleted file mode 100644 index 4e1c3c26..00000000 --- a/src/internal/WixBuildTools.TestSupport/WixBuildTools.TestSupport.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - netstandard2.0;net472 - true - embedded - true - true - $(NoWarn);CS1591 - false - true - - - - - - - - - - - - - diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkipTestException.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkipTestException.cs deleted file mode 100644 index bd7d23f9..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkipTestException.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport.XunitExtensions -{ - using System; - - public class SkipTestException : Exception - { - public SkipTestException(string reason) - : base(reason) - { - - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactAttribute.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactAttribute.cs deleted file mode 100644 index 4974d489..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactAttribute.cs +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport.XunitExtensions -{ - using Xunit; - using Xunit.Sdk; - - // https://github.com/xunit/samples.xunit/blob/5dc1d35a63c3394a8678ac466b882576a70f56f6/DynamicSkipExample - [XunitTestCaseDiscoverer("WixBuildTools.TestSupport.XunitExtensions.SkippableFactDiscoverer", "WixBuildTools.TestSupport")] - public class SkippableFactAttribute : FactAttribute - { - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs deleted file mode 100644 index b692c912..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs +++ /dev/null @@ -1,23 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport.XunitExtensions -{ - using System.Collections.Generic; - using Xunit.Abstractions; - using Xunit.Sdk; - - public class SkippableFactDiscoverer : IXunitTestCaseDiscoverer - { - private IMessageSink DiagnosticMessageSink { get; } - - public SkippableFactDiscoverer(IMessageSink diagnosticMessageSink) - { - this.DiagnosticMessageSink = diagnosticMessageSink; - } - - public IEnumerable Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute) - { - yield return new SkippableFactTestCase(this.DiagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), discoveryOptions.MethodDisplayOptionsOrDefault(), testMethod); - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactMessageBus.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactMessageBus.cs deleted file mode 100644 index 6d01889e..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactMessageBus.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport.XunitExtensions -{ - using System.Linq; - using Xunit.Abstractions; - using Xunit.Sdk; - - public class SkippableFactMessageBus : IMessageBus - { - private IMessageBus InnerBus { get; } - - public SkippableFactMessageBus(IMessageBus innerBus) - { - this.InnerBus = innerBus; - } - - public int DynamicallySkippedTestCount { get; private set; } - - public void Dispose() - { - } - - public bool QueueMessage(IMessageSinkMessage message) - { - if (message is ITestFailed testFailed) - { - var exceptionType = testFailed.ExceptionTypes.FirstOrDefault(); - if (exceptionType == typeof(SkipTestException).FullName) - { - ++this.DynamicallySkippedTestCount; - return this.InnerBus.QueueMessage(new TestSkipped(testFailed.Test, testFailed.Messages.FirstOrDefault())); - } - } - - // Nothing we care about, send it on its way - return this.InnerBus.QueueMessage(message); - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactTestCase.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactTestCase.cs deleted file mode 100644 index f13fec83..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactTestCase.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport.XunitExtensions -{ - using System; - using System.ComponentModel; - using System.Threading; - using System.Threading.Tasks; - using Xunit.Abstractions; - using Xunit.Sdk; - - public class SkippableFactTestCase : XunitTestCase - { - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Called by the de-serializer; should only be called by deriving classes for de-serialization purposes")] - public SkippableFactTestCase() { } - - public SkippableFactTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod, object[] testMethodArguments = null) - : base(diagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testMethod, testMethodArguments) - { - } - - public override async Task RunAsync(IMessageSink diagnosticMessageSink, - IMessageBus messageBus, - object[] constructorArguments, - ExceptionAggregator aggregator, - CancellationTokenSource cancellationTokenSource) - { - var skipMessageBus = new SkippableFactMessageBus(messageBus); - var result = await base.RunAsync(diagnosticMessageSink, skipMessageBus, constructorArguments, aggregator, cancellationTokenSource); - if (skipMessageBus.DynamicallySkippedTestCount > 0) - { - result.Failed -= skipMessageBus.DynamicallySkippedTestCount; - result.Skipped += skipMessageBus.DynamicallySkippedTestCount; - } - - return result; - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs deleted file mode 100644 index e026bb59..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport.XunitExtensions -{ - using Xunit; - using Xunit.Sdk; - - [XunitTestCaseDiscoverer("WixBuildTools.TestSupport.XunitExtensions.SkippableFactDiscoverer", "WixBuildTools.TestSupport")] - public class SkippableTheoryAttribute : TheoryAttribute - { - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs deleted file mode 100644 index cf4e2b43..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs +++ /dev/null @@ -1,41 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport.XunitExtensions -{ - using System.Collections.Generic; - using Xunit.Abstractions; - using Xunit.Sdk; - - public class SkippableTheoryDiscoverer : IXunitTestCaseDiscoverer - { - private IMessageSink DiagnosticMessageSink { get; } - private TheoryDiscoverer TheoryDiscoverer { get; } - - public SkippableTheoryDiscoverer(IMessageSink diagnosticMessageSink) - { - this.DiagnosticMessageSink = diagnosticMessageSink; - - this.TheoryDiscoverer = new TheoryDiscoverer(diagnosticMessageSink); - } - - public IEnumerable Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute) - { - var defaultMethodDisplay = discoveryOptions.MethodDisplayOrDefault(); - var defaultMethodDisplayOptions = discoveryOptions.MethodDisplayOptionsOrDefault(); - - // Unlike fact discovery, the underlying algorithm for theories is complex, so we let the theory discoverer - // do its work, and do a little on-the-fly conversion into our own test cases. - foreach (var testCase in this.TheoryDiscoverer.Discover(discoveryOptions, testMethod, factAttribute)) - { - if (testCase is XunitTheoryTestCase) - { - yield return new SkippableTheoryTestCase(this.DiagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testCase.TestMethod); - } - else - { - yield return new SkippableFactTestCase(this.DiagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testCase.TestMethod, testCase.TestMethodArguments); - } - } - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs deleted file mode 100644 index 3299fe7e..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs +++ /dev/null @@ -1,41 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport.XunitExtensions -{ - using System; - using System.ComponentModel; - using System.Threading; - using System.Threading.Tasks; - using Xunit.Abstractions; - using Xunit.Sdk; - - public class SkippableTheoryTestCase : XunitTheoryTestCase - { - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Called by the de-serializer; should only be called by deriving classes for de-serialization purposes")] - public SkippableTheoryTestCase() { } - - public SkippableTheoryTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod) - : base(diagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testMethod) - { - } - - public override async Task RunAsync(IMessageSink diagnosticMessageSink, - IMessageBus messageBus, - object[] constructorArguments, - ExceptionAggregator aggregator, - CancellationTokenSource cancellationTokenSource) - { - // Duplicated code from SkippableFactTestCase. I'm sure we could find a way to de-dup with some thought. - var skipMessageBus = new SkippableFactMessageBus(messageBus); - var result = await base.RunAsync(diagnosticMessageSink, skipMessageBus, constructorArguments, aggregator, cancellationTokenSource); - if (skipMessageBus.DynamicallySkippedTestCount > 0) - { - result.Failed -= skipMessageBus.DynamicallySkippedTestCount; - result.Skipped += skipMessageBus.DynamicallySkippedTestCount; - } - - return result; - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs deleted file mode 100644 index c703e90a..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using Xunit.Sdk; - - public class SpecificReturnCodeException : XunitException - { - public SpecificReturnCodeException(int hrExpected, int hr, string userMessage) - : base(String.Format("WixAssert.SpecificReturnCode() Failure\r\n" + - "Expected HRESULT: 0x{0:X8}\r\n" + - "Actual HRESULT: 0x{1:X8}\r\n" + - "Message: {2}", - hrExpected, hr, userMessage)) - { - this.HResult = hr; - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SucceededException.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SucceededException.cs deleted file mode 100644 index 704fba28..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SucceededException.cs +++ /dev/null @@ -1,19 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using Xunit.Sdk; - - public class SucceededException : XunitException - { - public SucceededException(int hr, string userMessage) - : base(String.Format("WixAssert.Succeeded() Failure\r\n" + - "HRESULT: 0x{0:X8}\r\n" + - "Message: {1}", - hr, userMessage)) - { - this.HResult = hr; - } - } -} diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs deleted file mode 100644 index a8513bfb..00000000 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs +++ /dev/null @@ -1,201 +0,0 @@ -// 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. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - using System.Xml.Linq; - using WixBuildTools.TestSupport.XunitExtensions; - using Xunit; - using Xunit.Sdk; - - public class WixAssert : Assert - { - public static void CompareLineByLine(string[] expectedLines, string[] actualLines) - { - var lineNumber = 0; - - for (; lineNumber < expectedLines.Length && lineNumber < actualLines.Length; ++lineNumber) - { - WixAssert.StringEqual($"{lineNumber}: {expectedLines[lineNumber]}", $"{lineNumber}: {actualLines[lineNumber]}"); - } - - var additionalExpectedLines = expectedLines.Length > lineNumber ? String.Join(Environment.NewLine, expectedLines.Skip(lineNumber).Select((s, i) => $"{lineNumber + i}: {s}")) : $"Missing {actualLines.Length - lineNumber} lines"; - var additionalActualLines = actualLines.Length > lineNumber ? String.Join(Environment.NewLine, actualLines.Skip(lineNumber).Select((s, i) => $"{lineNumber + i}: {s}")) : $"Missing {expectedLines.Length - lineNumber} lines"; - - Assert.Equal(additionalExpectedLines, additionalActualLines, StringObjectEqualityComparer.InvariantCulture); - } - - public static void CompareXml(XContainer xExpected, XContainer xActual) - { - var expecteds = xExpected.Descendants().Select(x => $"{x.Name.LocalName}:{String.Join(",", x.Attributes().OrderBy(a => a.Name.LocalName).Select(a => $"{a.Name.LocalName}={a.Value}"))}"); - var actuals = xActual.Descendants().Select(x => $"{x.Name.LocalName}:{String.Join(",", x.Attributes().OrderBy(a => a.Name.LocalName).Select(a => $"{a.Name.LocalName}={a.Value}"))}"); - - CompareLineByLine(expecteds.OrderBy(s => s).ToArray(), actuals.OrderBy(s => s).ToArray()); - } - - public static void CompareXml(string expectedPath, string actualPath) - { - var expectedDoc = XDocument.Load(expectedPath, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); - var actualDoc = XDocument.Load(actualPath, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); - - CompareXml(expectedDoc, actualDoc); - } - - /// - /// Dynamically skips the test. - /// Requires that the test was marked with a fact attribute derived from - /// or - /// - public static void Skip(string message) - { - throw new SkipTestException(message); - } - - public static void SpecificReturnCode(int hrExpected, int hr, string format, params object[] formatArgs) - { - if (hrExpected != hr) - { - throw new SpecificReturnCodeException(hrExpected, hr, String.Format(format, formatArgs)); - } - } - - public static void Succeeded(int hr, string format, params object[] formatArgs) - { - if (0 > hr) - { - throw new SucceededException(hr, String.Format(format, formatArgs)); - } - } - - public static void StringCollectionEmpty(IList collection) - { - if (collection.Count > 0) - { - Assert.True(false, $"The collection was expected to be empty, but instead was [{Environment.NewLine}\"{String.Join($"\", {Environment.NewLine}\"", collection)}\"{Environment.NewLine}]"); - } - } - - public static void StringEqual(string expected, string actual, bool ignoreCase = false) - { - WixStringEqualException.ThrowIfNotEqual(expected, actual, ignoreCase); - } - - public static void NotStringEqual(string expected, string actual, bool ignoreCase = false) - { - var comparer = ignoreCase ? StringObjectEqualityComparer.InvariantCultureIgnoreCase : StringObjectEqualityComparer.InvariantCulture; - Assert.NotEqual(expected, actual, comparer); - } - - // There appears to have been a bug in VC++, which might or might not have been partially - // or completely corrected. It was unable to disambiguate a call to: - // Xunit::Assert::Throws(System::Type^, System::Action^) - // from a call to: - // Xunit::Assert::Throws(System::Type^, System::Func^) - // that implicitly ignores its return value. - // - // The ambiguity may have been reported by some versions of the compiler and not by others. - // Some versions of the compiler may not have emitted any code in this situation, making it - // appear that the test has passed when, in fact, it hasn't been run. - // - // This situation is not an issue for C#. - // - // The following method is used to isolate DUtilTests in order to overcome the above problem. - - /// - /// This shim allows C++/CLR code to call the Xunit method with the same signature - /// without getting an ambiguous overload error. If the specified test code - /// fails to generate an exception of the exact specified type, an assertion - /// exception is thrown. Otherwise, execution flow proceeds as normal. - /// - /// The type name of the expected exception. - /// An Action delegate to run the test code. - public static new void Throws(System.Action testCode) - where T : System.Exception - { - Xunit.Assert.Throws(testCode); - } - - // This shim has been tested, but is not currently used anywhere. It was provided - // at the same time as the preceding shim because it involved the same overload - // resolution conflict. - - /// - /// This shim allows C++/CLR code to call the Xunit method with the same signature - /// without getting an ambiguous overload error. If the specified test code - /// fails to generate an exception of the exact specified type, an assertion - /// exception is thrown. Otherwise, execution flow proceeds as normal. - /// - /// The type object associated with exceptions of the expected type. - /// An Action delegate to run the test code. - /// An exception of a type other than the type specified, is such an exception is thrown. - public static new System.Exception Throws(System.Type exceptionType, System.Action testCode) - { - return Xunit.Assert.Throws(exceptionType, testCode); - } - } - - internal class StringObjectEqualityComparer : IEqualityComparer - { - public static readonly StringObjectEqualityComparer InvariantCultureIgnoreCase = new StringObjectEqualityComparer(true); - public static readonly StringObjectEqualityComparer InvariantCulture = new StringObjectEqualityComparer(false); - - private readonly StringComparer stringComparer; - - public StringObjectEqualityComparer(bool ignoreCase) - { - this.stringComparer = ignoreCase ? StringComparer.InvariantCultureIgnoreCase : StringComparer.InvariantCulture; - } - - public new bool Equals(object x, object y) - { - return this.stringComparer.Equals((string)x, (string)y); - } - - public int GetHashCode(object obj) - { - return this.stringComparer.GetHashCode((string)obj); - } - } - - public class WixStringEqualException : XunitException - { - public WixStringEqualException(string userMessage) : base(userMessage) { } - - public static void ThrowIfNotEqual(string expected, string actual, bool ignoreCase) - { - var comparer = ignoreCase ? StringObjectEqualityComparer.InvariantCultureIgnoreCase : StringObjectEqualityComparer.InvariantCulture; - if (comparer.Equals(expected, actual)) - { - return; - } - - var sbMessage = new StringBuilder(); - - try - { - Assert.Equal(expected, actual, ignoreCase); - } - catch (XunitException xe) - { - // If either string is not completely in the message, then make sure it gets in there. - if (!xe.Message.Contains(expected) || !xe.Message.Contains(actual)) - { - sbMessage.AppendLine(xe.Message); - sbMessage.AppendLine(); - sbMessage.AppendFormat("Expected: {0}", expected); - sbMessage.AppendLine(); - sbMessage.AppendFormat("Actual: {0}", actual); - } - else - { - throw; - } - } - - throw new WixStringEqualException(sbMessage.ToString()); - } - } -} diff --git a/src/internal/WixInternal.BaseBuildTasks.Sources/BaseToolsetTask.cs b/src/internal/WixInternal.BaseBuildTasks.Sources/BaseToolsetTask.cs new file mode 100644 index 00000000..d9e3b5e8 --- /dev/null +++ b/src/internal/WixInternal.BaseBuildTasks.Sources/BaseToolsetTask.cs @@ -0,0 +1,178 @@ +// 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. + +namespace WixToolset.BaseBuildTasks +{ + using System; + using System.IO; + using System.Runtime.InteropServices; + using Microsoft.Build.Utilities; + + public abstract class BaseToolsetTask : ToolTask + { + /// + /// Gets or sets additional options that are appended the the tool command-line. + /// + /// + /// This allows the task to support extended options in the tool which are not + /// explicitly implemented as properties on the task. + /// + public string AdditionalOptions { get; set; } + + /// + /// Gets or sets whether to display the logo. + /// + public bool NoLogo { get; set; } + + /// + /// Gets or sets whether all warnings should be suppressed. + /// + public bool SuppressAllWarnings { get; set; } + + /// + /// Gets or sets a list of specific warnings to be suppressed. + /// + public string[] SuppressSpecificWarnings { get; set; } + + /// + /// Gets or sets whether all warnings should be treated as errors. + /// + public bool TreatWarningsAsErrors { get; set; } + + /// + /// Gets or sets a list of specific warnings to treat as errors. + /// + public string[] TreatSpecificWarningsAsErrors { get; set; } + + /// + /// Gets or sets whether to display verbose output. + /// + public bool VerboseOutput { get; set; } + + /// + /// Get the path to the executable. + /// + /// + /// ToolTask only calls GenerateFullPathToTool when the ToolPath property is not set. + /// WiX never sets the ToolPath property, but the user can through $(WixToolDir). + /// If we return only a file name, ToolTask will search the system paths for it. + /// + protected sealed override string GenerateFullPathToTool() + { + var defaultToolFullPath = this.GetDefaultToolFullPath(); + +#if NETCOREAPP + // If we're pointing at an executable use that. + if (IsSelfExecutable(defaultToolFullPath, out var finalToolFullPath)) + { + return finalToolFullPath; + } + + // Otherwise, use "dotnet.exe" to run an assembly dll. + return Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet"; +#else + return defaultToolFullPath; +#endif + } + + /// + /// Builds a command line from options in this and derivative tasks. + /// + /// + /// Derivative classes should call BuildCommandLine() on the base class to ensure that common command line options are added to the command. + /// + protected virtual void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); + commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); + commandLineBuilder.AppendIfTrue("-sw", this.SuppressAllWarnings); + commandLineBuilder.AppendIfTrue("-v", this.VerboseOutput); + commandLineBuilder.AppendArrayIfNotNull("-wx", this.TreatSpecificWarningsAsErrors); + commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + } + + protected sealed override string GenerateResponseFileCommands() + { + var commandLineBuilder = new WixCommandLineBuilder(); + this.BuildCommandLine(commandLineBuilder); + return commandLineBuilder.ToString(); + } + +#if NETCOREAPP + protected override string GenerateCommandLineCommands() + { + // If the target tool path is an executable, we don't need to add anything to the command-line. + var toolFullPath = this.GetToolFullPath(); + + if (IsSelfExecutable(toolFullPath, out var finalToolFullPath)) + { + return null; + } + else // we're using "dotnet.exe" to run the assembly so add "exec" plus path to the command-line. + { + return $"exec \"{finalToolFullPath}\""; + } + } + + private static bool IsSelfExecutable(string proposedToolFullPath, out string finalToolFullPath) + { + var toolFullPathWithoutExtension = Path.Combine(Path.GetDirectoryName(proposedToolFullPath), Path.GetFileNameWithoutExtension(proposedToolFullPath)); + var exeExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : String.Empty; + var exeToolFullPath = $"{toolFullPathWithoutExtension}{exeExtension}"; + if (File.Exists(exeToolFullPath)) + { + finalToolFullPath = exeToolFullPath; + return true; + } + + finalToolFullPath = $"{toolFullPathWithoutExtension}.dll"; + return false; + } +#else + private static string GetArchitectureFolder(string baseFolder) + { + // First try to find a folder that matches this task's architecture. + var folder = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); + + if (Directory.Exists(Path.Combine(baseFolder, folder))) + { + return folder; + } + + // Try to fallback to "x86" folder. + if (folder != "x86" && Directory.Exists(Path.Combine(baseFolder, "x86"))) + { + return "x86"; + } + + // Return empty, even though this isn't likely to be useful. + return String.Empty; + } +#endif + + private string GetDefaultToolFullPath() + { +#if NETCOREAPP + var thisTaskFolder = Path.GetDirectoryName(typeof(BaseToolsetTask).Assembly.Location); + + return Path.Combine(thisTaskFolder, this.ToolExe); +#else + var thisTaskFolder = Path.GetDirectoryName(new Uri(typeof(BaseToolsetTask).Assembly.CodeBase).AbsolutePath); + + var archFolder = GetArchitectureFolder(thisTaskFolder); + + return Path.Combine(thisTaskFolder, archFolder, this.ToolExe); +#endif + } + + private string GetToolFullPath() + { + if (String.IsNullOrEmpty(this.ToolPath)) + { + return this.GetDefaultToolFullPath(); + } + + return Path.Combine(this.ToolPath, this.ToolExe); + } + } +} diff --git a/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs b/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs new file mode 100644 index 00000000..d950bca9 --- /dev/null +++ b/src/internal/WixInternal.BaseBuildTasks.Sources/WixCommandLineBuilder.cs @@ -0,0 +1,104 @@ +// 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. + +namespace WixToolset.BaseBuildTasks +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// Helper class for appending the command line arguments. + /// + public class WixCommandLineBuilder : CommandLineBuilder + { + internal const int Unspecified = -1; + + /// + /// Append a switch to the command line if the value has been specified. + /// + /// Switch to append. + /// Value specified by the user. + public void AppendIfSpecified(string switchName, int value) + { + if (value != Unspecified) + { + this.AppendSwitchIfNotNull(switchName, value.ToString(CultureInfo.InvariantCulture)); + } + } + + /// + /// Append a switch to the command line if the condition is true. + /// + /// Switch to append. + /// Condition specified by the user. + public void AppendIfTrue(string switchName, bool condition) + { + if (condition) + { + this.AppendSwitch(switchName); + } + } + + /// + /// Append a switch to the command line if any values in the array have been specified. + /// + /// Switch to append. + /// Values specified by the user. + public void AppendArrayIfNotNull(string switchName, IEnumerable values) + { + if (values != null) + { + foreach (ITaskItem value in values) + { + this.AppendSwitchIfNotNull(switchName, value); + } + } + } + + /// + /// Append a switch to the command line if any values in the array have been specified. + /// + /// Switch to append. + /// Values specified by the user. + public void AppendArrayIfNotNull(string switchName, IEnumerable values) + { + if (values != null) + { + foreach (string value in values) + { + this.AppendSwitchIfNotNull(switchName, value); + } + } + } + + /// + /// Append arbitrary text to the command-line if specified. + /// + /// Text to append. + public void AppendTextIfNotNull(string textToAppend) + { + if (!String.IsNullOrEmpty(textToAppend)) + { + this.AppendSpaceIfNotEmpty(); + this.AppendTextUnquoted(textToAppend); + } + } + + /// + /// Append arbitrary text to the command-line if specified. + /// + /// Text to append. + public void AppendTextIfNotWhitespace(string textToAppend) + { + if (!String.IsNullOrWhiteSpace(textToAppend)) + { + this.AppendSpaceIfNotEmpty(); + this.AppendTextUnquoted(textToAppend); + } + } + } +} diff --git a/src/internal/WixInternal.BaseBuildTasks.Sources/WixInternal.BaseBuildTasks.Sources.csproj b/src/internal/WixInternal.BaseBuildTasks.Sources/WixInternal.BaseBuildTasks.Sources.csproj new file mode 100644 index 00000000..6ae5165e --- /dev/null +++ b/src/internal/WixInternal.BaseBuildTasks.Sources/WixInternal.BaseBuildTasks.Sources.csproj @@ -0,0 +1,36 @@ + + + + + + + + netstandard2.0 + WiX Toolset BuildTasks Foundation Sources + true + false + false + contentFiles + true + false + false + CS8021 + true + true + true + + + + + + + + + + + + + + + + diff --git a/src/internal/WixInternal.TestSupport.Native/AssemblyInfo.cpp b/src/internal/WixInternal.TestSupport.Native/AssemblyInfo.cpp new file mode 100644 index 00000000..e1c47dfa --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/AssemblyInfo.cpp @@ -0,0 +1,17 @@ +// 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. + +#include "precomp.h" + +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; +using namespace System::Runtime::InteropServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitleAttribute("WixInternal.TestSupport.Native")]; +[assembly: AssemblyDescriptionAttribute("")]; +[assembly: AssemblyCultureAttribute("")]; +[assembly: ComVisible(false)]; diff --git a/src/internal/WixInternal.TestSupport.Native/NativeAssert.h b/src/internal/WixInternal.TestSupport.Native/NativeAssert.h new file mode 100644 index 00000000..9ca04fea --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/NativeAssert.h @@ -0,0 +1,104 @@ +#pragma once +// 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. + + +namespace WixInternal { +namespace TestSupport { + + using namespace System; + using namespace System::Collections::Generic; + using namespace System::Linq; + using namespace Xunit; + + public ref class NativeAssert : WixAssert + { + public: + static void NotNull(LPCWSTR wz) + { + if (!wz) + { + Assert::NotNull(nullptr); + } + } + + // For some reason, naming these NotStringEqual methods "NotEqual" breaks Intellisense in files that call any overload of the NotEqual method. + static void NotStringEqual(LPCWSTR expected, LPCWSTR actual) + { + NativeAssert::NotStringEqual(expected, actual, FALSE); + } + + static void NotStringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase) + { + WixAssert::NotStringEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), ignoreCase); + } + + // For some reason, naming these StringEqual methods "Equal" breaks Intellisense in files that call any overload of the Equal method. + static void StringEqual(LPCWSTR expected, LPCWSTR actual) + { + NativeAssert::StringEqual(expected, actual, FALSE); + } + + static void StringEqual(LPCWSTR expected, LPCWSTR actual, BOOL ignoreCase) + { + WixAssert::StringEqual(NativeAssert::LPWSTRToString(expected), NativeAssert::LPWSTRToString(actual), ignoreCase); + } + + static void Succeeded(HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array^ zArgs) + { + array^ formatArgs = gcnew array(zArgs->Length + 1); + formatArgs[0] = NativeAssert::LPSTRToString(zArg); + for (int i = 0; i < zArgs->Length; ++i) + { + formatArgs[i + 1] = NativeAssert::LPSTRToString(zArgs[i]); + } + WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs); + } + + static void Succeeded(HRESULT hr, LPCSTR zFormat, ... array^ wzArgs) + { + array^ formatArgs = gcnew array(wzArgs->Length); + for (int i = 0; i < wzArgs->Length; ++i) + { + formatArgs[i] = NativeAssert::LPWSTRToString(wzArgs[i]); + } + WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs); + } + + static void SpecificReturnCode(HRESULT hrExpected, HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array^ zArgs) + { + array^ formatArgs = gcnew array(zArgs->Length + 1); + formatArgs[0] = NativeAssert::LPSTRToString(zArg); + for (int i = 0; i < zArgs->Length; ++i) + { + formatArgs[i + 1] = NativeAssert::LPSTRToString(zArgs[i]); + } + WixAssert::SpecificReturnCode(hrExpected, hr, gcnew String(zFormat), formatArgs); + } + + static void SpecificReturnCode(HRESULT hrExpected, HRESULT hr, LPCSTR zFormat, ... array^ wzArgs) + { + array^ formatArgs = gcnew array(wzArgs->Length); + for (int i = 0; i < wzArgs->Length; ++i) + { + formatArgs[i] = NativeAssert::LPWSTRToString(wzArgs[i]); + } + WixAssert::SpecificReturnCode(hrExpected, hr, gcnew String(zFormat), formatArgs); + } + + static void ValidReturnCode(HRESULT hr, ... array^ validReturnCodes) + { + Assert::Contains(hr, (IEnumerable^)validReturnCodes); + } + + private: + static String^ LPSTRToString(LPCSTR z) + { + return z ? gcnew String(z) : nullptr; + } + static String^ LPWSTRToString(LPCWSTR wz) + { + return wz ? gcnew String(wz) : nullptr; + } + }; +} +} diff --git a/src/internal/WixInternal.TestSupport.Native/WixInternal.TestSupport.Native.vcxproj b/src/internal/WixInternal.TestSupport.Native/WixInternal.TestSupport.Native.vcxproj new file mode 100644 index 00000000..554347b8 --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/WixInternal.TestSupport.Native.vcxproj @@ -0,0 +1,74 @@ + + + + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} + {95BABD97-FBDB-453A-AF8A-FA031A07B599} + WixInternal::TestSupport + ManagedCProj + DynamicLibrary + Unicode + true + WixInternal C++/CLI Test Support + false + true + + + + + + + + + + + + + + Create + + 4564;4691 + + + + + + + + + + + + + + + {6C57EF2C-979A-4106-A9E5-FE342810619A} + + + + + + + diff --git a/src/internal/WixInternal.TestSupport.Native/WixInternal.TestSupport.Native.vcxproj.filters b/src/internal/WixInternal.TestSupport.Native/WixInternal.TestSupport.Native.vcxproj.filters new file mode 100644 index 00000000..34c1380f --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/WixInternal.TestSupport.Native.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/src/internal/WixInternal.TestSupport.Native/build/WixInternal.TestSupport.Native.props b/src/internal/WixInternal.TestSupport.Native/build/WixInternal.TestSupport.Native.props new file mode 100644 index 00000000..d9d9dab4 --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/build/WixInternal.TestSupport.Native.props @@ -0,0 +1,13 @@ + + + + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), .gitignore)) + + + + + v4.7.2 + + diff --git a/src/internal/WixInternal.TestSupport.Native/build/WixInternal.TestSupport.Native.targets b/src/internal/WixInternal.TestSupport.Native/build/WixInternal.TestSupport.Native.targets new file mode 100644 index 00000000..6525e65a --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/build/WixInternal.TestSupport.Native.targets @@ -0,0 +1,54 @@ + + + + + + + + + + + + + $(RootBuildFolder)internal\$(Configuration)\$(PlatformTarget)\WixInternal.TestSupport.dll + + + $(RootBuildFolder)internal\$(Configuration)\$(PlatformTarget)\WixInternal.TestSupport.Native.dll + + + + + + $(RootPackagesFolder)xunit.abstractions.2.0.3\lib\netstandard2.0\xunit.abstractions.dll + + + $(RootPackagesFolder)xunit.assert.2.4.2\lib\netstandard1.1\xunit.assert.dll + + + $(RootPackagesFolder)xunit.extensibility.core.2.4.2\lib\netstandard1.1\xunit.core.dll + + + $(RootPackagesFolder)xunit.extensibility.execution.2.4.2\lib\net452\xunit.execution.desktop.dll + + + + + + + + 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}. + + + + + + + + + + + + + + + diff --git a/src/internal/WixInternal.TestSupport.Native/packages.config b/src/internal/WixInternal.TestSupport.Native/packages.config new file mode 100644 index 00000000..ef2b43c8 --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/packages.config @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + diff --git a/src/internal/WixInternal.TestSupport.Native/precomp.cpp b/src/internal/WixInternal.TestSupport.Native/precomp.cpp new file mode 100644 index 00000000..37664a1c --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/precomp.cpp @@ -0,0 +1,3 @@ +// 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. + +#include "precomp.h" diff --git a/src/internal/WixInternal.TestSupport.Native/precomp.h b/src/internal/WixInternal.TestSupport.Native/precomp.h new file mode 100644 index 00000000..f54b55be --- /dev/null +++ b/src/internal/WixInternal.TestSupport.Native/precomp.h @@ -0,0 +1,11 @@ +#pragma once +// 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. + + +#include +#include + +#include "NativeAssert.h" + +#pragma managed +#include diff --git a/src/internal/WixInternal.TestSupport/Builder.cs b/src/internal/WixInternal.TestSupport/Builder.cs new file mode 100644 index 00000000..fa6e0064 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/Builder.cs @@ -0,0 +1,158 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.Collections.Generic; + using System.IO; + + public class Builder + { + public Builder(string sourceFolder, Type extensionType = null, string[] bindPaths = null, string outputFile = null) + { + this.SourceFolder = sourceFolder; + this.ExtensionType = extensionType; + this.BindPaths = bindPaths; + this.OutputFile = outputFile ?? "test.msi"; + } + + public string[] BindPaths { get; set; } + + public Type ExtensionType { get; set; } + + public string OutputFile { get; set; } + + public string SourceFolder { get; } + + public string[] BuildAndQuery(Action buildFunc, params string[] tables) + { + var sourceFiles = Directory.GetFiles(this.SourceFolder, "*.wxs"); + var wxlFiles = Directory.GetFiles(this.SourceFolder, "*.wxl"); + + using (var fs = new DisposableFileSystem()) + { + var intermediateFolder = fs.GetFolder(); + var outputPath = Path.Combine(intermediateFolder, "bin", this.OutputFile); + + var args = new List + { + "build", + "-o", outputPath, + "-intermediateFolder", intermediateFolder, + }; + + if (this.ExtensionType != null) + { + args.Add("-ext"); + args.Add(Path.GetFullPath(new Uri(this.ExtensionType.Assembly.CodeBase).LocalPath)); + } + + args.AddRange(sourceFiles); + + foreach (var wxlFile in wxlFiles) + { + args.Add("-loc"); + args.Add(wxlFile); + } + + foreach (var bindPath in this.BindPaths) + { + args.Add("-bindpath"); + args.Add(bindPath); + } + + buildFunc(args.ToArray()); + + return Query.QueryDatabase(outputPath, tables); + } + } + + public void BuildAndDecompileAndBuild(Action buildFunc, Action decompileFunc, string decompilePath) + { + var sourceFiles = Directory.GetFiles(this.SourceFolder, "*.wxs"); + var wxlFiles = Directory.GetFiles(this.SourceFolder, "*.wxl"); + + using (var fs = new DisposableFileSystem()) + { + var intermediateFolder = fs.GetFolder(); + var outputFolder = Path.Combine(intermediateFolder, "bin"); + var decompileExtractFolder = Path.Combine(intermediateFolder, "decompiled", "extract"); + var decompileIntermediateFolder = Path.Combine(intermediateFolder, "decompiled", "obj"); + var decompileBuildFolder = Path.Combine(intermediateFolder, "decompiled", "bin"); + var outputPath = Path.Combine(outputFolder, this.OutputFile); + var decompileBuildPath = Path.Combine(decompileBuildFolder, this.OutputFile); + + // First build. + var firstBuildArgs = new List + { + "build", + "-o", outputPath, + "-intermediateFolder", intermediateFolder, + }; + + if (this.ExtensionType != null) + { + firstBuildArgs.Add("-ext"); + firstBuildArgs.Add(Path.GetFullPath(new Uri(this.ExtensionType.Assembly.CodeBase).LocalPath)); + } + + firstBuildArgs.AddRange(sourceFiles); + + foreach (var wxlFile in wxlFiles) + { + firstBuildArgs.Add("-loc"); + firstBuildArgs.Add(wxlFile); + } + + foreach (var bindPath in this.BindPaths) + { + firstBuildArgs.Add("-bindpath"); + firstBuildArgs.Add(bindPath); + } + + buildFunc(firstBuildArgs.ToArray()); + + // Decompile built output. + var decompileArgs = new List + { + "msi", "decompile", + outputPath, + "-intermediateFolder", decompileIntermediateFolder, + "-x", decompileExtractFolder, + "-o", decompilePath + }; + + if (this.ExtensionType != null) + { + decompileArgs.Add("-ext"); + decompileArgs.Add(Path.GetFullPath(new Uri(this.ExtensionType.Assembly.CodeBase).LocalPath)); + } + + decompileFunc(decompileArgs.ToArray()); + + // Build decompiled output. + var secondBuildArgs = new List + { + "build", + decompilePath, + "-o", decompileBuildPath, + "-intermediateFolder", decompileIntermediateFolder + }; + + if (this.ExtensionType != null) + { + secondBuildArgs.Add("-ext"); + secondBuildArgs.Add(Path.GetFullPath(new Uri(this.ExtensionType.Assembly.CodeBase).LocalPath)); + } + + secondBuildArgs.Add("-bindpath"); + secondBuildArgs.Add(outputFolder); + + secondBuildArgs.Add("-bindpath"); + secondBuildArgs.Add(decompileExtractFolder); + + buildFunc(secondBuildArgs.ToArray()); + } + } + } +} diff --git a/src/internal/WixInternal.TestSupport/DisposableFileSystem.cs b/src/internal/WixInternal.TestSupport/DisposableFileSystem.cs new file mode 100644 index 00000000..b03bbaa4 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/DisposableFileSystem.cs @@ -0,0 +1,93 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.Collections.Generic; + using System.IO; + + public class DisposableFileSystem : IDisposable + { + protected bool Disposed { get; private set; } + + private List CleanupPaths { get; } = new List(); + + public bool Keep { get; } + + public DisposableFileSystem(bool keep = false) + { + this.Keep = keep; + } + + protected string GetFile(bool create = false) + { + var path = Path.GetTempFileName(); + + if (!create) + { + File.Delete(path); + } + + this.CleanupPaths.Add(path); + + return path; + } + + public string GetFolder(bool create = false) + { + var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + + if (create) + { + Directory.CreateDirectory(path); + } + + this.CleanupPaths.Add(path); + + return path; + } + + + #region // IDisposable + + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (this.Disposed) + { + return; + } + + if (disposing && !this.Keep) + { + foreach (var path in this.CleanupPaths) + { + try + { + if (File.Exists(path)) + { + File.Delete(path); + } + else if (Directory.Exists(path)) + { + Directory.Delete(path, true); + } + } + catch + { + // Best effort delete, so ignore any failures. + } + } + } + + this.Disposed = true; + } + + #endregion + } +} diff --git a/src/internal/WixInternal.TestSupport/DotnetRunner.cs b/src/internal/WixInternal.TestSupport/DotnetRunner.cs new file mode 100644 index 00000000..befd8952 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/DotnetRunner.cs @@ -0,0 +1,57 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.Collections.Generic; + using System.IO; + + public class DotnetRunner : ExternalExecutable + { + private static readonly object InitLock = new object(); + private static bool Initialized; + private static DotnetRunner Instance; + + public static ExternalExecutableResult Execute(string command, string[] arguments = null) => + InitAndExecute(command, arguments); + + private static ExternalExecutableResult InitAndExecute(string command, string[] arguments) + { + lock (InitLock) + { + if (!Initialized) + { + Initialized = true; + var dotnetPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"); + if (String.IsNullOrEmpty(dotnetPath) || !File.Exists(dotnetPath)) + { + dotnetPath = "dotnet"; + } + + Instance = new DotnetRunner(dotnetPath); + } + } + + return Instance.ExecuteCore(command, arguments); + } + + private DotnetRunner(string exePath) : base(exePath) { } + + private ExternalExecutableResult ExecuteCore(string command, string[] arguments) + { + var total = new List + { + command, + }; + + if (arguments != null) + { + total.AddRange(arguments); + } + + var args = CombineArguments(total); + var mergeErrorIntoOutput = true; + return this.Run(args, mergeErrorIntoOutput); + } + } +} diff --git a/src/internal/WixInternal.TestSupport/ExternalExecutable.cs b/src/internal/WixInternal.TestSupport/ExternalExecutable.cs new file mode 100644 index 00000000..e0345dfb --- /dev/null +++ b/src/internal/WixInternal.TestSupport/ExternalExecutable.cs @@ -0,0 +1,374 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.ComponentModel; + using System.Diagnostics; + using System.IO; + using System.Runtime.InteropServices; + using System.Text; + using System.Threading.Tasks; + using Microsoft.Win32.SafeHandles; + + public abstract class ExternalExecutable + { + private readonly string exePath; + + protected ExternalExecutable(string exePath) + { + this.exePath = exePath; + } + + protected ExternalExecutableResult Run(string args, bool mergeErrorIntoOutput = false, string workingDirectory = null) + { + // https://github.com/dotnet/runtime/issues/58492 + // Process.Start doesn't currently support starting a process with a long path, + // but the way to support long paths doesn't support searching for the executable if it was a relative path. + // Avoid the managed way of doing this even if the target isn't a long path to help verify that the native way works. + if (!Path.IsPathRooted(this.exePath)) + { + return this.RunManaged(args, mergeErrorIntoOutput, workingDirectory); + } + + // https://web.archive.org/web/20150331190801/https://support.microsoft.com/en-us/kb/190351 + var commandLine = $"\"{this.exePath}\" {args}"; + var currentDirectory = workingDirectory ?? Path.GetDirectoryName(this.exePath); + if (String.IsNullOrEmpty(currentDirectory)) + { + currentDirectory = null; + } + var processInfo = new PROCESS_INFORMATION(); + var startInfo = new STARTUPINFOW + { + cb = Marshal.SizeOf(typeof(STARTUPINFOW)), + dwFlags = StartupInfoFlags.STARTF_FORCEOFFFEEDBACK | StartupInfoFlags.STARTF_USESTDHANDLES, + hStdInput = GetStdHandle(StdHandleType.STD_INPUT_HANDLE), + }; + SafeFileHandle hStdOutputParent = null; + SafeFileHandle hStdErrorParent = null; + + try + { + CreatePipeForProcess(out hStdOutputParent, out startInfo.hStdOutput); + + if (!mergeErrorIntoOutput) + { + CreatePipeForProcess(out hStdErrorParent, out startInfo.hStdError); + } + else + { + if (!DuplicateHandle(GetCurrentProcess(), startInfo.hStdOutput, GetCurrentProcess(), out startInfo.hStdError, 0, true, DuplicateHandleOptions.DUPLICATE_SAME_ACCESS)) + { + throw new Win32Exception(); + } + } + + if (!CreateProcessW(this.exePath, commandLine, IntPtr.Zero, IntPtr.Zero, true, CreateProcessFlags.CREATE_NO_WINDOW, IntPtr.Zero, + currentDirectory, ref startInfo, ref processInfo)) + { + throw new Win32Exception(); + } + + startInfo.Dispose(); + + return GetResultFromNative(mergeErrorIntoOutput, hStdOutputParent, hStdErrorParent, processInfo.hProcess, this.exePath, args); + } + finally + { + hStdErrorParent?.Dispose(); + hStdOutputParent?.Dispose(); + + startInfo.Dispose(); + processInfo.Dispose(); + } + } + + private static ExternalExecutableResult GetResultFromNative(bool mergeErrorIntoOutput, SafeFileHandle hStdOutputParent, SafeFileHandle hStdErrorParent, IntPtr hProcess, string fileName, string args) + { + using (var outputStream = new StreamReader(new FileStream(hStdOutputParent, FileAccess.Read))) + using (var errorStream = mergeErrorIntoOutput ? null : new StreamReader(new FileStream(hStdErrorParent, FileAccess.Read))) + { + var outputTask = Task.Run(() => ReadProcessStreamLines(outputStream)); + var errorTask = Task.Run(() => ReadProcessStreamLines(errorStream)); + + while (!outputTask.Wait(100) || !errorTask.Wait(100)) { Task.Yield(); } + var standardOutput = outputTask.Result; + var standardError = errorTask.Result; + + if (WaitForSingleObject(hProcess, -1) != 0) + { + throw new Win32Exception(); + } + + if (!GetExitCodeProcess(hProcess, out var exitCode)) + { + throw new Win32Exception(); + } + + return new ExternalExecutableResult + { + ExitCode = exitCode, + StandardError = standardError, + StandardOutput = standardOutput, + FileName = fileName, + Arguments = args, + }; + } + } + + private static string[] ReadProcessStreamLines(StreamReader streamReader) + { + if (streamReader == null) + { + return null; + } + + var lines = new List(); + while (true) + { + var line = streamReader.ReadLine(); + if (line == null) + { + break; + } + + lines.Add(line); + } + + return lines.ToArray(); + } + + protected ExternalExecutableResult RunManaged(string args, bool mergeErrorIntoOutput = false, string workingDirectory = null) + { + var startInfo = new ProcessStartInfo(this.exePath, args) + { + CreateNoWindow = true, + RedirectStandardError = true, + RedirectStandardOutput = true, + UseShellExecute = false, + WorkingDirectory = workingDirectory ?? Path.GetDirectoryName(this.exePath), + }; + + using (var process = Process.Start(startInfo)) + { + // This implementation of merging the streams does not guarantee that lines are retrieved in the same order that they were written. + // If the process is simultaneously writing to both streams, this is impossible to do anyway. + var standardOutput = new ConcurrentQueue(); + var standardError = mergeErrorIntoOutput ? standardOutput : new ConcurrentQueue(); + + process.ErrorDataReceived += (s, e) => { if (e.Data != null) { standardError.Enqueue(e.Data); } }; + process.OutputDataReceived += (s, e) => { if (e.Data != null) { standardOutput.Enqueue(e.Data); } }; + + process.BeginErrorReadLine(); + process.BeginOutputReadLine(); + + process.WaitForExit(); + + return new ExternalExecutableResult + { + ExitCode = process.ExitCode, + StandardError = mergeErrorIntoOutput ? null : standardError.ToArray(), + StandardOutput = standardOutput.ToArray(), + FileName = this.exePath, + Arguments = args, + }; + } + } + + // This is internal because it assumes backslashes aren't used as escape characters and there aren't any double quotes. + internal static string CombineArguments(IEnumerable arguments) + { + if (arguments == null) + { + return null; + } + + var sb = new StringBuilder(); + + foreach (var arg in arguments) + { + if (sb.Length > 0) + { + sb.Append(' '); + } + + if (arg.IndexOf(' ') > -1) + { + sb.Append("\""); + sb.Append(arg); + sb.Append("\""); + } + else + { + sb.Append(arg); + } + } + + return sb.ToString(); + } + + private static void CreatePipeForProcess(out SafeFileHandle hReadPipe, out IntPtr hWritePipe) + { + var securityAttributes = new SECURITY_ATTRIBUTES + { + nLength = Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES)), + bInheritHandle = true, + }; + + if (!CreatePipe(out var hReadTemp, out hWritePipe, ref securityAttributes, 0)) + { + throw new Win32Exception(); + } + + // Only the handle passed to the process should be inheritable, so have to duplicate the other handle to get an uninheritable one. + if (!DuplicateHandle(GetCurrentProcess(), hReadTemp, GetCurrentProcess(), out var hReadPipePtr, 0, false, DuplicateHandleOptions.DUPLICATE_CLOSE_SOURCE | DuplicateHandleOptions.DUPLICATE_SAME_ACCESS)) + { + throw new Win32Exception(); + } + + hReadPipe = new SafeFileHandle(hReadPipePtr, true); + } + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private extern static IntPtr GetStdHandle(StdHandleType nStdHandle); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private extern static bool CreatePipe(out IntPtr hReadPipe, out IntPtr hWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private extern static bool CreateProcessW( + string lpApplicationName, + string lpCommandLine, + IntPtr lpProcessAttributes, + IntPtr lpThreadAttributes, + [MarshalAs(UnmanagedType.Bool)] bool bInheritHandles, + CreateProcessFlags dwCreationFlags, + IntPtr lpEnvironment, + string lpCurrentDirectory, + ref STARTUPINFOW lpStartupInfo, + ref PROCESS_INFORMATION lpProcessInformation); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)] + private extern static IntPtr GetCurrentProcess(); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private extern static bool GetExitCodeProcess(IntPtr hHandle, out int lpExitCode); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private extern static int WaitForSingleObject(IntPtr hHandle, int dwMilliseconds); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private extern static bool CloseHandle(IntPtr hObject); + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private extern static bool DuplicateHandle(IntPtr hSourceProcessHandle, IntPtr hSourceHandle, IntPtr hTargetProcessHandle, out IntPtr lpTargetHandle, int dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, DuplicateHandleOptions dwOptions); + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + private struct SECURITY_ATTRIBUTES + { + public int nLength; + public IntPtr lpSecurityDescriptor; + [MarshalAs(UnmanagedType.Bool)] + public bool bInheritHandle; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + private struct STARTUPINFOW + { + public int cb; + public string lpReserved; + public string lpDesktop; + public string lpTitle; + public int dwX; + public int dwY; + public int dwXSize; + public int dwYSize; + public int dwXCountChars; + public int dwYCountChars; + public int dwFillAttribute; + public StartupInfoFlags dwFlags; + public short wShowWindow; + public short cbReserved2; + public IntPtr lpReserved2; + public IntPtr hStdInput; + public IntPtr hStdOutput; + public IntPtr hStdError; + + public void Dispose() + { + // This makes assumptions based on how it's used above. + if (this.hStdError != IntPtr.Zero) + { + CloseHandle(this.hStdError); + this.hStdError = IntPtr.Zero; + } + + if (this.hStdOutput != IntPtr.Zero) + { + CloseHandle(this.hStdOutput); + this.hStdOutput = IntPtr.Zero; + } + } + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + private struct PROCESS_INFORMATION + { + public IntPtr hProcess; + public IntPtr hThread; + public int dwProcessId; + public int dwThreadId; + + public void Dispose() + { + if (this.hProcess != IntPtr.Zero) + { + CloseHandle(this.hProcess); + this.hProcess = IntPtr.Zero; + } + + if (this.hThread != IntPtr.Zero) + { + CloseHandle(this.hThread); + this.hThread = IntPtr.Zero; + } + } + } + + private enum StdHandleType + { + STD_INPUT_HANDLE = -10, + STD_OUTPUT_HANDLE = -11, + STD_ERROR_HANDLE = -12, + } + + [Flags] + private enum CreateProcessFlags + { + None = 0x0, + CREATE_NO_WINDOW = 0x08000000, + } + + [Flags] + private enum StartupInfoFlags + { + None = 0x0, + STARTF_FORCEOFFFEEDBACK = 0x80, + STARTF_USESTDHANDLES = 0x100, + } + + private enum DuplicateHandleOptions + { + DUPLICATE_CLOSE_SOURCE = 1, + DUPLICATE_SAME_ACCESS = 2, + } + } +} diff --git a/src/internal/WixInternal.TestSupport/ExternalExecutableResult.cs b/src/internal/WixInternal.TestSupport/ExternalExecutableResult.cs new file mode 100644 index 00000000..a142e07a --- /dev/null +++ b/src/internal/WixInternal.TestSupport/ExternalExecutableResult.cs @@ -0,0 +1,19 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System.Diagnostics; + + public class ExternalExecutableResult + { + public int ExitCode { get; set; } + + public string[] StandardError { get; set; } + + public string[] StandardOutput { get; set; } + + public string FileName { get; set; } + + public string Arguments { get; set; } + } +} diff --git a/src/internal/WixInternal.TestSupport/FakeBuildEngine.cs b/src/internal/WixInternal.TestSupport/FakeBuildEngine.cs new file mode 100644 index 00000000..c1f07708 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/FakeBuildEngine.cs @@ -0,0 +1,33 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System.Collections; + using System.Text; + using Microsoft.Build.Framework; + + public class FakeBuildEngine : IBuildEngine + { + private readonly StringBuilder output = new StringBuilder(); + + public int ColumnNumberOfTaskNode => 0; + + public bool ContinueOnError => false; + + public int LineNumberOfTaskNode => 0; + + public string ProjectFileOfTaskNode => "fake_wix.targets"; + + public string Output => this.output.ToString(); + + public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) => throw new System.NotImplementedException(); + + public void LogCustomEvent(CustomBuildEventArgs e) => this.output.AppendLine(e.Message); + + public void LogErrorEvent(BuildErrorEventArgs e) => this.output.AppendLine(e.Message); + + public void LogMessageEvent(BuildMessageEventArgs e) => this.output.AppendLine(e.Message); + + public void LogWarningEvent(BuildWarningEventArgs e) => this.output.AppendLine(e.Message); + } +} diff --git a/src/internal/WixInternal.TestSupport/MsbuildRunner.cs b/src/internal/WixInternal.TestSupport/MsbuildRunner.cs new file mode 100644 index 00000000..2cbf5e91 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/MsbuildRunner.cs @@ -0,0 +1,112 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.Collections.Generic; + using System.IO; + + public class MsbuildRunner : ExternalExecutable + { + private static readonly string VswhereFindArguments = "-property installationPath -version [17.0,18.0)"; + private static readonly string MsbuildCurrentRelativePath = @"MSBuild\Current\Bin\MSBuild.exe"; + private static readonly string MsbuildCurrentRelativePath64 = @"MSBuild\Current\Bin\amd64\MSBuild.exe"; + + private static readonly object InitLock = new object(); + + private static bool Initialized; + private static MsbuildRunner MsbuildCurrentRunner; + private static MsbuildRunner MsbuildCurrentRunner64; + + public static MsbuildRunnerResult Execute(string projectPath, string[] arguments = null, bool x64 = false) => + InitAndExecute(String.Empty, projectPath, arguments, x64); + + public static MsbuildRunnerResult ExecuteWithMsbuildCurrent(string projectPath, string[] arguments = null, bool x64 = false) => + InitAndExecute("Current", projectPath, arguments, x64); + + private static MsbuildRunnerResult InitAndExecute(string msbuildVersion, string projectPath, string[] arguments, bool x64) + { + lock (InitLock) + { + if (!Initialized) + { + Initialized = true; + var vswhereResult = VswhereRunner.Execute(VswhereFindArguments, true); + if (vswhereResult.ExitCode != 0) + { + throw new InvalidOperationException($"Failed to execute vswhere.exe, exit code: {vswhereResult.ExitCode}. Output:\r\n{String.Join("\r\n", vswhereResult.StandardOutput)}"); + } + + string msbuildCurrentPath = null; + string msbuildCurrentPath64 = null; + + foreach (var installPath in vswhereResult.StandardOutput) + { + if (msbuildCurrentPath == null) + { + var path = Path.Combine(installPath, MsbuildCurrentRelativePath); + if (File.Exists(path)) + { + msbuildCurrentPath = path; + } + } + + if (msbuildCurrentPath64 == null) + { + var path = Path.Combine(installPath, MsbuildCurrentRelativePath64); + if (File.Exists(path)) + { + msbuildCurrentPath64 = path; + } + } + } + + if (msbuildCurrentPath != null) + { + MsbuildCurrentRunner = new MsbuildRunner(msbuildCurrentPath); + } + + if (msbuildCurrentPath64 != null) + { + MsbuildCurrentRunner64 = new MsbuildRunner(msbuildCurrentPath64); + } + } + } + + MsbuildRunner runner = x64 ? MsbuildCurrentRunner64 : MsbuildCurrentRunner; + + if (runner == null) + { + throw new InvalidOperationException($"Failed to find an installed{(x64 ? " 64-bit" : String.Empty)} MSBuild{msbuildVersion}"); + } + + return runner.ExecuteCore(projectPath, arguments); + } + + private MsbuildRunner(string exePath) : base(exePath) { } + + private MsbuildRunnerResult ExecuteCore(string projectPath, string[] arguments) + { + var total = new List + { + projectPath, + }; + + if (arguments != null) + { + total.AddRange(arguments); + } + + var args = CombineArguments(total); + var mergeErrorIntoOutput = true; + var workingFolder = Path.GetDirectoryName(projectPath); + var result = this.Run(args, mergeErrorIntoOutput, workingFolder); + + return new MsbuildRunnerResult + { + ExitCode = result.ExitCode, + Output = result.StandardOutput, + }; + } + } +} diff --git a/src/internal/WixInternal.TestSupport/MsbuildRunnerResult.cs b/src/internal/WixInternal.TestSupport/MsbuildRunnerResult.cs new file mode 100644 index 00000000..b85acb16 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/MsbuildRunnerResult.cs @@ -0,0 +1,19 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using Xunit; + + public class MsbuildRunnerResult + { + public int ExitCode { get; set; } + + public string[] Output { get; set; } + + public void AssertSuccess() + { + Assert.True(0 == this.ExitCode, $"MSBuild failed unexpectedly. Output:{Environment.NewLine}{String.Join(Environment.NewLine, this.Output)}"); + } + } +} diff --git a/src/internal/WixInternal.TestSupport/MsbuildUtilities.cs b/src/internal/WixInternal.TestSupport/MsbuildUtilities.cs new file mode 100644 index 00000000..5560f993 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/MsbuildUtilities.cs @@ -0,0 +1,101 @@ +// 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. + +namespace WixToolsetTest.Sdk +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using WixInternal.TestSupport; + + public enum BuildSystem + { + DotNetCoreSdk, + MSBuild, + MSBuild64, + } + + public static class MsbuildUtilities + { + public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", string verbosityLevel = "normal", bool suppressValidation = true) + { + var allArgs = new List + { + $"-verbosity:{verbosityLevel}", + $"-p:Configuration={configuration}", + $"-p:SuppressValidation={suppressValidation}", + // Node reuse means that child msbuild processes can stay around after the build completes. + // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. + "-nr:false", + $"-bl:{Path.ChangeExtension(projectPath, ".binlog")}" + }; + + if (arguments != null) + { + allArgs.AddRange(arguments); + } + + switch (buildSystem) + { + case BuildSystem.DotNetCoreSdk: + { + allArgs.Add(projectPath); + var result = DotnetRunner.Execute("msbuild", allArgs.ToArray()); + return new MsbuildRunnerResult + { + ExitCode = result.ExitCode, + Output = result.StandardOutput, + }; + } + case BuildSystem.MSBuild: + case BuildSystem.MSBuild64: + { + return MsbuildRunner.Execute(projectPath, allArgs.ToArray(), buildSystem == BuildSystem.MSBuild64); + } + default: + { + throw new NotImplementedException(); + } + } + } + + public static string GetQuotedPropertySwitch(BuildSystem buildSystem, string propertyName, string valueToQuote) + { + switch (buildSystem) + { + case BuildSystem.DotNetCoreSdk: + { + // If the value ends with a backslash, double-escape it (it should end up with four backslashes). + if (valueToQuote?.EndsWith("\\") == true) + { + valueToQuote += @"\\\"; + } + + return $"-p:{propertyName}=\\\"{valueToQuote}\\\""; + } + case BuildSystem.MSBuild: + case BuildSystem.MSBuild64: + { + // If the value ends with a backslash, escape it. + if (valueToQuote?.EndsWith("\\") == true) + { + valueToQuote += @"\"; + } + + return $"-p:{propertyName}=\"{valueToQuote}\""; + } + default: + { + throw new NotImplementedException(); + } + } + } + + public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem) + { + var expectedToolExe = buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; + var expectedToolCommand = $"{expectedToolExe} {operation}"; + return result.Output.Where(line => line.Contains(expectedToolCommand)); + } + } +} diff --git a/src/internal/WixInternal.TestSupport/Pushd.cs b/src/internal/WixInternal.TestSupport/Pushd.cs new file mode 100644 index 00000000..43737382 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/Pushd.cs @@ -0,0 +1,46 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.IO; + + public class Pushd : IDisposable + { + protected bool Disposed { get; private set; } + + public Pushd(string path) + { + this.PreviousDirectory = Directory.GetCurrentDirectory(); + + Directory.SetCurrentDirectory(path); + } + + public string PreviousDirectory { get; } + + #region // IDisposable + + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (this.Disposed) + { + return; + } + + if (disposing) + { + Directory.SetCurrentDirectory(this.PreviousDirectory); + } + + this.Disposed = true; + } + + #endregion + } +} diff --git a/src/internal/WixInternal.TestSupport/Query.cs b/src/internal/WixInternal.TestSupport/Query.cs new file mode 100644 index 00000000..38f5df64 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/Query.cs @@ -0,0 +1,172 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Text; + using WixToolset.Dtf.Compression.Cab; + using WixToolset.Dtf.WindowsInstaller; + + public class Query + { + public static string[] QueryDatabase(string path, string[] tables) + { + var results = new List(); + var resultsByTable = QueryDatabaseByTable(path, tables); + var sortedTables = tables.ToList(); + sortedTables.Sort(); + foreach (var tableName in sortedTables) + { + var rows = resultsByTable[tableName]; + rows?.ForEach(r => results.Add($"{tableName}:{r}")); + } + return results.ToArray(); + } + + /// + /// Returns rows from requested tables formatted to facilitate testing. + /// If the table did not exist in the database, its list will be null. + /// + /// + /// + /// + public static Dictionary> QueryDatabaseByTable(string path, string[] tables) + { + var results = new Dictionary>(); + + if (tables?.Length > 0) + { + var sb = new StringBuilder(); + using (var db = new Database(path)) + { + foreach (var table in tables) + { + if (table == "_SummaryInformation") + { + var entries = new List(); + results.Add(table, entries); + + entries.Add($"Title\t{db.SummaryInfo.Title}"); + entries.Add($"Subject\t{db.SummaryInfo.Subject}"); + entries.Add($"Author\t{db.SummaryInfo.Author}"); + entries.Add($"Keywords\t{db.SummaryInfo.Keywords}"); + entries.Add($"Comments\t{db.SummaryInfo.Comments}"); + entries.Add($"Template\t{db.SummaryInfo.Template}"); + entries.Add($"CodePage\t{db.SummaryInfo.CodePage}"); + entries.Add($"PageCount\t{db.SummaryInfo.PageCount}"); + entries.Add($"WordCount\t{db.SummaryInfo.WordCount}"); + entries.Add($"CharacterCount\t{db.SummaryInfo.CharacterCount}"); + entries.Add($"Security\t{db.SummaryInfo.Security}"); + + continue; + } + + if (!db.IsTablePersistent(table)) + { + results.Add(table, null); + continue; + } + + var rows = new List(); + results.Add(table, rows); + + using (var view = db.OpenView("SELECT * FROM `{0}`", table)) + { + view.Execute(); + + Record record; + while ((record = view.Fetch()) != null) + { + sb.Clear(); + + using (record) + { + for (var i = 0; i < record.FieldCount; ++i) + { + if (i > 0) + { + sb.Append("\t"); + } + + sb.Append(record[i + 1]?.ToString()); + } + } + + rows.Add(sb.ToString()); + } + } + rows.Sort(); + } + } + } + + return results; + } + + public static CabFileInfo[] GetCabinetFiles(string path) + { + var cab = new CabInfo(path); + + var result = cab.GetFiles(); + + return result.Select(c => c).ToArray(); + } + + public static void ExtractStream(string path, string streamName, string outputPath) + { + Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); + + using (var db = new Database(path)) + using (var view = db.OpenView("SELECT `Data` FROM `_Streams` WHERE `Name` = '{0}'", streamName)) + { + view.Execute(); + + using (var record = view.Fetch()) + { + record.GetStream(1, outputPath); + } + } + } + + public static void ExtractSubStorage(string path, string subStorageName, string outputPath) + { + Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); + + using (var db = new Database(path)) + using (var view = db.OpenView("SELECT `Name`, `Data` FROM `_Storages` WHERE `Name` = '{0}'", subStorageName)) + { + view.Execute(); + + using (var record = view.Fetch()) + { + var name = record.GetString(1); + record.GetStream(2, outputPath); + } + } + } + + public static string[] GetSubStorageNames(string path) + { + var result = new List(); + + using (var db = new Database(path)) + using (var view = db.OpenView("SELECT `Name` FROM `_Storages`")) + { + view.Execute(); + + Record record; + while ((record = view.Fetch()) != null) + { + var name = record.GetString(1); + result.Add(name); + } + } + + result.Sort(); + return result.ToArray(); + } + } +} diff --git a/src/internal/WixInternal.TestSupport/RobocopyRunner.cs b/src/internal/WixInternal.TestSupport/RobocopyRunner.cs new file mode 100644 index 00000000..d93fbaa0 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/RobocopyRunner.cs @@ -0,0 +1,16 @@ +// 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. + +namespace WixInternal.TestSupport +{ + public class RobocopyRunner : ExternalExecutable + { + private static readonly RobocopyRunner Instance = new RobocopyRunner(); + + private RobocopyRunner() : base("robocopy") { } + + public static ExternalExecutableResult Execute(string args) + { + return Instance.Run(args); + } + } +} diff --git a/src/internal/WixInternal.TestSupport/TestData.cs b/src/internal/WixInternal.TestSupport/TestData.cs new file mode 100644 index 00000000..05691e8c --- /dev/null +++ b/src/internal/WixInternal.TestSupport/TestData.cs @@ -0,0 +1,78 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.IO; + using System.Reflection; + using System.Runtime.CompilerServices; + + public class TestData + { + public static void CreateFile(string path, long size, bool fill = false) + { + // Ensure the directory exists. + path = Path.GetFullPath(path); + Directory.CreateDirectory(Path.GetDirectoryName(path)); + + using (var file = File.OpenWrite(path)) + { + if (fill) + { + var random = new Random(); + var bytes = new byte[4096]; + var generated = 0L; + + // Put fill bytes in the file so it doesn't compress trivially. + while (generated < size) + { + var generate = (int)Math.Min(size - generated, bytes.Length); + + random.NextBytes(bytes); + + file.Write(bytes, 0, generate); + + generated += generate; + } + } + else + { + file.SetLength(size); + } + } + } + + public static string Get(params string[] paths) + { + var localPath = Path.GetDirectoryName(new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath); + return Path.Combine(localPath, Path.Combine(paths)); + } + + public static string GetUnitTestLogsFolder([CallerFilePath] string path = "", [CallerMemberName] string method = "") + { + var startingPath = Path.GetDirectoryName(new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath); + var buildPath = startingPath; + + while (!String.IsNullOrEmpty(buildPath)) + { + var folderName = Path.GetFileName(buildPath); + if (String.Equals("build", folderName, StringComparison.OrdinalIgnoreCase)) + { + break; + } + + buildPath = Path.GetDirectoryName(buildPath); + } + + if (String.IsNullOrEmpty(buildPath)) + { + throw new InvalidOperationException($"Could not find the 'build' folder in the test path: {startingPath}. Cannot get test logs folder without being able to find the build folder."); + } + + var testLogsFolder = Path.Combine(buildPath, "logs", "UnitTests", $"{Path.GetFileNameWithoutExtension(path)}_{method}"); + Directory.CreateDirectory(testLogsFolder); + + return testLogsFolder; + } + } +} diff --git a/src/internal/WixInternal.TestSupport/TestDataFolderFileSystem.cs b/src/internal/WixInternal.TestSupport/TestDataFolderFileSystem.cs new file mode 100644 index 00000000..38b05101 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/TestDataFolderFileSystem.cs @@ -0,0 +1,42 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + + /// + /// This class builds on top of DisposableFileSystem + /// to make it easy to write a test that needs a whole folder of test data copied to a temp location + /// that will automatically be cleaned up at the end of the test. + /// + public class TestDataFolderFileSystem : IDisposable + { + private DisposableFileSystem fileSystem; + + public string BaseFolder { get; private set; } + + public void Dispose() + { + this.fileSystem?.Dispose(); + } + + public void Initialize(string sourceDirectoryPath) + { + if (this.fileSystem != null) + { + throw new InvalidOperationException(); + } + this.fileSystem = new DisposableFileSystem(); + + this.BaseFolder = this.fileSystem.GetFolder(); + + RobocopyFolder(sourceDirectoryPath, this.BaseFolder); + } + + public static ExternalExecutableResult RobocopyFolder(string sourceFolderPath, string destinationFolderPath) + { + var args = $"\"{sourceFolderPath}\" \"{destinationFolderPath}\" /E /R:1 /W:1"; + return RobocopyRunner.Execute(args); + } + } +} diff --git a/src/internal/WixInternal.TestSupport/VswhereRunner.cs b/src/internal/WixInternal.TestSupport/VswhereRunner.cs new file mode 100644 index 00000000..f7361423 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/VswhereRunner.cs @@ -0,0 +1,41 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.IO; + + public class VswhereRunner : ExternalExecutable + { + private static readonly string VswhereRelativePath = @"Microsoft Visual Studio\Installer\vswhere.exe"; + + private static readonly object InitLock = new object(); + private static bool Initialized; + private static VswhereRunner Instance; + + public static ExternalExecutableResult Execute(string args, bool mergeErrorIntoOutput = false) => + InitAndExecute(args, mergeErrorIntoOutput); + + private static ExternalExecutableResult InitAndExecute(string args, bool mergeErrorIntoOutput) + { + lock (InitLock) + { + if (!Initialized) + { + Initialized = true; + var vswherePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), VswhereRelativePath); + if (!File.Exists(vswherePath)) + { + throw new InvalidOperationException($"Failed to find vswhere at: {vswherePath}"); + } + + Instance = new VswhereRunner(vswherePath); + } + } + + return Instance.Run(args, mergeErrorIntoOutput); + } + + private VswhereRunner(string exePath) : base(exePath) { } + } +} diff --git a/src/internal/WixInternal.TestSupport/WixInternal.TestSupport.csproj b/src/internal/WixInternal.TestSupport/WixInternal.TestSupport.csproj new file mode 100644 index 00000000..4e1c3c26 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/WixInternal.TestSupport.csproj @@ -0,0 +1,27 @@ + + + + + + + netstandard2.0;net472 + true + embedded + true + true + $(NoWarn);CS1591 + false + true + + + + + + + + + + + + + diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SkipTestException.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SkipTestException.cs new file mode 100644 index 00000000..6ef30829 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SkipTestException.cs @@ -0,0 +1,15 @@ +// 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. + +namespace WixInternal.TestSupport.XunitExtensions +{ + using System; + + public class SkipTestException : Exception + { + public SkipTestException(string reason) + : base(reason) + { + + } + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactAttribute.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactAttribute.cs new file mode 100644 index 00000000..ba4678c8 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactAttribute.cs @@ -0,0 +1,13 @@ +// 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. + +namespace WixInternal.TestSupport.XunitExtensions +{ + using Xunit; + using Xunit.Sdk; + + // https://github.com/xunit/samples.xunit/blob/5dc1d35a63c3394a8678ac466b882576a70f56f6/DynamicSkipExample + [XunitTestCaseDiscoverer("WixInternal.TestSupport.XunitExtensions.SkippableFactDiscoverer", "WixInternal.TestSupport")] + public class SkippableFactAttribute : FactAttribute + { + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs new file mode 100644 index 00000000..d5061b04 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs @@ -0,0 +1,23 @@ +// 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. + +namespace WixInternal.TestSupport.XunitExtensions +{ + using System.Collections.Generic; + using Xunit.Abstractions; + using Xunit.Sdk; + + public class SkippableFactDiscoverer : IXunitTestCaseDiscoverer + { + private IMessageSink DiagnosticMessageSink { get; } + + public SkippableFactDiscoverer(IMessageSink diagnosticMessageSink) + { + this.DiagnosticMessageSink = diagnosticMessageSink; + } + + public IEnumerable Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute) + { + yield return new SkippableFactTestCase(this.DiagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), discoveryOptions.MethodDisplayOptionsOrDefault(), testMethod); + } + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactMessageBus.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactMessageBus.cs new file mode 100644 index 00000000..dd143c93 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactMessageBus.cs @@ -0,0 +1,40 @@ +// 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. + +namespace WixInternal.TestSupport.XunitExtensions +{ + using System.Linq; + using Xunit.Abstractions; + using Xunit.Sdk; + + public class SkippableFactMessageBus : IMessageBus + { + private IMessageBus InnerBus { get; } + + public SkippableFactMessageBus(IMessageBus innerBus) + { + this.InnerBus = innerBus; + } + + public int DynamicallySkippedTestCount { get; private set; } + + public void Dispose() + { + } + + public bool QueueMessage(IMessageSinkMessage message) + { + if (message is ITestFailed testFailed) + { + var exceptionType = testFailed.ExceptionTypes.FirstOrDefault(); + if (exceptionType == typeof(SkipTestException).FullName) + { + ++this.DynamicallySkippedTestCount; + return this.InnerBus.QueueMessage(new TestSkipped(testFailed.Test, testFailed.Messages.FirstOrDefault())); + } + } + + // Nothing we care about, send it on its way + return this.InnerBus.QueueMessage(message); + } + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactTestCase.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactTestCase.cs new file mode 100644 index 00000000..7a78b820 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableFactTestCase.cs @@ -0,0 +1,40 @@ +// 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. + +namespace WixInternal.TestSupport.XunitExtensions +{ + using System; + using System.ComponentModel; + using System.Threading; + using System.Threading.Tasks; + using Xunit.Abstractions; + using Xunit.Sdk; + + public class SkippableFactTestCase : XunitTestCase + { + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Called by the de-serializer; should only be called by deriving classes for de-serialization purposes")] + public SkippableFactTestCase() { } + + public SkippableFactTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod, object[] testMethodArguments = null) + : base(diagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testMethod, testMethodArguments) + { + } + + public override async Task RunAsync(IMessageSink diagnosticMessageSink, + IMessageBus messageBus, + object[] constructorArguments, + ExceptionAggregator aggregator, + CancellationTokenSource cancellationTokenSource) + { + var skipMessageBus = new SkippableFactMessageBus(messageBus); + var result = await base.RunAsync(diagnosticMessageSink, skipMessageBus, constructorArguments, aggregator, cancellationTokenSource); + if (skipMessageBus.DynamicallySkippedTestCount > 0) + { + result.Failed -= skipMessageBus.DynamicallySkippedTestCount; + result.Skipped += skipMessageBus.DynamicallySkippedTestCount; + } + + return result; + } + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs new file mode 100644 index 00000000..1ed04e01 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs @@ -0,0 +1,12 @@ +// 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. + +namespace WixInternal.TestSupport.XunitExtensions +{ + using Xunit; + using Xunit.Sdk; + + [XunitTestCaseDiscoverer("WixInternal.TestSupport.XunitExtensions.SkippableFactDiscoverer", "WixInternal.TestSupport")] + public class SkippableTheoryAttribute : TheoryAttribute + { + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs new file mode 100644 index 00000000..bf850cba --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs @@ -0,0 +1,41 @@ +// 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. + +namespace WixInternal.TestSupport.XunitExtensions +{ + using System.Collections.Generic; + using Xunit.Abstractions; + using Xunit.Sdk; + + public class SkippableTheoryDiscoverer : IXunitTestCaseDiscoverer + { + private IMessageSink DiagnosticMessageSink { get; } + private TheoryDiscoverer TheoryDiscoverer { get; } + + public SkippableTheoryDiscoverer(IMessageSink diagnosticMessageSink) + { + this.DiagnosticMessageSink = diagnosticMessageSink; + + this.TheoryDiscoverer = new TheoryDiscoverer(diagnosticMessageSink); + } + + public IEnumerable Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute) + { + var defaultMethodDisplay = discoveryOptions.MethodDisplayOrDefault(); + var defaultMethodDisplayOptions = discoveryOptions.MethodDisplayOptionsOrDefault(); + + // Unlike fact discovery, the underlying algorithm for theories is complex, so we let the theory discoverer + // do its work, and do a little on-the-fly conversion into our own test cases. + foreach (var testCase in this.TheoryDiscoverer.Discover(discoveryOptions, testMethod, factAttribute)) + { + if (testCase is XunitTheoryTestCase) + { + yield return new SkippableTheoryTestCase(this.DiagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testCase.TestMethod); + } + else + { + yield return new SkippableFactTestCase(this.DiagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testCase.TestMethod, testCase.TestMethodArguments); + } + } + } + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs new file mode 100644 index 00000000..d9b7d068 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs @@ -0,0 +1,41 @@ +// 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. + +namespace WixInternal.TestSupport.XunitExtensions +{ + using System; + using System.ComponentModel; + using System.Threading; + using System.Threading.Tasks; + using Xunit.Abstractions; + using Xunit.Sdk; + + public class SkippableTheoryTestCase : XunitTheoryTestCase + { + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Called by the de-serializer; should only be called by deriving classes for de-serialization purposes")] + public SkippableTheoryTestCase() { } + + public SkippableTheoryTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod) + : base(diagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testMethod) + { + } + + public override async Task RunAsync(IMessageSink diagnosticMessageSink, + IMessageBus messageBus, + object[] constructorArguments, + ExceptionAggregator aggregator, + CancellationTokenSource cancellationTokenSource) + { + // Duplicated code from SkippableFactTestCase. I'm sure we could find a way to de-dup with some thought. + var skipMessageBus = new SkippableFactMessageBus(messageBus); + var result = await base.RunAsync(diagnosticMessageSink, skipMessageBus, constructorArguments, aggregator, cancellationTokenSource); + if (skipMessageBus.DynamicallySkippedTestCount > 0) + { + result.Failed -= skipMessageBus.DynamicallySkippedTestCount; + result.Skipped += skipMessageBus.DynamicallySkippedTestCount; + } + + return result; + } + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SpecificReturnCodeException.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SpecificReturnCodeException.cs new file mode 100644 index 00000000..49be13d5 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SpecificReturnCodeException.cs @@ -0,0 +1,20 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using Xunit.Sdk; + + public class SpecificReturnCodeException : XunitException + { + public SpecificReturnCodeException(int hrExpected, int hr, string userMessage) + : base(String.Format("WixAssert.SpecificReturnCode() Failure\r\n" + + "Expected HRESULT: 0x{0:X8}\r\n" + + "Actual HRESULT: 0x{1:X8}\r\n" + + "Message: {2}", + hrExpected, hr, userMessage)) + { + this.HResult = hr; + } + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/SucceededException.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/SucceededException.cs new file mode 100644 index 00000000..d50c07ed --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/SucceededException.cs @@ -0,0 +1,19 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using Xunit.Sdk; + + public class SucceededException : XunitException + { + public SucceededException(int hr, string userMessage) + : base(String.Format("WixAssert.Succeeded() Failure\r\n" + + "HRESULT: 0x{0:X8}\r\n" + + "Message: {1}", + hr, userMessage)) + { + this.HResult = hr; + } + } +} diff --git a/src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs b/src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs new file mode 100644 index 00000000..66f831a1 --- /dev/null +++ b/src/internal/WixInternal.TestSupport/XunitExtensions/WixAssert.cs @@ -0,0 +1,201 @@ +// 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. + +namespace WixInternal.TestSupport +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using System.Xml.Linq; + using WixInternal.TestSupport.XunitExtensions; + using Xunit; + using Xunit.Sdk; + + public class WixAssert : Assert + { + public static void CompareLineByLine(string[] expectedLines, string[] actualLines) + { + var lineNumber = 0; + + for (; lineNumber < expectedLines.Length && lineNumber < actualLines.Length; ++lineNumber) + { + WixAssert.StringEqual($"{lineNumber}: {expectedLines[lineNumber]}", $"{lineNumber}: {actualLines[lineNumber]}"); + } + + var additionalExpectedLines = expectedLines.Length > lineNumber ? String.Join(Environment.NewLine, expectedLines.Skip(lineNumber).Select((s, i) => $"{lineNumber + i}: {s}")) : $"Missing {actualLines.Length - lineNumber} lines"; + var additionalActualLines = actualLines.Length > lineNumber ? String.Join(Environment.NewLine, actualLines.Skip(lineNumber).Select((s, i) => $"{lineNumber + i}: {s}")) : $"Missing {expectedLines.Length - lineNumber} lines"; + + Assert.Equal(additionalExpectedLines, additionalActualLines, StringObjectEqualityComparer.InvariantCulture); + } + + public static void CompareXml(XContainer xExpected, XContainer xActual) + { + var expecteds = xExpected.Descendants().Select(x => $"{x.Name.LocalName}:{String.Join(",", x.Attributes().OrderBy(a => a.Name.LocalName).Select(a => $"{a.Name.LocalName}={a.Value}"))}"); + var actuals = xActual.Descendants().Select(x => $"{x.Name.LocalName}:{String.Join(",", x.Attributes().OrderBy(a => a.Name.LocalName).Select(a => $"{a.Name.LocalName}={a.Value}"))}"); + + CompareLineByLine(expecteds.OrderBy(s => s).ToArray(), actuals.OrderBy(s => s).ToArray()); + } + + public static void CompareXml(string expectedPath, string actualPath) + { + var expectedDoc = XDocument.Load(expectedPath, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); + var actualDoc = XDocument.Load(actualPath, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); + + CompareXml(expectedDoc, actualDoc); + } + + /// + /// Dynamically skips the test. + /// Requires that the test was marked with a fact attribute derived from + /// or + /// + public static void Skip(string message) + { + throw new SkipTestException(message); + } + + public static void SpecificReturnCode(int hrExpected, int hr, string format, params object[] formatArgs) + { + if (hrExpected != hr) + { + throw new SpecificReturnCodeException(hrExpected, hr, String.Format(format, formatArgs)); + } + } + + public static void Succeeded(int hr, string format, params object[] formatArgs) + { + if (0 > hr) + { + throw new SucceededException(hr, String.Format(format, formatArgs)); + } + } + + public static void StringCollectionEmpty(IList collection) + { + if (collection.Count > 0) + { + Assert.True(false, $"The collection was expected to be empty, but instead was [{Environment.NewLine}\"{String.Join($"\", {Environment.NewLine}\"", collection)}\"{Environment.NewLine}]"); + } + } + + public static void StringEqual(string expected, string actual, bool ignoreCase = false) + { + WixStringEqualException.ThrowIfNotEqual(expected, actual, ignoreCase); + } + + public static void NotStringEqual(string expected, string actual, bool ignoreCase = false) + { + var comparer = ignoreCase ? StringObjectEqualityComparer.InvariantCultureIgnoreCase : StringObjectEqualityComparer.InvariantCulture; + Assert.NotEqual(expected, actual, comparer); + } + + // There appears to have been a bug in VC++, which might or might not have been partially + // or completely corrected. It was unable to disambiguate a call to: + // Xunit::Assert::Throws(System::Type^, System::Action^) + // from a call to: + // Xunit::Assert::Throws(System::Type^, System::Func^) + // that implicitly ignores its return value. + // + // The ambiguity may have been reported by some versions of the compiler and not by others. + // Some versions of the compiler may not have emitted any code in this situation, making it + // appear that the test has passed when, in fact, it hasn't been run. + // + // This situation is not an issue for C#. + // + // The following method is used to isolate DUtilTests in order to overcome the above problem. + + /// + /// This shim allows C++/CLR code to call the Xunit method with the same signature + /// without getting an ambiguous overload error. If the specified test code + /// fails to generate an exception of the exact specified type, an assertion + /// exception is thrown. Otherwise, execution flow proceeds as normal. + /// + /// The type name of the expected exception. + /// An Action delegate to run the test code. + public static new void Throws(System.Action testCode) + where T : System.Exception + { + Xunit.Assert.Throws(testCode); + } + + // This shim has been tested, but is not currently used anywhere. It was provided + // at the same time as the preceding shim because it involved the same overload + // resolution conflict. + + /// + /// This shim allows C++/CLR code to call the Xunit method with the same signature + /// without getting an ambiguous overload error. If the specified test code + /// fails to generate an exception of the exact specified type, an assertion + /// exception is thrown. Otherwise, execution flow proceeds as normal. + /// + /// The type object associated with exceptions of the expected type. + /// An Action delegate to run the test code. + /// An exception of a type other than the type specified, is such an exception is thrown. + public static new System.Exception Throws(System.Type exceptionType, System.Action testCode) + { + return Xunit.Assert.Throws(exceptionType, testCode); + } + } + + internal class StringObjectEqualityComparer : IEqualityComparer + { + public static readonly StringObjectEqualityComparer InvariantCultureIgnoreCase = new StringObjectEqualityComparer(true); + public static readonly StringObjectEqualityComparer InvariantCulture = new StringObjectEqualityComparer(false); + + private readonly StringComparer stringComparer; + + public StringObjectEqualityComparer(bool ignoreCase) + { + this.stringComparer = ignoreCase ? StringComparer.InvariantCultureIgnoreCase : StringComparer.InvariantCulture; + } + + public new bool Equals(object x, object y) + { + return this.stringComparer.Equals((string)x, (string)y); + } + + public int GetHashCode(object obj) + { + return this.stringComparer.GetHashCode((string)obj); + } + } + + public class WixStringEqualException : XunitException + { + public WixStringEqualException(string userMessage) : base(userMessage) { } + + public static void ThrowIfNotEqual(string expected, string actual, bool ignoreCase) + { + var comparer = ignoreCase ? StringObjectEqualityComparer.InvariantCultureIgnoreCase : StringObjectEqualityComparer.InvariantCulture; + if (comparer.Equals(expected, actual)) + { + return; + } + + var sbMessage = new StringBuilder(); + + try + { + Assert.Equal(expected, actual, ignoreCase); + } + catch (XunitException xe) + { + // If either string is not completely in the message, then make sure it gets in there. + if (!xe.Message.Contains(expected) || !xe.Message.Contains(actual)) + { + sbMessage.AppendLine(xe.Message); + sbMessage.AppendLine(); + sbMessage.AppendFormat("Expected: {0}", expected); + sbMessage.AppendLine(); + sbMessage.AppendFormat("Actual: {0}", actual); + } + else + { + throw; + } + } + + throw new WixStringEqualException(sbMessage.ToString()); + } + } +} diff --git a/src/internal/WixToolset.BaseBuildTasks.Sources/BaseToolsetTask.cs b/src/internal/WixToolset.BaseBuildTasks.Sources/BaseToolsetTask.cs deleted file mode 100644 index d9e3b5e8..00000000 --- a/src/internal/WixToolset.BaseBuildTasks.Sources/BaseToolsetTask.cs +++ /dev/null @@ -1,178 +0,0 @@ -// 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. - -namespace WixToolset.BaseBuildTasks -{ - using System; - using System.IO; - using System.Runtime.InteropServices; - using Microsoft.Build.Utilities; - - public abstract class BaseToolsetTask : ToolTask - { - /// - /// Gets or sets additional options that are appended the the tool command-line. - /// - /// - /// This allows the task to support extended options in the tool which are not - /// explicitly implemented as properties on the task. - /// - public string AdditionalOptions { get; set; } - - /// - /// Gets or sets whether to display the logo. - /// - public bool NoLogo { get; set; } - - /// - /// Gets or sets whether all warnings should be suppressed. - /// - public bool SuppressAllWarnings { get; set; } - - /// - /// Gets or sets a list of specific warnings to be suppressed. - /// - public string[] SuppressSpecificWarnings { get; set; } - - /// - /// Gets or sets whether all warnings should be treated as errors. - /// - public bool TreatWarningsAsErrors { get; set; } - - /// - /// Gets or sets a list of specific warnings to treat as errors. - /// - public string[] TreatSpecificWarningsAsErrors { get; set; } - - /// - /// Gets or sets whether to display verbose output. - /// - public bool VerboseOutput { get; set; } - - /// - /// Get the path to the executable. - /// - /// - /// ToolTask only calls GenerateFullPathToTool when the ToolPath property is not set. - /// WiX never sets the ToolPath property, but the user can through $(WixToolDir). - /// If we return only a file name, ToolTask will search the system paths for it. - /// - protected sealed override string GenerateFullPathToTool() - { - var defaultToolFullPath = this.GetDefaultToolFullPath(); - -#if NETCOREAPP - // If we're pointing at an executable use that. - if (IsSelfExecutable(defaultToolFullPath, out var finalToolFullPath)) - { - return finalToolFullPath; - } - - // Otherwise, use "dotnet.exe" to run an assembly dll. - return Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet"; -#else - return defaultToolFullPath; -#endif - } - - /// - /// Builds a command line from options in this and derivative tasks. - /// - /// - /// Derivative classes should call BuildCommandLine() on the base class to ensure that common command line options are added to the command. - /// - protected virtual void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); - commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); - commandLineBuilder.AppendIfTrue("-sw", this.SuppressAllWarnings); - commandLineBuilder.AppendIfTrue("-v", this.VerboseOutput); - commandLineBuilder.AppendArrayIfNotNull("-wx", this.TreatSpecificWarningsAsErrors); - commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); - commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); - } - - protected sealed override string GenerateResponseFileCommands() - { - var commandLineBuilder = new WixCommandLineBuilder(); - this.BuildCommandLine(commandLineBuilder); - return commandLineBuilder.ToString(); - } - -#if NETCOREAPP - protected override string GenerateCommandLineCommands() - { - // If the target tool path is an executable, we don't need to add anything to the command-line. - var toolFullPath = this.GetToolFullPath(); - - if (IsSelfExecutable(toolFullPath, out var finalToolFullPath)) - { - return null; - } - else // we're using "dotnet.exe" to run the assembly so add "exec" plus path to the command-line. - { - return $"exec \"{finalToolFullPath}\""; - } - } - - private static bool IsSelfExecutable(string proposedToolFullPath, out string finalToolFullPath) - { - var toolFullPathWithoutExtension = Path.Combine(Path.GetDirectoryName(proposedToolFullPath), Path.GetFileNameWithoutExtension(proposedToolFullPath)); - var exeExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : String.Empty; - var exeToolFullPath = $"{toolFullPathWithoutExtension}{exeExtension}"; - if (File.Exists(exeToolFullPath)) - { - finalToolFullPath = exeToolFullPath; - return true; - } - - finalToolFullPath = $"{toolFullPathWithoutExtension}.dll"; - return false; - } -#else - private static string GetArchitectureFolder(string baseFolder) - { - // First try to find a folder that matches this task's architecture. - var folder = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); - - if (Directory.Exists(Path.Combine(baseFolder, folder))) - { - return folder; - } - - // Try to fallback to "x86" folder. - if (folder != "x86" && Directory.Exists(Path.Combine(baseFolder, "x86"))) - { - return "x86"; - } - - // Return empty, even though this isn't likely to be useful. - return String.Empty; - } -#endif - - private string GetDefaultToolFullPath() - { -#if NETCOREAPP - var thisTaskFolder = Path.GetDirectoryName(typeof(BaseToolsetTask).Assembly.Location); - - return Path.Combine(thisTaskFolder, this.ToolExe); -#else - var thisTaskFolder = Path.GetDirectoryName(new Uri(typeof(BaseToolsetTask).Assembly.CodeBase).AbsolutePath); - - var archFolder = GetArchitectureFolder(thisTaskFolder); - - return Path.Combine(thisTaskFolder, archFolder, this.ToolExe); -#endif - } - - private string GetToolFullPath() - { - if (String.IsNullOrEmpty(this.ToolPath)) - { - return this.GetDefaultToolFullPath(); - } - - return Path.Combine(this.ToolPath, this.ToolExe); - } - } -} diff --git a/src/internal/WixToolset.BaseBuildTasks.Sources/WixCommandLineBuilder.cs b/src/internal/WixToolset.BaseBuildTasks.Sources/WixCommandLineBuilder.cs deleted file mode 100644 index d950bca9..00000000 --- a/src/internal/WixToolset.BaseBuildTasks.Sources/WixCommandLineBuilder.cs +++ /dev/null @@ -1,104 +0,0 @@ -// 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. - -namespace WixToolset.BaseBuildTasks -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// Helper class for appending the command line arguments. - /// - public class WixCommandLineBuilder : CommandLineBuilder - { - internal const int Unspecified = -1; - - /// - /// Append a switch to the command line if the value has been specified. - /// - /// Switch to append. - /// Value specified by the user. - public void AppendIfSpecified(string switchName, int value) - { - if (value != Unspecified) - { - this.AppendSwitchIfNotNull(switchName, value.ToString(CultureInfo.InvariantCulture)); - } - } - - /// - /// Append a switch to the command line if the condition is true. - /// - /// Switch to append. - /// Condition specified by the user. - public void AppendIfTrue(string switchName, bool condition) - { - if (condition) - { - this.AppendSwitch(switchName); - } - } - - /// - /// Append a switch to the command line if any values in the array have been specified. - /// - /// Switch to append. - /// Values specified by the user. - public void AppendArrayIfNotNull(string switchName, IEnumerable values) - { - if (values != null) - { - foreach (ITaskItem value in values) - { - this.AppendSwitchIfNotNull(switchName, value); - } - } - } - - /// - /// Append a switch to the command line if any values in the array have been specified. - /// - /// Switch to append. - /// Values specified by the user. - public void AppendArrayIfNotNull(string switchName, IEnumerable values) - { - if (values != null) - { - foreach (string value in values) - { - this.AppendSwitchIfNotNull(switchName, value); - } - } - } - - /// - /// Append arbitrary text to the command-line if specified. - /// - /// Text to append. - public void AppendTextIfNotNull(string textToAppend) - { - if (!String.IsNullOrEmpty(textToAppend)) - { - this.AppendSpaceIfNotEmpty(); - this.AppendTextUnquoted(textToAppend); - } - } - - /// - /// Append arbitrary text to the command-line if specified. - /// - /// Text to append. - public void AppendTextIfNotWhitespace(string textToAppend) - { - if (!String.IsNullOrWhiteSpace(textToAppend)) - { - this.AppendSpaceIfNotEmpty(); - this.AppendTextUnquoted(textToAppend); - } - } - } -} diff --git a/src/internal/WixToolset.BaseBuildTasks.Sources/WixToolset.BaseBuildTasks.Sources.csproj b/src/internal/WixToolset.BaseBuildTasks.Sources/WixToolset.BaseBuildTasks.Sources.csproj deleted file mode 100644 index 6ae5165e..00000000 --- a/src/internal/WixToolset.BaseBuildTasks.Sources/WixToolset.BaseBuildTasks.Sources.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - netstandard2.0 - WiX Toolset BuildTasks Foundation Sources - true - false - false - contentFiles - true - false - false - CS8021 - true - true - true - - - - - - - - - - - - - - - - diff --git a/src/internal/internal.cmd b/src/internal/internal.cmd index 32df26e9..18b7b418 100644 --- a/src/internal/internal.cmd +++ b/src/internal/internal.cmd @@ -31,12 +31,12 @@ msbuild internal_t.proj -p:Configuration=%_C% -nologo -warnaserror -bl:%_L%\inte :clean @rd /s/q "..\..\build\internal" 2> nul -@del "..\..\build\artifacts\WixBuildTools.TestSupport.*.nupkg" 2> nul -@del "..\..\build\artifacts\WixBuildTools.TestSupport.Native.*.nupkg" 2> nul -@del "..\..\build\artifacts\WixToolset.BaseBuildTasks.Sources.*.nupkg" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixbuildtools.testsupport" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixbuildtools.testsupport.native" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.basebuildtasks.sources" 2> nul +@del "..\..\build\artifacts\WixInternal.TestSupport.*.nupkg" 2> nul +@del "..\..\build\artifacts\WixInternal.TestSupport.Native.*.nupkg" 2> nul +@del "..\..\build\artifacts\WixInternal.BaseBuildTasks.Sources.*.nupkg" 2> nul +@rd /s/q "%USERPROFILE%\.nuget\packages\wixinternal.testsupport" 2> nul +@rd /s/q "%USERPROFILE%\.nuget\packages\wixinternal.testsupport.native" 2> nul +@rd /s/q "%USERPROFILE%\.nuget\packages\wixinternal.basebuildtasks.sources" 2> nul @exit /b :end diff --git a/src/internal/internal.sln b/src/internal/internal.sln index fe36efbe..e8d8db17 100644 --- a/src/internal/internal.sln +++ b/src/internal/internal.sln @@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixBuildTools.TestSupport", "WixBuildTools.TestSupport\WixBuildTools.TestSupport.csproj", "{8E082709-7355-41D5-AF86-6BBF9C89BDD7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixInternal.TestSupport", "WixInternal.TestSupport\WixInternal.TestSupport.csproj", "{8E082709-7355-41D5-AF86-6BBF9C89BDD7}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WixBuildTools.TestSupport.Native", "WixBuildTools.TestSupport.Native\WixBuildTools.TestSupport.Native.vcxproj", "{95BABD97-FBDB-453A-AF8A-FA031A07B599}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WixInternal.TestSupport.Native", "WixInternal.TestSupport.Native\WixInternal.TestSupport.Native.vcxproj", "{95BABD97-FBDB-453A-AF8A-FA031A07B599}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.BaseBuildTasks.Sources", "WixToolset.BaseBuildTasks.Sources\WixToolset.BaseBuildTasks.Sources.csproj", "{6B654490-AB0D-4F94-B564-DAA80044D5A3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixInternal.BaseBuildTasks.Sources", "WixInternal.BaseBuildTasks.Sources\WixInternal.BaseBuildTasks.Sources.csproj", "{6B654490-AB0D-4F94-B564-DAA80044D5A3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/internal/internal_t.proj b/src/internal/internal_t.proj index fc4956d2..7dd52354 100644 --- a/src/internal/internal_t.proj +++ b/src/internal/internal_t.proj @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/src/libs/dutil/test/DUtilUnitTest/AppUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/AppUtilTests.cpp index e8c23469..ee4a80a6 100644 --- a/src/libs/dutil/test/DUtilUnitTest/AppUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/AppUtilTests.cpp @@ -6,7 +6,7 @@ namespace DutilTests { using namespace System; using namespace Xunit; - using namespace WixBuildTools::TestSupport; + using namespace WixInternal::TestSupport; public ref class AppUtil { diff --git a/src/libs/dutil/test/DUtilUnitTest/ApupUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/ApupUtilTests.cpp index 30a45f5a..c2371636 100644 --- a/src/libs/dutil/test/DUtilUnitTest/ApupUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/ApupUtilTests.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp index 5e2d69e1..dd17a50e 100644 --- a/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp @@ -4,8 +4,8 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; -using namespace WixBuildTools::TestSupport::XunitExtensions; +using namespace WixInternal::TestSupport; +using namespace WixInternal::TestSupport::XunitExtensions; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/DUtilUnitTest.vcxproj b/src/libs/dutil/test/DUtilUnitTest/DUtilUnitTest.vcxproj index ea66ef46..edf8ba67 100644 --- a/src/libs/dutil/test/DUtilUnitTest/DUtilUnitTest.vcxproj +++ b/src/libs/dutil/test/DUtilUnitTest/DUtilUnitTest.vcxproj @@ -2,7 +2,7 @@ - + @@ -94,5 +94,5 @@ - + diff --git a/src/libs/dutil/test/DUtilUnitTest/DictUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/DictUtilTest.cpp index 4b4777d7..22f71fe2 100644 --- a/src/libs/dutil/test/DUtilUnitTest/DictUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/DictUtilTest.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; const DWORD numIterations = 100000; diff --git a/src/libs/dutil/test/DUtilUnitTest/DirUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/DirUtilTests.cpp index 14ed7807..3475af87 100644 --- a/src/libs/dutil/test/DUtilUnitTest/DirUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/DirUtilTests.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/EnvUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/EnvUtilTests.cpp index 94b9ab8e..6bd78f0b 100644 --- a/src/libs/dutil/test/DUtilUnitTest/EnvUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/EnvUtilTests.cpp @@ -5,8 +5,8 @@ using namespace System; using namespace System::Collections; using namespace Xunit; -using namespace WixBuildTools::TestSupport; -using namespace WixBuildTools::TestSupport::XunitExtensions; +using namespace WixInternal::TestSupport; +using namespace WixInternal::TestSupport::XunitExtensions; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp index 522361ae..8ea045f5 100644 --- a/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/GuidUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/GuidUtilTest.cpp index a6e27a09..a184df68 100644 --- a/src/libs/dutil/test/DUtilUnitTest/GuidUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/GuidUtilTest.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/IniUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/IniUtilTest.cpp index 946f19c5..82a12ee8 100644 --- a/src/libs/dutil/test/DUtilUnitTest/IniUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/IniUtilTest.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; typedef HRESULT (__clrcall *IniFormatParameters)( INI_HANDLE diff --git a/src/libs/dutil/test/DUtilUnitTest/LocUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/LocUtilTests.cpp index c30ae2e1..0376a340 100644 --- a/src/libs/dutil/test/DUtilUnitTest/LocUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/LocUtilTests.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp index 520ed426..f835b3e1 100644 --- a/src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/MemUtilTest.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/MonUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/MonUtilTest.cpp index 09d0aeab..d9c75bf6 100644 --- a/src/libs/dutil/test/DUtilUnitTest/MonUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/MonUtilTest.cpp @@ -7,7 +7,7 @@ using namespace System; using namespace System::Collections::Generic; using namespace System::Runtime::InteropServices; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp index 109c558c..381ea39a 100644 --- a/src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/PathUtilTest.cpp @@ -5,7 +5,7 @@ using namespace System; using namespace System::IO; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; // from PathCch.h #ifndef PATHCCH_ALLOW_LONG_PATHS diff --git a/src/libs/dutil/test/DUtilUnitTest/ProcUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/ProcUtilTest.cpp index 8672ed38..e2cd5995 100644 --- a/src/libs/dutil/test/DUtilUnitTest/ProcUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/ProcUtilTest.cpp @@ -5,8 +5,8 @@ using namespace System; using namespace System::Security::Principal; using namespace Xunit; -using namespace WixBuildTools::TestSupport; -using namespace WixBuildTools::TestSupport::XunitExtensions; +using namespace WixInternal::TestSupport; +using namespace WixInternal::TestSupport::XunitExtensions; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/RegUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/RegUtilTest.cpp index 7c67bedf..569cec17 100644 --- a/src/libs/dutil/test/DUtilUnitTest/RegUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/RegUtilTest.cpp @@ -6,7 +6,7 @@ using namespace System; using namespace System::Collections::Generic; using namespace System::Runtime::InteropServices; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; LPCWSTR wzBaseRegKey = L"Software\\RegUtilTest\\"; LPWSTR rgwzMultiValue[2] = { L"First", L"Second" }; diff --git a/src/libs/dutil/test/DUtilUnitTest/StrUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/StrUtilTest.cpp index 94fee280..89ed3dbb 100644 --- a/src/libs/dutil/test/DUtilUnitTest/StrUtilTest.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/StrUtilTest.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp index 3e414006..d0ada77f 100644 --- a/src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/VerUtilTests.cpp @@ -4,7 +4,7 @@ using namespace System; using namespace Xunit; -using namespace WixBuildTools::TestSupport; +using namespace WixInternal::TestSupport; namespace DutilTests { diff --git a/src/libs/test/WixToolsetTest.Versioning/WixToolsetTest.Versioning.csproj b/src/libs/test/WixToolsetTest.Versioning/WixToolsetTest.Versioning.csproj index 0ac65fec..79d4ef35 100644 --- a/src/libs/test/WixToolsetTest.Versioning/WixToolsetTest.Versioning.csproj +++ b/src/libs/test/WixToolsetTest.Versioning/WixToolsetTest.Versioning.csproj @@ -12,6 +12,6 @@ - + diff --git a/src/test/burn/WixTestTools/BundleVerifier.cs b/src/test/burn/WixTestTools/BundleVerifier.cs index 3a19ca02..b750c80c 100644 --- a/src/test/burn/WixTestTools/BundleVerifier.cs +++ b/src/test/burn/WixTestTools/BundleVerifier.cs @@ -7,7 +7,7 @@ namespace WixTestTools using System.Linq; using System.Text; using Microsoft.Win32; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/test/burn/WixTestTools/MSIExec.cs b/src/test/burn/WixTestTools/MSIExec.cs index fb161495..98f54c56 100644 --- a/src/test/burn/WixTestTools/MSIExec.cs +++ b/src/test/burn/WixTestTools/MSIExec.cs @@ -5,7 +5,7 @@ namespace WixTestTools using System; using System.IO; using System.Text; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; public class MSIExec : TestTool { diff --git a/src/test/burn/WixTestTools/RuntimeFactAttribute.cs b/src/test/burn/WixTestTools/RuntimeFactAttribute.cs index fcd19b95..f73c87a2 100644 --- a/src/test/burn/WixTestTools/RuntimeFactAttribute.cs +++ b/src/test/burn/WixTestTools/RuntimeFactAttribute.cs @@ -4,7 +4,7 @@ namespace WixTestTools { using System; using System.Security.Principal; - using WixBuildTools.TestSupport.XunitExtensions; + using WixInternal.TestSupport.XunitExtensions; public class RuntimeFactAttribute : SkippableFactAttribute { diff --git a/src/test/burn/WixTestTools/TestTool.cs b/src/test/burn/WixTestTools/TestTool.cs index 79e7004c..b6d18ac9 100644 --- a/src/test/burn/WixTestTools/TestTool.cs +++ b/src/test/burn/WixTestTools/TestTool.cs @@ -6,7 +6,7 @@ namespace WixTestTools using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using Xunit; public class TestTool : ExternalExecutable diff --git a/src/test/burn/WixTestTools/WixTestContext.cs b/src/test/burn/WixTestTools/WixTestContext.cs index a4e666f1..a87a56fa 100644 --- a/src/test/burn/WixTestTools/WixTestContext.cs +++ b/src/test/burn/WixTestTools/WixTestContext.cs @@ -7,7 +7,7 @@ namespace WixTestTools using System.Linq; using System.Reflection; using Microsoft.Win32; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using Xunit.Abstractions; public class WixTestContext diff --git a/src/test/burn/WixTestTools/WixTestTools.csproj b/src/test/burn/WixTestTools/WixTestTools.csproj index 47456868..65db5a60 100644 --- a/src/test/burn/WixTestTools/WixTestTools.csproj +++ b/src/test/burn/WixTestTools/WixTestTools.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/test/burn/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs index 4d915c02..8b513372 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.BurnE2E { using System; using System.IO; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixTestTools; using Xunit; using Xunit.Abstractions; diff --git a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs index afc3fc10..16623ffb 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs @@ -6,7 +6,7 @@ namespace WixToolsetTest.BurnE2E using System.Collections.Generic; using System.IO; using Microsoft.Win32; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixTestTools; using WixToolset.Mba.Core; using Xunit; diff --git a/src/test/burn/WixToolsetTest.BurnE2E/LayoutTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/LayoutTests.cs index 14c3cd5d..44918304 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/LayoutTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/LayoutTests.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.BurnE2E { using System.Collections.Generic; using System.IO; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixTestTools; using Xunit; using Xunit.Abstractions; diff --git a/src/test/burn/WixToolsetTest.BurnE2E/LongPathTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/LongPathTests.cs index b751ff75..e7732d82 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/LongPathTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/LongPathTests.cs @@ -7,7 +7,7 @@ namespace WixToolsetTest.BurnE2E using System.IO; using System.Runtime.InteropServices; using Microsoft.Win32; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixTestTools; using WixToolset.Mba.Core; using Xunit; diff --git a/src/test/burn/WixToolsetTest.BurnE2E/Utilities/TestExeTool.cs b/src/test/burn/WixToolsetTest.BurnE2E/Utilities/TestExeTool.cs index 07442cd3..b552a0a0 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/Utilities/TestExeTool.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/Utilities/TestExeTool.cs @@ -3,7 +3,7 @@ namespace WixTestTools { using System.IO; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; public class TestExeTool : TestTool { diff --git a/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs index e7b1362f..22e94260 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.BurnE2E { using System.Collections.Generic; using System.IO; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixTestTools; using WixToolset.Mba.Core; using Xunit; diff --git a/src/test/burn/WixToolsetTest.BurnE2E/WixToolsetTest.BurnE2E.csproj b/src/test/burn/WixToolsetTest.BurnE2E/WixToolsetTest.BurnE2E.csproj index 7305dcbf..a5099d9b 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/WixToolsetTest.BurnE2E.csproj +++ b/src/test/burn/WixToolsetTest.BurnE2E/WixToolsetTest.BurnE2E.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/test/msi/WixToolsetTest.MsiE2E/WixToolsetTest.MsiE2E.csproj b/src/test/msi/WixToolsetTest.MsiE2E/WixToolsetTest.MsiE2E.csproj index 7e479327..d64c942a 100644 --- a/src/test/msi/WixToolsetTest.MsiE2E/WixToolsetTest.MsiE2E.csproj +++ b/src/test/msi/WixToolsetTest.MsiE2E/WixToolsetTest.MsiE2E.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/test/wix/WixE2E/WixE2E.csproj b/src/test/wix/WixE2E/WixE2E.csproj index d85cc152..055df524 100644 --- a/src/test/wix/WixE2E/WixE2E.csproj +++ b/src/test/wix/WixE2E/WixE2E.csproj @@ -12,6 +12,6 @@ - + diff --git a/src/test/wix/WixE2E/WixE2EFixture.cs b/src/test/wix/WixE2E/WixE2EFixture.cs index 5574680f..88902206 100644 --- a/src/test/wix/WixE2E/WixE2EFixture.cs +++ b/src/test/wix/WixE2E/WixE2EFixture.cs @@ -8,7 +8,7 @@ namespace WixE2E using System.Security.Cryptography; using System.Text; using System.Threading; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using Xunit; public class WixE2EFixture diff --git a/src/tools/WixToolset.HeatTasks/WixToolset.HeatTasks.csproj b/src/tools/WixToolset.HeatTasks/WixToolset.HeatTasks.csproj index a8538d9e..21460810 100644 --- a/src/tools/WixToolset.HeatTasks/WixToolset.HeatTasks.csproj +++ b/src/tools/WixToolset.HeatTasks/WixToolset.HeatTasks.csproj @@ -12,6 +12,6 @@ - + diff --git a/src/tools/test/WixToolsetTest.Heat/HeatFixture.cs b/src/tools/test/WixToolsetTest.Heat/HeatFixture.cs index befcedcc..388d4dc0 100644 --- a/src/tools/test/WixToolsetTest.Heat/HeatFixture.cs +++ b/src/tools/test/WixToolsetTest.Heat/HeatFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Heat { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using Xunit; public class HeatFixture diff --git a/src/tools/test/WixToolsetTest.Heat/HeatRunner.cs b/src/tools/test/WixToolsetTest.Heat/HeatRunner.cs index c914dcac..e4004300 100644 --- a/src/tools/test/WixToolsetTest.Heat/HeatRunner.cs +++ b/src/tools/test/WixToolsetTest.Heat/HeatRunner.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.Heat using System.Collections.Generic; using System.Threading.Tasks; using WixToolset.Core; - using WixToolset.Core.TestPackage; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Extensibility.Services; using WixToolset.Tools.Heat; diff --git a/src/tools/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj b/src/tools/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj index cb4deae1..fb86ecdf 100644 --- a/src/tools/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj +++ b/src/tools/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj @@ -17,6 +17,6 @@ - + diff --git a/src/tools/test/WixToolsetTest.HeatTasks/MsbuildHeatFixture.cs b/src/tools/test/WixToolsetTest.HeatTasks/MsbuildHeatFixture.cs index a0a98578..1b7e1a32 100644 --- a/src/tools/test/WixToolsetTest.HeatTasks/MsbuildHeatFixture.cs +++ b/src/tools/test/WixToolsetTest.HeatTasks/MsbuildHeatFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.Sdk using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.csproj b/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.csproj index 03b7cb88..390154de 100644 --- a/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.csproj +++ b/src/tools/test/WixToolsetTest.HeatTasks/WixToolsetTest.HeatTasks.csproj @@ -14,7 +14,7 @@ - - + + diff --git a/src/wix/WixInternal.Core.TestPackage/BundleExtractor.cs b/src/wix/WixInternal.Core.TestPackage/BundleExtractor.cs new file mode 100644 index 00000000..dc4005a5 --- /dev/null +++ b/src/wix/WixInternal.Core.TestPackage/BundleExtractor.cs @@ -0,0 +1,156 @@ +// 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. + +namespace WixInternal.Core.TestPackage +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Xml; + using WixToolset.Data.Burn; + using WixToolset.Extensibility.Services; + + /// + /// Class to extract bundle contents for testing. + /// + public class BundleExtractor + { + private const string BurnNamespace = "http://wixtoolset.org/schemas/v4/2008/Burn"; + private const string BADataFileName = "BootstrapperApplicationData.xml"; + private const string BundleExtensionDataFileName = "BundleExtensionData.xml"; + + /// + /// Extracts the BA container. + /// + /// + /// Path to the bundle. + /// Path to extract to. + /// Temp path for extraction. + /// + public static ExtractBAContainerResult ExtractBAContainer(IMessaging messaging, string bundleFilePath, string destinationFolderPath, string tempFolderPath) + { + return ExtractAllContainers(messaging, bundleFilePath, destinationFolderPath, null, tempFolderPath); + } + + /// + /// Extracts the BA container. + /// + /// + /// Path to the bundle. + /// Path to extract BA to. + /// Optional path to extract other attached containers to. + /// Temp path for extraction. + /// + public static ExtractBAContainerResult ExtractAllContainers(IMessaging messaging, string bundleFilePath, string baFolderPath, string otherContainersFolderPath, string tempFolderPath) + { + Directory.CreateDirectory(tempFolderPath); + + var args = new List + { + "burn", "extract", + "-intermediatefolder", tempFolderPath, + bundleFilePath, + "-oba", baFolderPath + }; + + if (!String.IsNullOrEmpty(otherContainersFolderPath)) + { + args.Add("-o"); + args.Add(otherContainersFolderPath); + } + + var runnerResult = WixRunner.Execute(args.ToArray()); + + var result = new ExtractBAContainerResult(); + + if (runnerResult.ExitCode == 0) + { + result.Success = true; + result.ManifestDocument = LoadBurnManifest(baFolderPath); + result.ManifestNamespaceManager = GetBurnNamespaceManager(result.ManifestDocument, "burn"); + + result.BADataDocument = LoadBAData(baFolderPath); + result.BADataNamespaceManager = GetBADataNamespaceManager(result.BADataDocument, "ba"); + + result.BundleExtensionDataDocument = LoadBundleExtensionData(baFolderPath); + result.BundleExtensionDataNamespaceManager = GetBundleExtensionDataNamespaceManager(result.BundleExtensionDataDocument, "be"); + } + + return result; + } + + /// + /// Gets an for BootstrapperApplicationData.xml with the given prefix assigned to the root namespace. + /// + /// + /// + /// + public static XmlNamespaceManager GetBADataNamespaceManager(XmlDocument document, string prefix) + { + var namespaceManager = new XmlNamespaceManager(document.NameTable); + namespaceManager.AddNamespace(prefix, BurnConstants.BootstrapperApplicationDataNamespace); + return namespaceManager; + } + + /// + /// Gets an for BundleExtensionData.xml with the given prefix assigned to the root namespace. + /// + /// + /// + /// + public static XmlNamespaceManager GetBundleExtensionDataNamespaceManager(XmlDocument document, string prefix) + { + var namespaceManager = new XmlNamespaceManager(document.NameTable); + namespaceManager.AddNamespace(prefix, BurnConstants.BundleExtensionDataNamespace); + return namespaceManager; + } + + /// + /// Gets an for the Burn manifest.xml with the given prefix assigned to the root namespace. + /// + /// + /// + /// + public static XmlNamespaceManager GetBurnNamespaceManager(XmlDocument document, string prefix) + { + var namespaceManager = new XmlNamespaceManager(document.NameTable); + namespaceManager.AddNamespace(prefix, BurnNamespace); + return namespaceManager; + } + + /// + /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. + /// + /// + /// + public static XmlDocument LoadBAData(string baFolderPath) + { + var document = new XmlDocument(); + document.Load(Path.Combine(baFolderPath, BADataFileName)); + return document; + } + + /// + /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. + /// + /// + /// + public static XmlDocument LoadBundleExtensionData(string baFolderPath) + { + var document = new XmlDocument(); + document.Load(Path.Combine(baFolderPath, BundleExtensionDataFileName)); + return document; + } + + /// + /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. + /// + /// + /// + public static XmlDocument LoadBurnManifest(string baFolderPath) + { + var document = new XmlDocument(); + document.Load(Path.Combine(baFolderPath, "manifest.xml")); + return document; + } + } +} diff --git a/src/wix/WixInternal.Core.TestPackage/ExtractBAContainerResult.cs b/src/wix/WixInternal.Core.TestPackage/ExtractBAContainerResult.cs new file mode 100644 index 00000000..ab45d68e --- /dev/null +++ b/src/wix/WixInternal.Core.TestPackage/ExtractBAContainerResult.cs @@ -0,0 +1,156 @@ +// 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. + +namespace WixInternal.Core.TestPackage +{ + using System.Collections.Generic; + using System.IO; + using System.Xml; + using Xunit; + + /// + /// The result of extracting the BA container. + /// + public class ExtractBAContainerResult + { + /// + /// for BundleExtensionData.xml. + /// + public XmlDocument BundleExtensionDataDocument { get; set; } + + /// + /// for BundleExtensionData.xml. + /// + public XmlNamespaceManager BundleExtensionDataNamespaceManager { get; set; } + + /// + /// for BootstrapperApplicationData.xml. + /// + public XmlDocument BADataDocument { get; set; } + + /// + /// for BootstrapperApplicationData.xml. + /// + public XmlNamespaceManager BADataNamespaceManager { get; set; } + + /// + /// for the Burn manifest.xml. + /// + public XmlDocument ManifestDocument { get; set; } + + /// + /// for the Burn manifest.xml. + /// + public XmlNamespaceManager ManifestNamespaceManager { get; set; } + + /// + /// Whether extraction succeeded. + /// + public bool Success { get; set; } + + /// + /// Whether attached containers extraction succeeded. + /// + public bool? AttachedContainersSuccess { get; set; } + + /// + /// + /// + /// + public ExtractBAContainerResult AssertSuccess() + { + Assert.True(this.Success); + Assert.True(!this.AttachedContainersSuccess.HasValue || this.AttachedContainersSuccess.Value); + return this; + } + + /// + /// Returns the relative path of the BA entry point dll in the given folder. + /// + /// + /// + public string GetBAFilePath(string extractedBAContainerFolderPath) + { + var uxPayloads = this.SelectManifestNodes("/burn:BurnManifest/burn:UX/burn:Payload"); + var baPayload = uxPayloads[0]; + var relativeBAPath = baPayload.Attributes["FilePath"].Value; + return Path.Combine(extractedBAContainerFolderPath, relativeBAPath); + } + + /// + /// Returns the relative path of the BundleExtension entry point dll in the given folder. + /// + /// + /// + /// + public string GetBundleExtensionFilePath(string extractedBAContainerFolderPath, string extensionId) + { + var uxPayloads = this.SelectManifestNodes($"/burn:BurnManifest/burn:UX/burn:Payload[@Id='{extensionId}']"); + var bextPayload = uxPayloads[0]; + var relativeBextPath = bextPayload.Attributes["FilePath"].Value; + return Path.Combine(extractedBAContainerFolderPath, relativeBextPath); + } + + /// + /// + /// + /// elements must have the 'ba' prefix + /// + public XmlNodeList SelectBADataNodes(string xpath) + { + return this.BADataDocument.SelectNodes(xpath, this.BADataNamespaceManager); + } + + /// + /// + /// + /// elements must have the 'ba' prefix + /// Attributes for which the value should be set to '*'. + /// + public string[] GetBADataTestXmlLines(string xpath, Dictionary> ignoredAttributesByElementName = null) + { + return this.SelectBADataNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); + } + + /// + /// + /// + /// elements must have the 'be' prefix + /// + public XmlNodeList SelectBundleExtensionDataNodes(string xpath) + { + return this.BundleExtensionDataDocument.SelectNodes(xpath, this.BundleExtensionDataNamespaceManager); + } + + /// + /// + /// + /// elements must have the 'be' prefix + /// Attributes for which the value should be set to '*'. + /// + public string[] GetBundleExtensionTestXmlLines(string xpath, Dictionary> ignoredAttributesByElementName = null) + { + return this.SelectBundleExtensionDataNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); + } + + /// + /// + /// + /// elements must have the 'burn' prefix + /// + public XmlNodeList SelectManifestNodes(string xpath) + { + return this.ManifestDocument.SelectNodes(xpath, this.ManifestNamespaceManager); + } + + /// + /// + /// + /// elements must have the 'burn' prefix + /// Attributes for which the value should be set to '*'. + /// + public string[] GetManifestTestXmlLines(string xpath, Dictionary> ignoredAttributesByElementName = null) + { + return this.SelectManifestNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); + } + } +} diff --git a/src/wix/WixInternal.Core.TestPackage/TestMessageListener.cs b/src/wix/WixInternal.Core.TestPackage/TestMessageListener.cs new file mode 100644 index 00000000..db536e2a --- /dev/null +++ b/src/wix/WixInternal.Core.TestPackage/TestMessageListener.cs @@ -0,0 +1,57 @@ +// 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. + +namespace WixInternal.Core.TestPackage +{ + using System.Collections.Generic; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + /// + /// An that simply stores all the messages. + /// + public sealed class TestMessageListener : IMessageListener + { + /// + /// All messages that have been received. + /// + public List Messages { get; } = new List(); + + /// + /// + /// + public string ShortAppName => "TEST"; + + /// + /// + /// + public string LongAppName => "Test"; + + /// + /// Stores the message in . + /// + /// + public void Write(Message message) + { + this.Messages.Add(message); + } + + /// + /// Stores the message in . + /// + /// + public void Write(string message) + { + this.Messages.Add(new Message(null, MessageLevel.Information, 0, message)); + } + + /// + /// Always returns defaultMessageLevel. + /// + /// + /// + /// + /// + public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; + } +} diff --git a/src/wix/WixInternal.Core.TestPackage/WixInternal.Core.TestPackage.csproj b/src/wix/WixInternal.Core.TestPackage/WixInternal.Core.TestPackage.csproj new file mode 100644 index 00000000..3c56ee86 --- /dev/null +++ b/src/wix/WixInternal.Core.TestPackage/WixInternal.Core.TestPackage.csproj @@ -0,0 +1,36 @@ + + + + + + netstandard2.0 + $(TargetFrameworks);net472 + Internal WiX Toolset Test Package + embedded + true + true + false + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/WixInternal.Core.TestPackage/WixInternal.Core.TestPackage.v3.ncrunchproject b/src/wix/WixInternal.Core.TestPackage/WixInternal.Core.TestPackage.v3.ncrunchproject new file mode 100644 index 00000000..cff5044e --- /dev/null +++ b/src/wix/WixInternal.Core.TestPackage/WixInternal.Core.TestPackage.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + False + + \ No newline at end of file diff --git a/src/wix/WixInternal.Core.TestPackage/WixRunner.cs b/src/wix/WixInternal.Core.TestPackage/WixRunner.cs new file mode 100644 index 00000000..e2420a6b --- /dev/null +++ b/src/wix/WixInternal.Core.TestPackage/WixRunner.cs @@ -0,0 +1,90 @@ +// 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. + +namespace WixInternal.Core.TestPackage +{ + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Core; + using WixToolset.Core.Burn; + using WixToolset.Core.ExtensionCache; + using WixToolset.Core.WindowsInstaller; + using WixToolset.Data; + using WixToolset.Extensibility.Services; + + /// + /// Utility class to emulate wix.exe with standard backends. + /// + public static class WixRunner + { + /// + /// Emulates calling wix.exe with standard backends. + /// + /// + /// + /// + /// + public static int Execute(string[] args, out List messages, bool warningsAsErrors = true) + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var task = Execute(args, serviceProvider, out messages, warningsAsErrors: warningsAsErrors); + return task.Result; + } + + /// + /// Emulates calling wix.exe with standard backends. + /// This overload always treats warnings as errors. + /// + /// + /// + public static WixRunnerResult Execute(params string[] args) + { + return Execute(true, args); + } + + /// + /// Emulates calling wix.exe with standard backends. + /// + /// + /// + /// + public static WixRunnerResult Execute(bool warningsAsErrors, params string[] args) + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var exitCode = Execute(args, serviceProvider, out var messages, warningsAsErrors: warningsAsErrors); + return new WixRunnerResult { ExitCode = exitCode.Result, Messages = messages.ToArray() }; + } + + /// + /// Emulates calling wix.exe with standard backends. + /// + /// + /// + /// + /// + /// + public static Task Execute(string[] args, IWixToolsetCoreServiceProvider coreProvider, out List messages, bool warningsAsErrors = true) + { + coreProvider.AddWindowsInstallerBackend() + .AddBundleBackend() + .AddExtensionCacheManager(); + + var listener = new TestMessageListener(); + + messages = listener.Messages; + + var messaging = coreProvider.GetService(); + messaging.SetListener(listener); + + var arguments = new List(args); + if (warningsAsErrors) + { + arguments.Add("-wx"); + } + + var commandLine = coreProvider.GetService(); + var command = commandLine.CreateCommand(arguments.ToArray()); + return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); + } + } +} diff --git a/src/wix/WixInternal.Core.TestPackage/WixRunnerResult.cs b/src/wix/WixInternal.Core.TestPackage/WixRunnerResult.cs new file mode 100644 index 00000000..9e7fa2f0 --- /dev/null +++ b/src/wix/WixInternal.Core.TestPackage/WixRunnerResult.cs @@ -0,0 +1,62 @@ +// 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. + +namespace WixInternal.Core.TestPackage +{ + using System; + using System.Collections.Generic; + using WixToolset.Data; + using Xunit; + + /// + /// The result of an Execute method of . + /// + public class WixRunnerResult + { + /// + /// ExitCode for the operation. + /// + public int ExitCode { get; set; } + + /// + /// Messages from the operation. + /// + public Message[] Messages { get; set; } + + /// + /// + /// + /// + public WixRunnerResult AssertSuccess() + { + AssertSuccess(this.ExitCode, this.Messages); + return this; + } + + /// + /// + /// + /// + /// + public static void AssertSuccess(int exitCode, IEnumerable messages) + { + Assert.True(0 == exitCode, $"\r\n\r\nWixRunner failed with exit code: {exitCode}\r\n Output: {String.Join("\r\n ", FormatMessages(messages))}\r\n"); + } + + private static IEnumerable FormatMessages(IEnumerable messages) + { + foreach (var message in messages) + { + var filename = message.SourceLineNumbers?.FileName ?? "TEST"; + var line = message.SourceLineNumbers?.LineNumber ?? -1; + var type = message.Level.ToString().ToLowerInvariant(); + + if (line > 0) + { + filename = String.Concat(filename, "(", line, ")"); + } + + yield return String.Format("{0} : {1} {2}{3:0000}: {4}", filename, type, "TEST", message.Id, message.ToString()); + } + } + } +} diff --git a/src/wix/WixInternal.Core.TestPackage/XmlNodeExtensions.cs b/src/wix/WixInternal.Core.TestPackage/XmlNodeExtensions.cs new file mode 100644 index 00000000..4fb9b705 --- /dev/null +++ b/src/wix/WixInternal.Core.TestPackage/XmlNodeExtensions.cs @@ -0,0 +1,115 @@ +// 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. + +namespace WixInternal.Core.TestPackage +{ + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Text.RegularExpressions; + using System.Xml; + + /// + /// Utility class to help compare XML in tests using string comparisons by using single quotes and stripping all namespaces. + /// + public static class XmlNodeExtensions + { + /// + /// Adds root element around XML then returns it using single quotes and stripping all namespaces. + /// + /// + /// Attributes for which the value should be set to '*'. + /// + public static string GetFragmentTestXml(this string xmlFragment, Dictionary> ignoredAttributesByElementName = null) + { + return $"{xmlFragment}".GetTestXml(ignoredAttributesByElementName); + } + + /// + /// Returns the node's outer XML using single quotes and stripping all namespaces. + /// + /// + /// Attributes for which the value should be set to '*'. + /// + public static string GetTestXml(this XmlNode node, Dictionary> ignoredAttributesByElementName = null) + { + return node.OuterXml.GetTestXml(ignoredAttributesByElementName); + } + + /// + /// Returns the XML using single quotes and stripping all namespaces. + /// + /// + /// Attributes for which the value should be set to '*'. + /// + public static string GetTestXml(this string xml, Dictionary> ignoredAttributesByElementName = null) + { + string formattedXml; + using (var sw = new StringWriter()) + using (var writer = new TestXmlWriter(sw)) + { + var doc = new XmlDocument(); + doc.LoadXml(xml); + + if (ignoredAttributesByElementName != null) + { + HandleIgnoredAttributes(doc, ignoredAttributesByElementName); + } + + doc.Save(writer); + formattedXml = sw.ToString(); + } + + return Regex.Replace(formattedXml, " xmlns(:[^=]+)?='[^']*'", ""); + } + + /// + /// Returns the XML for each node using single quotes and stripping all namespaces. + /// + /// + /// Attributes for which the value should be set to '*'. + /// + public static string[] GetTestXmlLines(this XmlNodeList nodeList, Dictionary> ignoredAttributesByElementName = null) + { + return nodeList.Cast() + .Select(x => x.GetTestXml(ignoredAttributesByElementName)) + .ToArray(); + } + + private static void HandleIgnoredAttributes(XmlNode node, Dictionary> ignoredAttributesByElementName) + { + if (node.Attributes != null && ignoredAttributesByElementName.TryGetValue(node.LocalName, out var ignoredAttributes)) + { + foreach (var ignoredAttribute in ignoredAttributes) + { + var attribute = node.Attributes[ignoredAttribute]; + if (attribute != null) + { + attribute.Value = "*"; + } + } + } + + if (node.ChildNodes != null) + { + foreach (XmlNode childNode in node.ChildNodes) + { + HandleIgnoredAttributes(childNode, ignoredAttributesByElementName); + } + } + } + + private class TestXmlWriter : XmlTextWriter + { + public TestXmlWriter(TextWriter w) + : base(w) + { + this.QuoteChar = '\''; + } + + public override void WriteStartDocument() + { + //OmitXmlDeclaration + } + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 8088462f..2938abe2 100644 --- a/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/wix/WixToolset.Core.TestPackage/BundleExtractor.cs b/src/wix/WixToolset.Core.TestPackage/BundleExtractor.cs deleted file mode 100644 index 3161c4eb..00000000 --- a/src/wix/WixToolset.Core.TestPackage/BundleExtractor.cs +++ /dev/null @@ -1,156 +0,0 @@ -// 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. - -namespace WixToolset.Core.TestPackage -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Xml; - using WixToolset.Data.Burn; - using WixToolset.Extensibility.Services; - - /// - /// Class to extract bundle contents for testing. - /// - public class BundleExtractor - { - private const string BurnNamespace = "http://wixtoolset.org/schemas/v4/2008/Burn"; - private const string BADataFileName = "BootstrapperApplicationData.xml"; - private const string BundleExtensionDataFileName = "BundleExtensionData.xml"; - - /// - /// Extracts the BA container. - /// - /// - /// Path to the bundle. - /// Path to extract to. - /// Temp path for extraction. - /// - public static ExtractBAContainerResult ExtractBAContainer(IMessaging messaging, string bundleFilePath, string destinationFolderPath, string tempFolderPath) - { - return ExtractAllContainers(messaging, bundleFilePath, destinationFolderPath, null, tempFolderPath); - } - - /// - /// Extracts the BA container. - /// - /// - /// Path to the bundle. - /// Path to extract BA to. - /// Optional path to extract other attached containers to. - /// Temp path for extraction. - /// - public static ExtractBAContainerResult ExtractAllContainers(IMessaging messaging, string bundleFilePath, string baFolderPath, string otherContainersFolderPath, string tempFolderPath) - { - Directory.CreateDirectory(tempFolderPath); - - var args = new List - { - "burn", "extract", - "-intermediatefolder", tempFolderPath, - bundleFilePath, - "-oba", baFolderPath - }; - - if (!String.IsNullOrEmpty(otherContainersFolderPath)) - { - args.Add("-o"); - args.Add(otherContainersFolderPath); - } - - var runnerResult = WixRunner.Execute(args.ToArray()); - - var result = new ExtractBAContainerResult(); - - if (runnerResult.ExitCode == 0) - { - result.Success = true; - result.ManifestDocument = LoadBurnManifest(baFolderPath); - result.ManifestNamespaceManager = GetBurnNamespaceManager(result.ManifestDocument, "burn"); - - result.BADataDocument = LoadBAData(baFolderPath); - result.BADataNamespaceManager = GetBADataNamespaceManager(result.BADataDocument, "ba"); - - result.BundleExtensionDataDocument = LoadBundleExtensionData(baFolderPath); - result.BundleExtensionDataNamespaceManager = GetBundleExtensionDataNamespaceManager(result.BundleExtensionDataDocument, "be"); - } - - return result; - } - - /// - /// Gets an for BootstrapperApplicationData.xml with the given prefix assigned to the root namespace. - /// - /// - /// - /// - public static XmlNamespaceManager GetBADataNamespaceManager(XmlDocument document, string prefix) - { - var namespaceManager = new XmlNamespaceManager(document.NameTable); - namespaceManager.AddNamespace(prefix, BurnConstants.BootstrapperApplicationDataNamespace); - return namespaceManager; - } - - /// - /// Gets an for BundleExtensionData.xml with the given prefix assigned to the root namespace. - /// - /// - /// - /// - public static XmlNamespaceManager GetBundleExtensionDataNamespaceManager(XmlDocument document, string prefix) - { - var namespaceManager = new XmlNamespaceManager(document.NameTable); - namespaceManager.AddNamespace(prefix, BurnConstants.BundleExtensionDataNamespace); - return namespaceManager; - } - - /// - /// Gets an for the Burn manifest.xml with the given prefix assigned to the root namespace. - /// - /// - /// - /// - public static XmlNamespaceManager GetBurnNamespaceManager(XmlDocument document, string prefix) - { - var namespaceManager = new XmlNamespaceManager(document.NameTable); - namespaceManager.AddNamespace(prefix, BurnNamespace); - return namespaceManager; - } - - /// - /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. - /// - /// - /// - public static XmlDocument LoadBAData(string baFolderPath) - { - var document = new XmlDocument(); - document.Load(Path.Combine(baFolderPath, BADataFileName)); - return document; - } - - /// - /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. - /// - /// - /// - public static XmlDocument LoadBundleExtensionData(string baFolderPath) - { - var document = new XmlDocument(); - document.Load(Path.Combine(baFolderPath, BundleExtensionDataFileName)); - return document; - } - - /// - /// Loads an XmlDocument with the BootstrapperApplicationData.xml from the given folder that contains the contents of the BA container. - /// - /// - /// - public static XmlDocument LoadBurnManifest(string baFolderPath) - { - var document = new XmlDocument(); - document.Load(Path.Combine(baFolderPath, "manifest.xml")); - return document; - } - } -} diff --git a/src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs b/src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs deleted file mode 100644 index 5f4a5369..00000000 --- a/src/wix/WixToolset.Core.TestPackage/ExtractBAContainerResult.cs +++ /dev/null @@ -1,156 +0,0 @@ -// 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. - -namespace WixToolset.Core.TestPackage -{ - using System.Collections.Generic; - using System.IO; - using System.Xml; - using Xunit; - - /// - /// The result of extracting the BA container. - /// - public class ExtractBAContainerResult - { - /// - /// for BundleExtensionData.xml. - /// - public XmlDocument BundleExtensionDataDocument { get; set; } - - /// - /// for BundleExtensionData.xml. - /// - public XmlNamespaceManager BundleExtensionDataNamespaceManager { get; set; } - - /// - /// for BootstrapperApplicationData.xml. - /// - public XmlDocument BADataDocument { get; set; } - - /// - /// for BootstrapperApplicationData.xml. - /// - public XmlNamespaceManager BADataNamespaceManager { get; set; } - - /// - /// for the Burn manifest.xml. - /// - public XmlDocument ManifestDocument { get; set; } - - /// - /// for the Burn manifest.xml. - /// - public XmlNamespaceManager ManifestNamespaceManager { get; set; } - - /// - /// Whether extraction succeeded. - /// - public bool Success { get; set; } - - /// - /// Whether attached containers extraction succeeded. - /// - public bool? AttachedContainersSuccess { get; set; } - - /// - /// - /// - /// - public ExtractBAContainerResult AssertSuccess() - { - Assert.True(this.Success); - Assert.True(!this.AttachedContainersSuccess.HasValue || this.AttachedContainersSuccess.Value); - return this; - } - - /// - /// Returns the relative path of the BA entry point dll in the given folder. - /// - /// - /// - public string GetBAFilePath(string extractedBAContainerFolderPath) - { - var uxPayloads = this.SelectManifestNodes("/burn:BurnManifest/burn:UX/burn:Payload"); - var baPayload = uxPayloads[0]; - var relativeBAPath = baPayload.Attributes["FilePath"].Value; - return Path.Combine(extractedBAContainerFolderPath, relativeBAPath); - } - - /// - /// Returns the relative path of the BundleExtension entry point dll in the given folder. - /// - /// - /// - /// - public string GetBundleExtensionFilePath(string extractedBAContainerFolderPath, string extensionId) - { - var uxPayloads = this.SelectManifestNodes($"/burn:BurnManifest/burn:UX/burn:Payload[@Id='{extensionId}']"); - var bextPayload = uxPayloads[0]; - var relativeBextPath = bextPayload.Attributes["FilePath"].Value; - return Path.Combine(extractedBAContainerFolderPath, relativeBextPath); - } - - /// - /// - /// - /// elements must have the 'ba' prefix - /// - public XmlNodeList SelectBADataNodes(string xpath) - { - return this.BADataDocument.SelectNodes(xpath, this.BADataNamespaceManager); - } - - /// - /// - /// - /// elements must have the 'ba' prefix - /// Attributes for which the value should be set to '*'. - /// - public string[] GetBADataTestXmlLines(string xpath, Dictionary> ignoredAttributesByElementName = null) - { - return this.SelectBADataNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); - } - - /// - /// - /// - /// elements must have the 'be' prefix - /// - public XmlNodeList SelectBundleExtensionDataNodes(string xpath) - { - return this.BundleExtensionDataDocument.SelectNodes(xpath, this.BundleExtensionDataNamespaceManager); - } - - /// - /// - /// - /// elements must have the 'be' prefix - /// Attributes for which the value should be set to '*'. - /// - public string[] GetBundleExtensionTestXmlLines(string xpath, Dictionary> ignoredAttributesByElementName = null) - { - return this.SelectBundleExtensionDataNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); - } - - /// - /// - /// - /// elements must have the 'burn' prefix - /// - public XmlNodeList SelectManifestNodes(string xpath) - { - return this.ManifestDocument.SelectNodes(xpath, this.ManifestNamespaceManager); - } - - /// - /// - /// - /// elements must have the 'burn' prefix - /// Attributes for which the value should be set to '*'. - /// - public string[] GetManifestTestXmlLines(string xpath, Dictionary> ignoredAttributesByElementName = null) - { - return this.SelectManifestNodes(xpath).GetTestXmlLines(ignoredAttributesByElementName); - } - } -} diff --git a/src/wix/WixToolset.Core.TestPackage/TestMessageListener.cs b/src/wix/WixToolset.Core.TestPackage/TestMessageListener.cs deleted file mode 100644 index 7040fe82..00000000 --- a/src/wix/WixToolset.Core.TestPackage/TestMessageListener.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Collections.Generic; -using WixToolset.Data; -using WixToolset.Extensibility; -using WixToolset.Extensibility.Services; - -namespace WixToolset.Core.TestPackage -{ - /// - /// An that simply stores all the messages. - /// - public sealed class TestMessageListener : IMessageListener - { - /// - /// All messages that have been received. - /// - public List Messages { get; } = new List(); - - /// - /// - /// - public string ShortAppName => "TEST"; - - /// - /// - /// - public string LongAppName => "Test"; - - /// - /// Stores the message in . - /// - /// - public void Write(Message message) - { - this.Messages.Add(message); - } - - /// - /// Stores the message in . - /// - /// - public void Write(string message) - { - this.Messages.Add(new Message(null, MessageLevel.Information, 0, message)); - } - - /// - /// Always returns defaultMessageLevel. - /// - /// - /// - /// - /// - public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; - } -} diff --git a/src/wix/WixToolset.Core.TestPackage/WixRunner.cs b/src/wix/WixToolset.Core.TestPackage/WixRunner.cs deleted file mode 100644 index 8ad3af9a..00000000 --- a/src/wix/WixToolset.Core.TestPackage/WixRunner.cs +++ /dev/null @@ -1,90 +0,0 @@ -// 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. - -namespace WixToolset.Core.TestPackage -{ - using System; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using WixToolset.Core.Burn; - using WixToolset.Core.ExtensionCache; - using WixToolset.Core.WindowsInstaller; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - - /// - /// Utility class to emulate wix.exe with standard backends. - /// - public static class WixRunner - { - /// - /// Emulates calling wix.exe with standard backends. - /// - /// - /// - /// - /// - public static int Execute(string[] args, out List messages, bool warningsAsErrors = true) - { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); - var task = Execute(args, serviceProvider, out messages, warningsAsErrors: warningsAsErrors); - return task.Result; - } - - /// - /// Emulates calling wix.exe with standard backends. - /// This overload always treats warnings as errors. - /// - /// - /// - public static WixRunnerResult Execute(params string[] args) - { - return Execute(true, args); - } - - /// - /// Emulates calling wix.exe with standard backends. - /// - /// - /// - /// - public static WixRunnerResult Execute(bool warningsAsErrors, params string[] args) - { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); - var exitCode = Execute(args, serviceProvider, out var messages, warningsAsErrors: warningsAsErrors); - return new WixRunnerResult { ExitCode = exitCode.Result, Messages = messages.ToArray() }; - } - - /// - /// Emulates calling wix.exe with standard backends. - /// - /// - /// - /// - /// - /// - public static Task Execute(string[] args, IWixToolsetCoreServiceProvider coreProvider, out List messages, bool warningsAsErrors = true) - { - coreProvider.AddWindowsInstallerBackend() - .AddBundleBackend() - .AddExtensionCacheManager(); - - var listener = new TestMessageListener(); - - messages = listener.Messages; - - var messaging = coreProvider.GetService(); - messaging.SetListener(listener); - - var arguments = new List(args); - if (warningsAsErrors) - { - arguments.Add("-wx"); - } - - var commandLine = coreProvider.GetService(); - var command = commandLine.CreateCommand(arguments.ToArray()); - return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); - } - } -} diff --git a/src/wix/WixToolset.Core.TestPackage/WixRunnerResult.cs b/src/wix/WixToolset.Core.TestPackage/WixRunnerResult.cs deleted file mode 100644 index 6a3d714c..00000000 --- a/src/wix/WixToolset.Core.TestPackage/WixRunnerResult.cs +++ /dev/null @@ -1,62 +0,0 @@ -// 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. - -namespace WixToolset.Core.TestPackage -{ - using System; - using System.Collections.Generic; - using WixToolset.Data; - using Xunit; - - /// - /// The result of an Execute method of . - /// - public class WixRunnerResult - { - /// - /// ExitCode for the operation. - /// - public int ExitCode { get; set; } - - /// - /// Messages from the operation. - /// - public Message[] Messages { get; set; } - - /// - /// - /// - /// - public WixRunnerResult AssertSuccess() - { - AssertSuccess(this.ExitCode, this.Messages); - return this; - } - - /// - /// - /// - /// - /// - public static void AssertSuccess(int exitCode, IEnumerable messages) - { - Assert.True(0 == exitCode, $"\r\n\r\nWixRunner failed with exit code: {exitCode}\r\n Output: {String.Join("\r\n ", FormatMessages(messages))}\r\n"); - } - - private static IEnumerable FormatMessages(IEnumerable messages) - { - foreach (var message in messages) - { - var filename = message.SourceLineNumbers?.FileName ?? "TEST"; - var line = message.SourceLineNumbers?.LineNumber ?? -1; - var type = message.Level.ToString().ToLowerInvariant(); - - if (line > 0) - { - filename = String.Concat(filename, "(", line, ")"); - } - - yield return String.Format("{0} : {1} {2}{3:0000}: {4}", filename, type, "TEST", message.Id, message.ToString()); - } - } - } -} diff --git a/src/wix/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj b/src/wix/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj deleted file mode 100644 index 3a028ec1..00000000 --- a/src/wix/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - netstandard2.0 - $(TargetFrameworks);net472 - Internal WiX Toolset Test Package - embedded - true - true - false - true - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/wix/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.v3.ncrunchproject b/src/wix/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.v3.ncrunchproject deleted file mode 100644 index cff5044e..00000000 --- a/src/wix/WixToolset.Core.TestPackage/WixToolset.Core.TestPackage.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - False - - \ No newline at end of file diff --git a/src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs b/src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs deleted file mode 100644 index 2f4c1aa3..00000000 --- a/src/wix/WixToolset.Core.TestPackage/XmlNodeExtensions.cs +++ /dev/null @@ -1,115 +0,0 @@ -// 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. - -namespace WixToolset.Core.TestPackage -{ - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Text.RegularExpressions; - using System.Xml; - - /// - /// Utility class to help compare XML in tests using string comparisons by using single quotes and stripping all namespaces. - /// - public static class XmlNodeExtensions - { - /// - /// Adds root element around XML then returns it using single quotes and stripping all namespaces. - /// - /// - /// Attributes for which the value should be set to '*'. - /// - public static string GetFragmentTestXml(this string xmlFragment, Dictionary> ignoredAttributesByElementName = null) - { - return $"{xmlFragment}".GetTestXml(ignoredAttributesByElementName); - } - - /// - /// Returns the node's outer XML using single quotes and stripping all namespaces. - /// - /// - /// Attributes for which the value should be set to '*'. - /// - public static string GetTestXml(this XmlNode node, Dictionary> ignoredAttributesByElementName = null) - { - return node.OuterXml.GetTestXml(ignoredAttributesByElementName); - } - - /// - /// Returns the XML using single quotes and stripping all namespaces. - /// - /// - /// Attributes for which the value should be set to '*'. - /// - public static string GetTestXml(this string xml, Dictionary> ignoredAttributesByElementName = null) - { - string formattedXml; - using (var sw = new StringWriter()) - using (var writer = new TestXmlWriter(sw)) - { - var doc = new XmlDocument(); - doc.LoadXml(xml); - - if (ignoredAttributesByElementName != null) - { - HandleIgnoredAttributes(doc, ignoredAttributesByElementName); - } - - doc.Save(writer); - formattedXml = sw.ToString(); - } - - return Regex.Replace(formattedXml, " xmlns(:[^=]+)?='[^']*'", ""); - } - - /// - /// Returns the XML for each node using single quotes and stripping all namespaces. - /// - /// - /// Attributes for which the value should be set to '*'. - /// - public static string[] GetTestXmlLines(this XmlNodeList nodeList, Dictionary> ignoredAttributesByElementName = null) - { - return nodeList.Cast() - .Select(x => x.GetTestXml(ignoredAttributesByElementName)) - .ToArray(); - } - - private static void HandleIgnoredAttributes(XmlNode node, Dictionary> ignoredAttributesByElementName) - { - if (node.Attributes != null && ignoredAttributesByElementName.TryGetValue(node.LocalName, out var ignoredAttributes)) - { - foreach (var ignoredAttribute in ignoredAttributes) - { - var attribute = node.Attributes[ignoredAttribute]; - if (attribute != null) - { - attribute.Value = "*"; - } - } - } - - if (node.ChildNodes != null) - { - foreach (XmlNode childNode in node.ChildNodes) - { - HandleIgnoredAttributes(childNode, ignoredAttributesByElementName); - } - } - } - - private class TestXmlWriter : XmlTextWriter - { - public TestXmlWriter(TextWriter w) - : base(w) - { - this.QuoteChar = '\''; - } - - public override void WriteStartDocument() - { - //OmitXmlDeclaration - } - } - } -} diff --git a/src/wix/pack_t.proj b/src/wix/pack_t.proj index a775ddb3..cd2cf634 100644 --- a/src/wix/pack_t.proj +++ b/src/wix/pack_t.proj @@ -7,7 +7,7 @@ - + diff --git a/src/wix/test/CompileCoreTestExtensionWixlib/CompileCoreTestExtensionWixlib.csproj b/src/wix/test/CompileCoreTestExtensionWixlib/CompileCoreTestExtensionWixlib.csproj index 03a805f2..b526a209 100644 --- a/src/wix/test/CompileCoreTestExtensionWixlib/CompileCoreTestExtensionWixlib.csproj +++ b/src/wix/test/CompileCoreTestExtensionWixlib/CompileCoreTestExtensionWixlib.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/wix/test/CompileCoreTestExtensionWixlib/Program.cs b/src/wix/test/CompileCoreTestExtensionWixlib/Program.cs index 323b5e5e..a6c88ddb 100644 --- a/src/wix/test/CompileCoreTestExtensionWixlib/Program.cs +++ b/src/wix/test/CompileCoreTestExtensionWixlib/Program.cs @@ -1,7 +1,7 @@ // 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. using System.Collections.Generic; -using WixToolset.Core.TestPackage; +using WixInternal.Core.TestPackage; namespace CompileCoreTestExtensionWixlib { diff --git a/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index 92ee441a..3d110b81 100644 --- a/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -7,7 +7,7 @@ namespace WixToolsetTest.BuildTasks using System.Linq; using System.Runtime.InteropServices; using Microsoft.Build.Utilities; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.BuildTasks; using WixToolset.Data; using WixToolset.Data.Symbols; diff --git a/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index d53dbe02..2d5e8922 100644 --- a/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -22,6 +22,6 @@ - + diff --git a/src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs b/src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs index 9fb47a9a..ef00738d 100644 --- a/src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters.Symbolizer/ConvertSymbolsFixture.cs @@ -6,7 +6,7 @@ namespace WixToolsetTest.Converters.Symbolizer using System.Collections.Generic; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using Wix3 = Microsoft.Tools.WindowsInstallerXml; using WixToolset.Converters.Symbolizer; using WixToolset.Data; diff --git a/src/wix/test/WixToolsetTest.Converters.Symbolizer/WixToolsetTest.Converters.Symbolizer.csproj b/src/wix/test/WixToolsetTest.Converters.Symbolizer/WixToolsetTest.Converters.Symbolizer.csproj index 5e246624..7eea6516 100644 --- a/src/wix/test/WixToolsetTest.Converters.Symbolizer/WixToolsetTest.Converters.Symbolizer.csproj +++ b/src/wix/test/WixToolsetTest.Converters.Symbolizer/WixToolsetTest.Converters.Symbolizer.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/wix/test/WixToolsetTest.Converters/BitnessFixture.cs b/src/wix/test/WixToolsetTest.Converters/BitnessFixture.cs index e45a9388..2893246e 100644 --- a/src/wix/test/WixToolsetTest.Converters/BitnessFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/BitnessFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs b/src/wix/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs index 158ab3be..3b08ca81 100644 --- a/src/wix/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/BootstrapperApplicationFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/BundleCacheFixture.cs b/src/wix/test/WixToolsetTest.Converters/BundleCacheFixture.cs index d1ba0cbf..29c16958 100644 --- a/src/wix/test/WixToolsetTest.Converters/BundleCacheFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/BundleCacheFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs b/src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs index c9fecc94..d8a55402 100644 --- a/src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ConditionFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs b/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs index cd6849d3..bdc67431 100644 --- a/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs @@ -6,7 +6,7 @@ namespace WixToolsetTest.Converters using System.IO; using System.Linq; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs b/src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs index fdebc6b0..be2bd41c 100644 --- a/src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs @@ -5,10 +5,10 @@ namespace WixToolsetTest.Converters using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolset.Core; - using WixToolset.Core.TestPackage; + using WixInternal.Core.TestPackage; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs b/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs index 7389bc35..7d646bd4 100644 --- a/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/CustomActionFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.Converters using System; using System.IO; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs b/src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs index 6dd3da97..84467307 100644 --- a/src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/CustomTableFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/DependencyFixture.cs b/src/wix/test/WixToolsetTest.Converters/DependencyFixture.cs index 41ded927..202430ae 100644 --- a/src/wix/test/WixToolsetTest.Converters/DependencyFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/DependencyFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/DirectXExtensionFixture.cs b/src/wix/test/WixToolsetTest.Converters/DirectXExtensionFixture.cs index f72a4a23..ab5e20b6 100644 --- a/src/wix/test/WixToolsetTest.Converters/DirectXExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/DirectXExtensionFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/DirectoryFixture.cs b/src/wix/test/WixToolsetTest.Converters/DirectoryFixture.cs index 3c906320..063554db 100644 --- a/src/wix/test/WixToolsetTest.Converters/DirectoryFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/DirectoryFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/ExePackageFixture.cs b/src/wix/test/WixToolsetTest.Converters/ExePackageFixture.cs index 68d234ad..79d32958 100644 --- a/src/wix/test/WixToolsetTest.Converters/ExePackageFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ExePackageFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.Converters using System; using System.Linq; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/FeatureFixture.cs b/src/wix/test/WixToolsetTest.Converters/FeatureFixture.cs index 1df94a81..52bedb93 100644 --- a/src/wix/test/WixToolsetTest.Converters/FeatureFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/FeatureFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/FirewallExtensionFixture.cs b/src/wix/test/WixToolsetTest.Converters/FirewallExtensionFixture.cs index a101019b..3d3fde16 100644 --- a/src/wix/test/WixToolsetTest.Converters/FirewallExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/FirewallExtensionFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/IncludeFixture.cs b/src/wix/test/WixToolsetTest.Converters/IncludeFixture.cs index 2fd8244f..11e4249d 100644 --- a/src/wix/test/WixToolsetTest.Converters/IncludeFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/IncludeFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/LocalizationFixture.cs b/src/wix/test/WixToolsetTest.Converters/LocalizationFixture.cs index 28f71480..629f2810 100644 --- a/src/wix/test/WixToolsetTest.Converters/LocalizationFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/LocalizationFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/MsuPackageFixture.cs b/src/wix/test/WixToolsetTest.Converters/MsuPackageFixture.cs index 5ec109b2..a225dca8 100644 --- a/src/wix/test/WixToolsetTest.Converters/MsuPackageFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/MsuPackageFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.Converters using System; using System.Linq; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/ProductPackageFixture.cs b/src/wix/test/WixToolsetTest.Converters/ProductPackageFixture.cs index 5ad7ef6f..7a4f5723 100644 --- a/src/wix/test/WixToolsetTest.Converters/ProductPackageFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ProductPackageFixture.cs @@ -5,9 +5,9 @@ namespace WixToolsetTest.Converters using System; using System.IO; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; - using WixToolset.Core.TestPackage; + using WixInternal.Core.TestPackage; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs b/src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs index e9ace163..90c71950 100644 --- a/src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/PropertyFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/RegistryFixture.cs b/src/wix/test/WixToolsetTest.Converters/RegistryFixture.cs index 405f5416..b6a69231 100644 --- a/src/wix/test/WixToolsetTest.Converters/RegistryFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/RegistryFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs b/src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs index b2640e13..3e39e5f3 100644 --- a/src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/RemotePayloadFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/SequenceFixture.cs b/src/wix/test/WixToolsetTest.Converters/SequenceFixture.cs index ec6c709b..9013877a 100644 --- a/src/wix/test/WixToolsetTest.Converters/SequenceFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/SequenceFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/TagFixture.cs b/src/wix/test/WixToolsetTest.Converters/TagFixture.cs index 5e07c83b..1fec46ac 100644 --- a/src/wix/test/WixToolsetTest.Converters/TagFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/TagFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs b/src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs index 786b18d8..41a34f71 100644 --- a/src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs b/src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs index 0f23d87b..5ed64277 100644 --- a/src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/UtilExtensionFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/VSExtensionFixture.cs b/src/wix/test/WixToolsetTest.Converters/VSExtensionFixture.cs index 7eb81b05..e9d9a211 100644 --- a/src/wix/test/WixToolsetTest.Converters/VSExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/VSExtensionFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/VariableFixture.cs b/src/wix/test/WixToolsetTest.Converters/VariableFixture.cs index b7b7388f..c4304544 100644 --- a/src/wix/test/WixToolsetTest.Converters/VariableFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/VariableFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/Wix4ConversionFixture.cs b/src/wix/test/WixToolsetTest.Converters/Wix4ConversionFixture.cs index 16a68895..3a8be025 100644 --- a/src/wix/test/WixToolsetTest.Converters/Wix4ConversionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/Wix4ConversionFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Converters { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Converters; using WixToolsetTest.Converters.Mocks; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj b/src/wix/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj index 9577b512..27bc24b6 100644 --- a/src/wix/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj +++ b/src/wix/test/WixToolsetTest.Converters/WixToolsetTest.Converters.csproj @@ -19,10 +19,10 @@ - + - + diff --git a/src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs b/src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs index e1189549..56bc8fb4 100644 --- a/src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs +++ b/src/wix/test/WixToolsetTest.Core.Native/CabinetFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.CoreNative using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core.Native; using WixToolset.Data; using Xunit; @@ -119,7 +119,7 @@ namespace WixToolsetTest.CoreNative var cabFileInfo = enumerated[i]; var fileInfo = new FileInfo(files[i]); - WixBuildTools.TestSupport.WixAssert.StringEqual(cabFileInfo.FileId, fileInfo.Name); + WixInternal.TestSupport.WixAssert.StringEqual(cabFileInfo.FileId, fileInfo.Name); Assert.Equal(cabFileInfo.Size, fileInfo.Length); Assert.True(cabFileInfo.SameAsDateTime(fileInfo.CreationTime)); } diff --git a/src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs b/src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs index 9f8a31f6..a1e28739 100644 --- a/src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs +++ b/src/wix/test/WixToolsetTest.Core.Native/CertificateHashesFixture.cs @@ -3,7 +3,7 @@ namespace WixToolsetTest.CoreNative { using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core.Native; using Xunit; @@ -17,9 +17,9 @@ namespace WixToolsetTest.CoreNative var hashes = CertificateHashes.Read(new[] { cabFile }); var hash = hashes.Single(); - WixBuildTools.TestSupport.WixAssert.StringEqual(cabFile, hash.Path); - WixBuildTools.TestSupport.WixAssert.StringEqual("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hash.PublicKey); - WixBuildTools.TestSupport.WixAssert.StringEqual("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hash.Thumbprint); + WixInternal.TestSupport.WixAssert.StringEqual(cabFile, hash.Path); + WixInternal.TestSupport.WixAssert.StringEqual("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hash.PublicKey); + WixInternal.TestSupport.WixAssert.StringEqual("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hash.Thumbprint); Assert.Null(hash.Exception); } @@ -31,7 +31,7 @@ namespace WixToolsetTest.CoreNative var hashes = CertificateHashes.Read(new[] { txtFile }); var hash = hashes.Single(); - WixBuildTools.TestSupport.WixAssert.StringEqual(txtFile, hash.Path); + WixInternal.TestSupport.WixAssert.StringEqual(txtFile, hash.Path); Assert.Null(hash.Exception); } @@ -43,9 +43,9 @@ namespace WixToolsetTest.CoreNative var hashes = CertificateHashes.Read(new[] { cabFile, txtFile }); - WixBuildTools.TestSupport.WixAssert.StringEqual(cabFile, hashes[0].Path); - WixBuildTools.TestSupport.WixAssert.StringEqual("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hashes[0].PublicKey); - WixBuildTools.TestSupport.WixAssert.StringEqual("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hashes[0].Thumbprint); + WixInternal.TestSupport.WixAssert.StringEqual(cabFile, hashes[0].Path); + WixInternal.TestSupport.WixAssert.StringEqual("7EC90B3FC3D580EB571210011F1095E149DCC6BB", hashes[0].PublicKey); + WixInternal.TestSupport.WixAssert.StringEqual("0B13494DB50BC185A34389BBBAA01EDD1CF56350", hashes[0].Thumbprint); Assert.Null(hashes[0].Exception); Assert.Equal(txtFile, hashes[1].Path); diff --git a/src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj b/src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj index 67047592..335c26ba 100644 --- a/src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj +++ b/src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj @@ -18,6 +18,6 @@ - + diff --git a/src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs b/src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs index 64ae19e4..8bd2de5a 100644 --- a/src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs +++ b/src/wix/test/WixToolsetTest.Core/ParserHelperFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.Core { using System; using System.Xml.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility.Services; diff --git a/src/wix/test/WixToolsetTest.Core/PreprocessorFixture.cs b/src/wix/test/WixToolsetTest.Core/PreprocessorFixture.cs index 55f54cc2..4be37ea1 100644 --- a/src/wix/test/WixToolsetTest.Core/PreprocessorFixture.cs +++ b/src/wix/test/WixToolsetTest.Core/PreprocessorFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.Core using System; using System.IO; using System.Xml; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; diff --git a/src/wix/test/WixToolsetTest.Core/WixToolsetTest.Core.csproj b/src/wix/test/WixToolsetTest.Core/WixToolsetTest.Core.csproj index 6e1b6556..3907aae0 100644 --- a/src/wix/test/WixToolsetTest.Core/WixToolsetTest.Core.csproj +++ b/src/wix/test/WixToolsetTest.Core/WixToolsetTest.Core.csproj @@ -12,6 +12,6 @@ - + diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/AdvertisedTypeLibVersionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/AdvertisedTypeLibVersionFixture.cs index 106e2483..1cc11bc3 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/AdvertisedTypeLibVersionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/AdvertisedTypeLibVersionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ApprovedExeFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ApprovedExeFixture.cs index 47b47ef5..23917794 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ApprovedExeFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ApprovedExeFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class ApprovedExeFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs index 4a25d5e7..f571d13b 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs index e7752a2a..4301bffd 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BindVariablesFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class BindVariablesFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs index 9bdc9496..495dbfca 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs index 7b4999cc..4f44ca16 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleExtractionFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index cbfe6f85..2cc7a681 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs @@ -9,9 +9,9 @@ namespace WixToolsetTest.CoreIntegration using System.Text; using System.Xml; using Example.Extension; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core.Burn; - using WixToolset.Core.TestPackage; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Burn; using WixToolset.Data.Symbols; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs index 21157aac..3c97ceb1 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.Collections.Generic; using System.IO; using Example.Extension; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class BundleManifestFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs index 7bf9fc70..2538c0dc 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundlePackageFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs index 4d4d3f83..32ff5287 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BurnRemotePayloadSubcommandFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.Collections.Generic; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class BurnRemotePayloadSubcommandFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs index 690937d2..f7e5abf5 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CabFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class CabFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ClassFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ClassFixture.cs index 4aeabc82..9f2b742b 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ClassFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ClassFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class ClassFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CommandLineFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CommandLineFixture.cs index 0d0b7208..0e78dbc0 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CommandLineFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CommandLineFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class CommandLineFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ComponentFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ComponentFixture.cs index d24ba08c..94900ee0 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ComponentFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ComponentFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs index febc50d4..f0495853 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs @@ -6,9 +6,9 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core.Burn.Bundles; - using WixToolset.Core.TestPackage; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs index a7b4a96a..6b670966 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CopyFileFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs index 2ad6bac2..fea82267 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class CustomActionFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs index 1be7d9ab..1b1955fd 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Xml.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class CustomTableFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs index b43d2033..77311302 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class DecompileFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs index 89c54c7e..915e1594 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/DependencyExtensionFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class DependencyExtensionFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs index 429b69ef..8e401c40 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.WindowsInstaller; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs index 2a4ac51b..7403f96d 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ExePackageFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class ExePackageFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index aabaac42..88b8a953 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs @@ -7,8 +7,8 @@ namespace WixToolsetTest.CoreIntegration using System.Linq; using System.Text.RegularExpressions; using Example.Extension; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs index 2e371794..c6da19eb 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/FeatureFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/LanguageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/LanguageFixture.cs index db9708a7..8dc135eb 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/LanguageFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/LanguageFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs index b6366286..4478e0ea 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs @@ -6,9 +6,9 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core; - using WixToolset.Core.TestPackage; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Extensibility.Data; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MediaFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MediaFixture.cs index 6cb94de2..cf94df0b 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MediaFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MediaFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs index 89ad7bc7..4a3749fd 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiCabinetFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiCabinetFixture.cs index 8bb790d4..bc39e4d3 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiCabinetFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiCabinetFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index fe5f8e63..e83fe4f0 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using Example.Extension; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs index 011dbca5..f84882fc 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiPackageFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class MsiPackageFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index e7a527c4..bc5f7f1d 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using Example.Extension; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class MsiQueryFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs index f4949171..5cf5dae0 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.Collections.Generic; using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class MsiTransactionFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs index 28cb0eb5..7284181f 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/MsuPackageFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class MsuPackageFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs index f817317d..1d291a7c 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PackagePayloadFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class PackagePayloadFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index ca197d9f..69aa9c95 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs @@ -14,8 +14,8 @@ namespace WixToolsetTest.CoreIntegration using System.Xml; using System.Xml.Linq; using Example.Extension; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Burn; using WixToolset.Data.WindowsInstaller; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs index cd27ff14..5976a2d2 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs @@ -7,8 +7,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs index 3c023c2b..f735b53a 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PreprocessorFixture.cs @@ -4,9 +4,9 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core; - using WixToolset.Core.TestPackage; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Extensibility.Data; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs index f0a2e7c9..7bf10e3f 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs index 6d089e79..f8d46c24 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class RollbackBoundaryFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs index 3b6c50c0..968046df 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class ShortcutFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/SigningFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/SigningFixture.cs index 02fbfc30..6e60f4f8 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/SigningFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/SigningFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class SigningFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs index 544fcbda..a98e4683 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/SoftwareTagFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs index ef1f6aee..63add96c 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestXmlFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.Collections.Generic; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using Xunit; public class TestXmlFixture diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs index d69e0222..c4fa6200 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TransformFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data.WindowsInstaller; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/UIFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/UIFixture.cs index 728e6c9e..8cd06331 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/UIFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/UIFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using Example.Extension; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/UnadvertisedTypeLibVersionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/UnadvertisedTypeLibVersionFixture.cs index 247902c1..056b158a 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/UnadvertisedTypeLibVersionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/UnadvertisedTypeLibVersionFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs index a9c9fb13..2b6590ee 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/ValidationFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/ValidationFixture.cs index 716d3d3a..156990cc 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/ValidationFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/ValidationFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs index f8331a86..a40eb366 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/VariableResolverFixture.cs @@ -4,7 +4,7 @@ namespace WixToolsetTest.CoreIntegration { using System.Collections.Generic; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using WixToolset.Core; using WixToolset.Data; using WixToolset.Data.Bind; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs index f17a92e0..facc772d 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/VersionFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using System.Xml; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/WarningFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/WarningFixture.cs index 0d5b3b4b..32785bde 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/WarningFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/WarningFixture.cs @@ -3,8 +3,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/wix/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 8b35a85a..7d7c9a0c 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/wix/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -16,11 +16,11 @@ - + - + diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs index 27ab06fd..ab2729bb 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/WixiplFixture.cs @@ -5,8 +5,8 @@ namespace WixToolsetTest.CoreIntegration using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Example.Extension; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs index 428cfc3e..76326741 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/WixlibFixture.cs @@ -6,8 +6,8 @@ namespace WixToolsetTest.CoreIntegration using System.IO; using System.Linq; using Example.Extension; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs index 57351b27..4bed0142 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs @@ -4,8 +4,8 @@ namespace WixToolsetTest.CoreIntegration { using System.IO; using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; + using WixInternal.TestSupport; + using WixInternal.Core.TestPackage; using WixToolset.Data; using WixToolset.Data.Symbols; using Xunit; diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs index c1fdd548..64d05a59 100644 --- a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs @@ -6,7 +6,7 @@ namespace WixToolsetTest.Sdk using System.Collections.Generic; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using Xunit; public class MsbuildFixture diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildValidationFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildValidationFixture.cs index 829ee9c1..82e72e6b 100644 --- a/src/wix/test/WixToolsetTest.Sdk/MsbuildValidationFixture.cs +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildValidationFixture.cs @@ -5,7 +5,7 @@ namespace WixToolsetTest.Sdk using System; using System.IO; using System.Linq; - using WixBuildTools.TestSupport; + using WixInternal.TestSupport; using Xunit; // When these tests are run repeatedly, they will expose an issue diff --git a/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj b/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj index 3ec0eeaf..7fe39da3 100644 --- a/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj +++ b/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj @@ -14,10 +14,10 @@ - + - + diff --git a/src/wix/wix.cmd b/src/wix/wix.cmd index c0a1c384..7982fbea 100644 --- a/src/wix/wix.cmd +++ b/src/wix/wix.cmd @@ -69,7 +69,7 @@ msbuild pack_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:%_L%\wix_p @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.core.burn" 2> nul @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.core.native" 2> nul @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.core.windowsinstaller" 2> nul -@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.core.testpackage" 2> nul +@rd /s/q "%USERPROFILE%\.nuget\packages\wixinternal.core.testpackage" 2> nul @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.sdk" 2> nul @exit /b diff --git a/src/wix/wix.sln b/src/wix/wix.sln index cffaf9ed..f64b22c0 100644 --- a/src/wix/wix.sln +++ b/src/wix/wix.sln @@ -24,7 +24,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example.Extension", "test\E EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.CoreIntegration", "test\WixToolsetTest.CoreIntegration\WixToolsetTest.CoreIntegration.csproj", "{E8A08E86-1780-4ED4-8F63-AB2B52C1C16B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Core.TestPackage", "WixToolset.Core.TestPackage\WixToolset.Core.TestPackage.csproj", "{853716DB-C02C-41BD-91BC-79CDC0C17D10}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixInternal.Core.TestPackage", "WixInternal.Core.TestPackage\WixInternal.Core.TestPackage.csproj", "{853716DB-C02C-41BD-91BC-79CDC0C17D10}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompileCoreTestExtensionWixlib", "test\CompileCoreTestExtensionWixlib\CompileCoreTestExtensionWixlib.csproj", "{23FC60D7-B101-42F8-9786-DB7A9CD964A2}" EndProject -- cgit v1.2.3-55-g6feb