Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono] iOS Test runner #34976

Merged
merged 15 commits into from
Apr 17, 2020
22 changes: 11 additions & 11 deletions src/mono/msbuild/AppleTestRunner/AppleTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@

public class SimpleTestRunner : iOSApplicatonEntryPoint, IDevice
Copy link
Member

Choose a reason for hiding this comment

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

iOSApplicatonEntryPoint -- is this a typo? iOSApplicationEntryPoint

Copy link
Member

Choose a reason for hiding this comment

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

ah, it's in dotnet/xharness. I didn't know about this repo 😸

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

also, while you are there could you please add events for "test is started", "test is finished (with result)" ?

Copy link
Member

Choose a reason for hiding this comment

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

@danmosemsft I'm known for my typos, I'll get that fixed! @EgorBo dotnet/xharness#36

{
private static List<string> testLibs;
private static List<string> testLibs = new List<string>();

public static async Task<int> Main(string[] args)
{
// Redirect all Console.WriteLines to iOS UI
Console.SetOut(new AppleConsole());
Console.WriteLine($"ProcessorCount = {Environment.ProcessorCount}")
Console.WriteLine($"ProcessorCount = {Environment.ProcessorCount}");

Console.Write("Args: ");
foreach (string arg in args)
{
Console.Write(arg);
}
Console.WriteLine(".");

testLibs = new List<string>();
foreach (string arg in args.Where(a => a.StartsWith("testlib:")))
{
testLibs.Add(arg.Remove(0, "testlib:".Length));
Expand Down Expand Up @@ -62,7 +62,7 @@ public static async Task<int> Main(string[] args)

protected override IEnumerable<TestAssemblyInfo> GetTestAssemblies()
{
foreach (string file in testLibs)
foreach (string file in testLibs!)
Copy link
Member

Choose a reason for hiding this comment

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

Why is the null forgiving operator needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@safern I forgot to remove it

Copy link
Member Author

Choose a reason for hiding this comment

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

Will fix it in the next PR

{
yield return new TestAssemblyInfo(Assembly.LoadFrom(file), file);
}
Expand All @@ -79,21 +79,21 @@ protected override void TerminateWithSuccess()

protected override TestRunnerType TestRunner => TestRunnerType.Xunit;

protected override string IgnoreFilesDirectory { get; }
protected override string? IgnoreFilesDirectory { get; }

public string BundleIdentifier => "net.dot.test-runner";

public string UniqueIdentifier { get; }
public string? UniqueIdentifier { get; }

public string Name { get; }
public string? Name { get; }

public string Model { get; }
public string? Model { get; }

public string SystemName { get; }
public string? SystemName { get; }

public string SystemVersion { get; }
public string? SystemVersion { get; }

public string Locale { get; }
public string? Locale { get; }
}

internal class AppleConsole : TextWriter
Expand Down