diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index 86cbc7ee5109a..85ee6deb32db3 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -2,6 +2,8 @@ Exe + $(DefineConstants);SINGLE_FILE_TEST_RUNNER + $([MSBuild]::NormalizeDirectory('$(OutDir)', 'publish')) $([MSBuild]::NormalizePath('$(BundleDir)', '$(RunScriptOutputName)')) $(PackageRID) diff --git a/src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs b/src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs index 24281af200887..bceed5b1d4ed0 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/ModuleTests.cs @@ -81,6 +81,9 @@ public void CustomAttributes() [Fact] public void FullyQualifiedName() { +#if SINGLE_FILE_TEST_RUNNER + Assert.Equal("", Module.FullyQualifiedName); +#else var loc = AssemblyPathHelper.GetAssemblyLocation(Assembly.GetExecutingAssembly()); // Browser will include the path (/), so strip it @@ -90,12 +93,17 @@ public void FullyQualifiedName() } Assert.Equal(loc, Module.FullyQualifiedName); +#endif } [Fact] public void Name() { +#if SINGLE_FILE_TEST_RUNNER + Assert.Equal("", Module.Name, ignoreCase: true); +#else Assert.Equal("system.runtime.tests.dll", Module.Name, ignoreCase: true); +#endif } [Fact]