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
13 changes: 0 additions & 13 deletions eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@
<AndroidAbi Condition="'$(TargetArchitecture)' == 'x64'">x86_64</AndroidAbi>
<AndroidAbi Condition="'$(TargetArchitecture)' == 'x86'">x86</AndroidAbi>
</PropertyGroup>
<ItemGroup>
<AndroidTestRunnerBinaries Include="$(AndroidTestRunnerDir)*.*" />
</ItemGroup>

<Error Condition="'@(AndroidTestRunnerBinaries)' == ''" Text="Could not find AndroidTestRunner in $(AndroidTestRunnerDir)" />
<Error Condition="!Exists('$(RuntimePackRidDir)')" Text="RuntimePackRidDir=$(RuntimePackRidDir) doesn't exist" />

<Copy SourceFiles="@(AndroidTestRunnerBinaries)" DestinationFolder="$(PublishDir)%(RecursiveDir)" SkipUnchangedFiles="true"/>

<!-- TEMP: consume OpenSSL binaries from external sources via env. variables -->
<Copy Condition="'$(AndroidOpenSslCryptoLib)' != ''"
SourceFiles="$(AndroidOpenSslCryptoLib)"
Expand Down Expand Up @@ -61,17 +55,10 @@
<Import Project="$(MonoProjectRoot)msbuild\AotCompilerTask\MonoAOTCompiler.props" />

<Target Condition="'$(TargetOS)' == 'iOS'" Name="BundleTestAppleApp">
<ItemGroup>
<AppleTestRunnerBinaries Include="$(AppleTestRunnerDir)*.*" />
</ItemGroup>

<Error Condition="'@(AppleTestRunnerBinaries)' == ''" Text="Could not find AppleTestRunner in $(AppleTestRunnerDir) doesn't exist" />
<Error Condition="!Exists('$(RuntimePackRidDir)')" Text="RuntimePackRidDir=$(RuntimePackRidDir) doesn't exist" />
<Error Condition="('$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm') and '$(DevTeamProvisioning)' == ''"
Text="'DevTeamProvisioning' needs to be set for device builds. Set it to 'UBF8T346G9' if you're part of the Microsoft team account." />

<Copy SourceFiles="@(AppleTestRunnerBinaries)" DestinationFolder="$(PublishDir)%(RecursiveDir)" SkipUnchangedFiles="true"/>

<WriteLinesToFile File="$(PublishDir)xunit-excludes.txt" Lines="$(_withoutCategories.Replace(';', '%0dcategory='))" />

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions eng/testing/tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
<PropertyGroup Condition="'$(TargetsMobile)' == 'true'">
<MobileHelpersDirSuffix>$(NetCoreAppCurrent)-$(MonoConfiguration)</MobileHelpersDirSuffix>
<AppleAppBuilderDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AppleAppBuilder', '$(MobileHelpersDirSuffix)'))</AppleAppBuilderDir>
<AppleTestRunnerDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AppleTestRunner', '$(MobileHelpersDirSuffix)'))</AppleTestRunnerDir>
<AndroidAppBuilderDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AndroidAppBuilder', '$(MobileHelpersDirSuffix)'))</AndroidAppBuilderDir>
<AndroidTestRunnerDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AndroidTestRunner', '$(MobileHelpersDirSuffix)'))</AndroidTestRunnerDir>
<MonoAOTCompilerDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoAOTCompiler', '$(MobileHelpersDirSuffix)'))</MonoAOTCompilerDir>

<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// 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;
using System.Linq;
using System.Text;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkCurrent)</TargetFrameworks>
</PropertyGroup>
<!-- Since this is referenced by test projects that are restored for NetFrameworkCurrent, we need to suppor it for restored
at runtime this is a no-op as tests can't run in NetFrameworkCurrent on Android so we will never build this for that tfm. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't you condition the P2P for non .NET Framework?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn’t try that. If that works I’ll put a follow up PR.

<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
<Compile Include="AndroidTestRunner.cs" />
<PackageReference Include="Microsoft.DotNet.XHarness.Tests.Runners" Version="$(MicrosoftDotNetXHarnessTestsRunnersVersion)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// 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;
using System.Linq;
using System.Text;
Expand Down
13 changes: 13 additions & 0 deletions src/libraries/Common/tests/AppleTestRunner/AppleTestRunner.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkCurrent)</TargetFrameworks>
</PropertyGroup>
<!-- Since this is referenced by test projects that are restored for NetFrameworkCurrent, we need to suppor it for restored
at runtime this is a no-op as tests can't run in NetFrameworkCurrent on iOS so we will never build this for that tfm. -->
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
<Compile Include="AppleTestRunner.cs" />
<PackageReference Include="Microsoft.DotNet.XHarness.Tests.Runners" Version="$(MicrosoftDotNetXHarnessTestsRunnersVersion)" />
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<ProjectReference Include="$(CommonTestPath)TestUtilities\TestUtilities.csproj" />

