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
7 changes: 7 additions & 0 deletions .github/Prime-ForCopilot.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ if ((git -C $PSScriptRoot rev-parse --is-shallow-repository) -eq 'true')
Write-Host "Shallow clone detected, disabling NBGV Git engine so the build can succeed."
$env:NBGV_GitEngine='Disabled'
}

$appleDeveloperDir = & "$PSScriptRoot/../tools/Get-AppleDeveloperDir.ps1"
if ($appleDeveloperDir)
{
Write-Host "Setting DEVELOPER_DIR to $appleDeveloperDir so dotnet can build macOS targets."
$env:DEVELOPER_DIR = $appleDeveloperDir
}
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<MicrosoftTestingPlatformVersion>2.2.3</MicrosoftTestingPlatformVersion>
<XunitV3LibraryVersion>3.2.2</XunitV3LibraryVersion>
<XunitV3LibraryVersion>4.0.0-pre.81</XunitV3LibraryVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="xunit.analyzers" Version="1.27.0" />
<PackageVersion Include="xunit.analyzers" Version="2.0.0-pre.51" />
<PackageVersion Include="xunit.v3.assert" Version="$(XunitV3LibraryVersion)" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="$(XunitV3LibraryVersion)" />
<PackageVersion Include="xunit.v3.runner.inproc.console" Version="$(XunitV3LibraryVersion)" />
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ For xUnit v2 support | Use Xunit.STAFact 1.x
For xUnit.v3 1.x support | Use Xunit.STAFact 2.0
For xUnit.v3 2.x support | Use Xunit.STAFact 2.1+
For xUnit.v3 3.x support | Use Xunit.STAFact 3.x
For xUnit.v3 4.x support | Use Xunit.STAFact 4.x

## Features

Expand Down
9 changes: 9 additions & 0 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ Param (
$EnvVars = @{}
$PrependPath = @()

if ($IsMacOS) {
$appleDeveloperDir = & "$PSScriptRoot\tools\Get-AppleDeveloperDir.ps1"
if ($appleDeveloperDir) {
Write-Host "Setting DEVELOPER_DIR to $appleDeveloperDir so dotnet can build macOS targets." -ForegroundColor Yellow
$EnvVars['DEVELOPER_DIR'] = $appleDeveloperDir
$env:DEVELOPER_DIR = $appleDeveloperDir
}
}

if (!$NoPrerequisites) {
if (!$NoNuGetCredProvider) {
& "$PSScriptRoot\tools\Install-NuGetCredProvider.ps1" -AccessToken $AccessToken -Force:$UpgradePrerequisites
Expand Down
1 change: 1 addition & 0 deletions src/Xunit.StaFact/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ Use v1.x versions of this package for use with xUnit v2.
Use v2.0 versions of this package for use with xUnit.v3 v1.x.
Use v2.1+ versions of this package for use with xUnit.v3 v2+.
Use v3.0+ versions of this package for use with xunit.v3 v3+
Use v4.0+ versions of this package for use with xunit.v3 v4+

[See our full product documentation](https://aarnott.github.io/Xunit.StaFact/).
2 changes: 1 addition & 1 deletion src/Xunit.StaFact/Sdk.Mac/CocoaTheoryDiscoverer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Xunit.Sdk;
public class CocoaTheoryDiscoverer : TheoryDiscoverer
{
/// <inheritdoc/>
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments)
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments, string? index)
{
IXunitTestCase testCase = CocoaUtilities.CreateTestCaseForDataRow(
discoveryOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Xunit.Sdk;
public class WinFormsTheoryDiscoverer : TheoryDiscoverer
{
/// <inheritdoc/>
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments)
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments, string? index)
{
IXunitTestCase testCase = WinFormsUtilities.CreateTestCaseForDataRow(
discoveryOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Xunit.Sdk;
public class WpfTheoryDiscoverer : TheoryDiscoverer
{
/// <inheritdoc/>
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments)
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments, string? index)
{
IXunitTestCase testCase = WpfUtilities.CreateTestCaseForDataRow(
discoveryOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/Xunit.StaFact/Sdk/StaTheoryDiscoverer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Xunit.Sdk;
public class StaTheoryDiscoverer : TheoryDiscoverer
{
/// <inheritdoc/>
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments)
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments, string? index)
{
IXunitTestCase testCase = StaUtilities.CreateTestCaseForDataRow(
discoveryOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/Xunit.StaFact/Sdk/UITheoryDiscoverer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Xunit.Sdk;
public class UITheoryDiscoverer : TheoryDiscoverer
{
/// <inheritdoc/>
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments)
protected override ValueTask<IReadOnlyCollection<IXunitTestCase>> CreateTestCasesForDataRow(ITestFrameworkDiscoveryOptions discoveryOptions, IXunitTestMethod testMethod, ITheoryAttribute theoryAttribute, ITheoryDataRow dataRow, object?[] testMethodArguments, string? index)
{
IXunitTestCase testCase = UIUtilities.CreateTestCaseForDataRow(
discoveryOptions,
Expand Down
6 changes: 6 additions & 0 deletions test/Xunit.StaFact.Tests.Mac/AssemblyAttributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) Andrew Arnott. All rights reserved.
// Licensed under the Ms-PL license. See LICENSE file in the project root for full license information.

using Xunit.Runner.Common;

[assembly: RegisterConsoleResultWriter<XmlV2ResultWriter>("xml")]
29 changes: 29 additions & 0 deletions tools/Get-AppleDeveloperDir.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[CmdletBinding()]
param()

if (!$IsMacOS) {
return
}

$selectedDeveloperDir = ''
try {
$selectedDeveloperDir = (& xcode-select -p) 2>$null
} catch {
}

if ($selectedDeveloperDir -and (Test-Path "$selectedDeveloperDir/../Info.plist")) {
return
}

$candidateDeveloperDirs = @(
'/Applications/Xcode.app/Contents/Developer'
)

$candidateDeveloperDirs += Get-ChildItem -Path /Applications -Filter 'Xcode*.app' -Directory -ErrorAction SilentlyContinue |
Sort-Object FullName |
ForEach-Object { "$($_.FullName)/Contents/Developer" }

$candidateDeveloperDirs |
Select-Object -Unique |
Where-Object { Test-Path "$_/../Info.plist" } |
Select-Object -First 1
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "3.1-beta",
"version": "4.0-beta",
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/heads/v\\d+\\.\\d+$"
Expand Down
Loading