-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make SmokeTests use repo infrastructure
This allows the test project to just be invoked with `dotnet test` or `dotnet build /t:Test` after the VMR is built. 1. Stop depending on environment variables for state instead use RuntimeConfiguration values same as UnifiedBuild test project. Allow facts and theories to be conditioned based on boolean values instead of env vars. 2. Update the README with the new msbuild property switch names 3. Delete dead-code and the checked-in .sln file
- Loading branch information
1 parent
e6a2c0f
commit a3a75bd
Showing
26 changed files
with
230 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...rceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/ConditionalFactAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Reflection; | ||
using Xunit; | ||
|
||
namespace Microsoft.DotNet.SourceBuild.SmokeTests; | ||
|
||
/// <summary> | ||
/// A Fact that conditionally runs based on a type's boolean property member | ||
/// </summary> | ||
internal sealed class ConditionalFactAttribute : FactAttribute | ||
{ | ||
public ConditionalFactAttribute(Type calleeType, string memberName, string? reason = null) | ||
{ | ||
EvaluateSkip(calleeType, memberName, reason, (skip) => Skip = skip); | ||
} | ||
|
||
internal static void EvaluateSkip(Type calleeType, string memberName, string? reason = null, Action<string> setSkip) | ||
{ | ||
TypeInfo typeInfo = calleeType.GetTypeInfo(); | ||
bool shouldRun = (bool?)typeInfo.GetProperty(memberName)?.GetValue(null) ?? false; | ||
if (!shouldRun) | ||
{ | ||
setSkip(reason ?? "Skipped"); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...eBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/ConditionalTheoryAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Xunit; | ||
|
||
namespace Microsoft.DotNet.SourceBuild.SmokeTests; | ||
|
||
/// <summary> | ||
/// A Theory that conditionally runs based on a type's boolean property member. | ||
/// </summary> | ||
internal sealed class ConditionalTheoryAttribute : TheoryAttribute | ||
{ | ||
public ConditionalTheoryAttribute(Type calleeType, string memberName, string? reason = null) | ||
{ | ||
ConditionalFactAttribute.EvaluateSkip(calleeType, memberName, reason, (skip) => Skip = skip); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Directory.Build.props
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.