<ProjectReference Include="$(CommonTestPath)AppleTestRunner\AppleTestRunner.csproj" Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'" />
<ProjectReference Include="$(CommonTestPath)AndroidTestRunner\AndroidTestRunner.csproj" Condition="'$(TargetOS)' == 'Android'" />
</ItemGroup>

<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<Compile Include="System\EntryPointNotFoundExceptionTests.cs" />
<Compile Include="System\EnumTests.cs" />
<Compile Include="System\ExceptionTests.cs" />
<Compile Include="System\Exceptions.Utility.cs" />
<Compile Include="System\Exception.Helpers.cs" />
<Compile Include="System\ExecutionEngineExceptionTests.cs" />
<Compile Include="System\ExternalExceptionTests.cs" />
<Compile Include="System\EventArgsTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class ArgumentExceptionTests
public static void Ctor_Empty()
{
var exception = new ArgumentException();
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, validateMessage: false);
Assert.Null(exception.ParamName);
}

Expand All @@ -23,7 +23,7 @@ public static void Ctor_String()
{
string message = "the argument is wrong";
var exception = new ArgumentException(message);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, message: message);
Assert.Null(exception.ParamName);
}

Expand All @@ -33,7 +33,7 @@ public static void Ctor_String_Exception()
string message = "the argument is wrong";
var innerException = new Exception("Inner exception");
var exception = new ArgumentException(message, innerException);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, innerException: innerException, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, innerException: innerException, message: message);
Assert.Null(exception.ParamName);
}

Expand All @@ -43,7 +43,7 @@ public static void Ctor_String_String()
string message = "the argument is wrong";
string argumentName = "theArgument";
var exception = new ArgumentException(message, argumentName);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, validateMessage: false);
Assert.Equal(argumentName, exception.ParamName);
Assert.Contains(message, exception.Message);
Assert.Contains(argumentName, exception.Message);
Expand All @@ -56,7 +56,7 @@ public static void Ctor_String_String_Exception()
string argumentName = "theArgument";
var innerException = new Exception("Inner exception");
var exception = new ArgumentException(message, argumentName, innerException);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, innerException: innerException, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENT, innerException: innerException, validateMessage: false);
Assert.Equal(argumentName, exception.ParamName);
Assert.Contains(message, exception.Message);
Assert.Contains(argumentName, exception.Message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class ArgumentNullExceptionTests
public static void Ctor_Empty()
{
var exception = new ArgumentNullException();
ExceptionUtility.ValidateExceptionProperties(exception, hResult: E_POINTER, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: E_POINTER, validateMessage: false);
Assert.Null(exception.ParamName);
}

Expand All @@ -23,7 +23,7 @@ public static void Ctor_String()
{
string argumentName = "theNullArgument";
var exception = new ArgumentNullException(argumentName);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: E_POINTER, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: E_POINTER, validateMessage: false);
Assert.Contains(argumentName, exception.Message);
}

Expand All @@ -33,7 +33,7 @@ public static void Ctor_String_Exception()
string message = "the argument is null";
var innerException = new Exception("Inner exception");
var exception = new ArgumentNullException(message, innerException);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: E_POINTER, innerException: innerException, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: E_POINTER, innerException: innerException, message: message);
Assert.Null(exception.ParamName);
}

