Skip to content

Commit 867b2a8

Browse files
tmdsomajid
authored andcommitted
Add use-current-runtime test
1 parent 5969bdd commit 867b2a8

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

use-current-runtime/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// See https://aka.ms/new-console-template for more information
2+
Console.WriteLine("Hello, World!");

use-current-runtime/console.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<Target Name="EchoRuntimeIdentifier" AfterTargets="Restore" BeforeTargets="BeforeBuild">
11+
<Exec Command="echo 'RuntimeIdentifier is $(RuntimeIdentifier)'" />
12+
</Target>
13+
14+
</Project>

use-current-runtime/test.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "use-current-runtime",
3+
"enabled": true,
4+
"requiresSdk": true,
5+
"version": "6.0",
6+
"versionSpecific": false,
7+
"type": "bash",
8+
"cleanup": true,
9+
"ignoredRIDs":[
10+
]
11+
}

use-current-runtime/test.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/bash
2+
3+
set -euo pipefail
4+
5+
set -x
6+
7+
PORTABLE_RID="$(../runtime-id --portable)"
8+
9+
DOTNET_BUILD_OUTPUT=$(dotnet build --use-current-runtime)
10+
11+
if echo "$DOTNET_BUILD_OUTPUT" | grep -q "RuntimeIdentifier is $PORTABLE_RID"; then
12+
echo "PASS: --use-current-runtime uses portable rid."
13+
else
14+
echo "FAIL: --use-current-runtime does not use portable rid."
15+
exit 1
16+
fi

0 commit comments

Comments
 (0)