public void Muxer_activation_of_Build_Output_Portable_DLL_with_DepsJson_and_RuntimeConfig_Local_Succeeds() { var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture .Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; dotnet.Exec(appDll) .CaptureStdErr() .CaptureStdOut() .Execute() .Should() .Pass() .And .HaveStdOutContaining("Hello World"); dotnet.Exec("exec", appDll) .CaptureStdErr() .CaptureStdOut() .Execute() .Should() .Pass() .And .HaveStdOutContaining("Hello World"); }
public void Muxer_Exec_activation_of_Build_Output_Portable_DLL_with_DepsJson_Local_and_RuntimeConfig_Remote_With_AdditionalProbingPath_Succeeds() { var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture .Copy(); MoveRuntimeConfigToSubdirectory(fixture); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var runtimeConfig = fixture.TestProject.RuntimeConfigJson; var additionalProbingPath = RepoDirectories.NugetPackages; dotnet.Exec( "exec", "--runtimeconfig", runtimeConfig, "--additionalprobingpath", additionalProbingPath, appDll) .CaptureStdErr() .CaptureStdOut() .Execute() .Should() .Pass() .And .HaveStdOutContaining("Hello World"); }
public void Muxer_Activation_With_Templated_AdditionalProbingPath_Succeeds() { var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture .Copy(); var store_path = CreateAStore(fixture); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var destRuntimeDevConfig = fixture.TestProject.RuntimeDevConfigJson; if (File.Exists(destRuntimeDevConfig)) { File.Delete(destRuntimeDevConfig); } var additionalProbingPath = store_path + "/|arch|/|tfm|"; dotnet.Exec( "exec", "--additionalprobingpath", additionalProbingPath, appDll) .EnvironmentVariable("COREHOST_TRACE", "1") .CaptureStdErr() .CaptureStdOut() .Execute() .Should() .Pass() .And .HaveStdOutContaining("Hello World") .And .HaveStdErrContaining($"Adding tpa entry: {Path.Combine(store_path,fixture.RepoDirProvider.BuildArchitecture, fixture.Framework)}"); }
public void Muxer_activation_of_Apps_with_AltDirectorySeparatorChar() { var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture .Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); dotnet.Exec(appDll) .CaptureStdErr() .CaptureStdOut() .Execute() .Should() .Pass() .And .HaveStdOutContaining("Hello World"); }
public void Muxer_Exec_activation_of_Build_Output_Portable_DLL_with_DepsJson_Local_and_RuntimeConfig_Remote_Without_AdditionalProbingPath_Fails() { var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture .Copy(); MoveRuntimeConfigToSubdirectory(fixture); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var runtimeConfig = fixture.TestProject.RuntimeConfigJson; dotnet.Exec("exec", "--runtimeconfig", runtimeConfig, appDll) .CaptureStdErr() .CaptureStdOut() .Execute(fExpectedToFail: true) .Should() .Fail(); }
public void Muxer_activation_of_Build_Output_Portable_DLL_with_DepsJson_having_Assembly_with_Different_File_Extension_Fails() { var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture .Copy(); var dotnet = fixture.BuiltDotnet; // Change *.dll to *.exe var appDll = fixture.TestProject.AppDll; var appExe = appDll.Replace(".dll", ".exe"); File.Copy(appDll, appExe); File.Delete(appDll); dotnet.Exec("exec", appExe) .CaptureStdErr() .Execute() .Should() .Fail() .And .HaveStdErrContaining("has already been found but with a different file extension"); }
private TestProjectFixture ConfigureAppAndFrameworks(string appAssemblyVersion, string uberFxAssemblyVersion, string uberFxProductVersion, out string appAssembly, out string uberAssembly, out string netcoreAssembly) { const string fileVersion = "0.0.0.9"; var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture .Copy(); if (!string.IsNullOrEmpty(uberFxAssemblyVersion)) { // Modify Uber Fx's deps.json SharedFramework.CreateUberFrameworkArtifacts(_builtSharedFxDir, _builtSharedUberFxDir, uberFxAssemblyVersion, fileVersion); } // Set desired version = 7777.0.0 string runtimeConfig = Path.Combine(fixture.TestProject.OutputDirectory, "SharedFxLookupPortableApp.runtimeconfig.json"); SharedFramework.SetRuntimeConfigJson(runtimeConfig, "7777.0.0", null, useUberFramework: true); // Add versions in the exe folder SharedFramework.AddAvailableSharedFxVersions(_builtSharedFxDir, _exeSharedFxBaseDir, "9999.0.0"); SharedFramework.AddAvailableSharedUberFxVersions(_builtSharedUberFxDir, _exeSharedUberFxBaseDir, "9999.0.0", uberFxProductVersion); // Copy NetCoreApp's copy of the assembly to the app location netcoreAssembly = Path.Combine(_exeSharedFxBaseDir, "9999.0.0", "System.Collections.Immutable.dll"); appAssembly = Path.Combine(fixture.TestProject.OutputDirectory, "System.Collections.Immutable.dll"); File.Copy(netcoreAssembly, appAssembly); // Modify the app's deps.json to add System.Collections.Immmutable string appDepsJson = Path.Combine(fixture.TestProject.OutputDirectory, "SharedFxLookupPortableApp.deps.json"); JObject versionInfo = new JObject(); versionInfo.Add(new JProperty("assemblyVersion", appAssemblyVersion)); versionInfo.Add(new JProperty("fileVersion", fileVersion)); SharedFramework.AddReferenceToDepsJson(appDepsJson, "SharedFxLookupPortableApp/1.0.0", "System.Collections.Immutable", "1.0.0", versionInfo); uberAssembly = Path.Combine(_exeSharedUberFxBaseDir, uberFxProductVersion, "System.Collections.Immutable.dll"); return(fixture); }