Skip to content

Commit 2051a3d

Browse files
committed
Copy debug CRT for IJW test
1 parent 0a51e0b commit 2051a3d

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/installer/tests/HostActivation.Tests/NativeHosting/Ijwhost.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,17 @@ public SharedTestState()
154154
string ijwhostName = "ijwhost.dll";
155155
File.Copy(Path.Combine(RepoDirectoriesProvider.Default.HostArtifacts, ijwhostName), Path.Combine(folder, ijwhostName));
156156

157-
// Copy over the C++/CLI test library
157+
// Copy over the C++/CLI test library and any dependencies
158158
string ijwLibraryName = "ijw.dll";
159159
File.Copy(Path.Combine(RepoDirectoriesProvider.Default.HostTestArtifacts, ijwLibraryName), Path.Combine(folder, ijwLibraryName));
160+
string ijwDependencies = Path.Combine(RepoDirectoriesProvider.Default.HostTestArtifacts, "ijw-deps");
161+
if (Directory.Exists(ijwDependencies))
162+
{
163+
foreach(string file in Directory.GetFiles(ijwDependencies))
164+
{
165+
File.Copy(file, Path.Combine(folder, Path.GetFileName(file)));
166+
}
167+
}
160168

161169
// Create a runtimeconfig.json for the C++/CLI test library
162170
new RuntimeConfig(Path.Combine(folder, "ijw.runtimeconfig.json"))

src/native/corehost/test/ijw/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,15 @@ remove_ijw_incompatible_target_options(ijw)
1010
add_ijw_msbuild_project_properties(ijw ijwhost)
1111

1212
install_with_stripped_symbols(ijw TARGETS corehost_test)
13+
14+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
15+
# Copy over the debug CRT so that it is available for test runs
16+
file(
17+
GLOB_RECURSE
18+
DEBUG_CRT_FILES
19+
$ENV{VCToolsRedistDir}/onecore/debug_nonredist/${ARCH_TARGET_NAME}/Microsoft.VC*.DebugCRT/vcruntime*d.dll
20+
$ENV{VCToolsRedistDir}/onecore/debug_nonredist/${ARCH_TARGET_NAME}/Microsoft.VC*.DebugCRT/msvcp*d.dll
21+
$ENV{ExtensionSdkDir}/Microsoft.UniversalCRT.Debug/$ENV{UCRTVersion}/Redist/Debug/${ARCH_TARGET_NAME}/ucrtbased.dll
22+
)
23+
install(FILES ${DEBUG_CRT_FILES} DESTINATION corehost_test/ijw-deps)
24+
endif ()

0 commit comments

Comments
 (0)