Expand All @@ -43,7 +43,7 @@ public static void Ctor_String_String()
string message = "the argument is null";
string argumentName = "theNullArgument";
var exception = new ArgumentNullException(argumentName, message);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: E_POINTER, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: E_POINTER, validateMessage: false);
Assert.Equal(argumentName, exception.ParamName);
Assert.Contains(message, exception.Message);
Assert.Contains(argumentName, exception.Message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class ArgumentOutOfRangeExceptionTests
public static void Ctor_Empty()
{
var exception = new ArgumentOutOfRangeException();
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, validateMessage: false);
Assert.Null(exception.ParamName);
Assert.Null(exception.ActualValue);
}
Expand All @@ -24,7 +24,7 @@ public static void Ctor_String()
{
string argumentName = "theArgument";
var exception = new ArgumentOutOfRangeException(argumentName);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, validateMessage: false);
Assert.Equal(argumentName, exception.ParamName);
Assert.Null(exception.ActualValue);
}
Expand All @@ -35,7 +35,7 @@ public static void Ctor_String_Exception()
string message = "the argument is out of range";
var innerException = new Exception("Inner exception");
var exception = new ArgumentOutOfRangeException(message, innerException);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, innerException: innerException, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, innerException: innerException, message: message);
Assert.Null(exception.ParamName);
Assert.Null(exception.ActualValue);
}
Expand All @@ -46,7 +46,7 @@ public static void Ctor_String_String()
string message = "the argument is out of range";
string argumentName = "theArgument";
var exception = new ArgumentOutOfRangeException(argumentName, message);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, validateMessage: false);
Assert.Equal(argumentName, exception.ParamName);
Assert.Null(exception.ActualValue);
Assert.Contains(message, exception.Message);
Expand All @@ -60,7 +60,7 @@ public static void Ctor_String_Object_String()
string argumentName = "theArgument";
int argumentValue = Int32.MaxValue;
var exception = new ArgumentOutOfRangeException(argumentName, argumentValue, message);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARGUMENTOUTOFRANGE, validateMessage: false);
Assert.Equal(argumentName, exception.ParamName);
Assert.Contains(message, exception.Message);
Assert.Contains(argumentName, exception.Message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public static class ArithmeticExceptionTests
public static void Ctor_Empty()
{
var exception = new ArithmeticException();
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARITHMETIC, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARITHMETIC, validateMessage: false);
}

[Fact]
public static void Ctor_String()
{
string message = "arithmetic operation error";
var exception = new ArithmeticException(message);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARITHMETIC, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARITHMETIC, message: message);
}

[Fact]
Expand All @@ -31,7 +31,7 @@ public static void Ctor_String_Exception()
string message = "arithmetic operation error";
var innerException = new Exception("Inner exception");
var exception = new ArithmeticException(message, innerException);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARITHMETIC, innerException: innerException, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARITHMETIC, innerException: innerException, message: message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public static class ArrayTypeMismatchExceptionTests
public static void Ctor_Empty()
{
var exception = new ArrayTypeMismatchException();
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARRAYTYPEMISMATCH, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARRAYTYPEMISMATCH, validateMessage: false);
}

[Fact]
public static void Ctor_String()
{
string message = "array type mismatch";
var exception = new ArrayTypeMismatchException(message);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARRAYTYPEMISMATCH, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARRAYTYPEMISMATCH, message: message);
}

[Fact]
Expand All @@ -31,7 +31,7 @@ public static void Ctor_String_Exception()
string message = "array type mismatch";
var innerException = new Exception("Inner exception");
var exception = new ArrayTypeMismatchException(message, innerException);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_ARRAYTYPEMISMATCH, innerException: innerException, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_ARRAYTYPEMISMATCH, innerException: innerException, message: message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class BadImageFormatExceptionTests
public static void Ctor_Empty()
{
var exception = new BadImageFormatException();
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, validateMessage: false);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, validateMessage: false);
Assert.Null(exception.FileName);
}

Expand All @@ -23,7 +23,7 @@ public static void Ctor_String()
{
string message = "this is not the file you're looking for";
var exception = new BadImageFormatException(message);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, message: message);
Assert.Null(exception.FileName);
}

Expand All @@ -33,7 +33,7 @@ public static void Ctor_String_Exception()
string message = "this is not the file you're looking for";
var innerException = new Exception("Inner exception");
var exception = new BadImageFormatException(message, innerException);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, innerException: innerException, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, innerException: innerException, message: message);
Assert.Null(exception.FileName);
}

Expand All @@ -43,7 +43,7 @@ public static void Ctor_String_String()
string message = "this is not the file you're looking for";
string fileName = "file.txt";
var exception = new BadImageFormatException(message, fileName);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, message: message);
Assert.Equal(fileName, exception.FileName);
}

Expand All @@ -54,7 +54,7 @@ public static void Ctor_String_String_Exception()
string fileName = "file.txt";
var innerException = new Exception("Inner exception");
var exception = new BadImageFormatException(message, fileName, innerException);
ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, innerException: innerException, message: message);
ExceptionHelpers.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, innerException: innerException, message: message);
Assert.Equal(fileName, exception.FileName);
}

Expand Down
Loading