mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-24 21:54:01 -10:00
Return exit code 1 in android test runner if a test failed (#36319)
* Return exit code 1 in android test runner if a test failed * Exit instrumentation with runner exit code
This commit is contained in:
1 parent
5c667210d0
commit
5615bdaea8
1 file changed
+8
-1
@@ -24,11 +24,18 @@ public class SimpleAndroidTestRunner : AndroidApplicationEntryPoint, IDevice
|
||||
Console.WriteLine($"Test libs were not found (*.Tests.dll was not found in {Environment.CurrentDirectory})");
|
||||
return -1;
|
||||
}
|
||||
int exitCode = 0;
|
||||
s_MainTestName = Path.GetFileNameWithoutExtension(s_testLibs[0]);
|
||||
var simpleTestRunner = new SimpleAndroidTestRunner(true);
|
||||
simpleTestRunner.TestsCompleted += (e, result) =>
|
||||
{
|
||||
if (result.FailedTests > 0)
|
||||
exitCode = 1;
|
||||
};
|
||||
|
||||
await simpleTestRunner.RunAsync();
|
||||
Console.WriteLine("----- Done -----");
|
||||
return 0;
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
public SimpleAndroidTestRunner(bool verbose)
|
||||
|
||||
Reference in new issue
Block a user