Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ public void It_publishes_portable_apps_to_the_publish_folder_and_the_app_should_
}

[Theory]
[InlineData("netcoreapp1.1")]
[InlineData("netcoreapp2.0")]
[InlineData(ToolsetInfo.CurrentTargetFramework)]
public void It_publishes_self_contained_apps_to_the_publish_folder_and_the_app_should_run(string targetFramework)
{
if (!EnvironmentInfo.SupportsTargetFramework(targetFramework))
{
return;
}

var rid = EnvironmentInfo.GetCompatibleRid(targetFramework);

var helloWorldAsset = _testAssetsManager
Expand Down
16 changes: 15 additions & 1 deletion src/Tests/Microsoft.NET.TestFramework/EnvironmentInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,21 @@ public static string GetCompatibleRid(string targetFramework = null)
// able to run on the current OS
public static bool SupportsTargetFramework(string targetFramework)
{
var nugetFramework = NuGetFramework.Parse(targetFramework);
NuGetFramework nugetFramework = null;
try
{
nugetFramework = NuGetFramework.Parse(targetFramework);
}
catch
{
return false;
}

if (nugetFramework == null)
{
return false;
}

string currentRid = RuntimeInformation.RuntimeIdentifier;

string ridOS = currentRid.Split('.')[0];
Expand Down