Skip to content

Commit

Permalink
Prepare a looper when running headless Android tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fealebenpae committed May 25, 2016
1 parent 12d4a25 commit a5a5a84
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -41,13 +41,21 @@ public override void OnCreate (Bundle arguments)

public override void OnStart ()
{
NativeMethods.ALooper_prepare(0);

using (var output = Context.OpenFileOutput ("TestResults.Android.xml", FileCreationMode.WorldReadable))
{
IntegrationTests.Shared.TestRunner.Run ("Xamarin.Android", output);
}

this.Finish (Result.Ok, null);
}

private static class NativeMethods
{
[System.Runtime.InteropServices.DllImport("android")]
internal static extern IntPtr ALooper_prepare(int opts);
}
}
}

0 comments on commit a5a5a84

Please sign in to comment.