-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[mono] iOS Test runner #34976
Changes from 1 commit
f9a926e
4f0100e
07bc7cd
7148281
625b9cc
fadf3e5
7b30a9c
15a4e65
b04617b
7af4801
780b1fb
2a5f6bf
2a61ec9
487d9d0
c26cf8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,21 +13,21 @@ | |
|
||
public class SimpleTestRunner : iOSApplicatonEntryPoint, IDevice | ||
{ | ||
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)); | ||
|
@@ -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!) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the null forgiving operator needed here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @safern I forgot to remove it There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
} | ||
|
@@ -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 | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @mandel-macaque ^
There was a problem hiding this comment.
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)" ?
There was a problem hiding this comment.
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