2017-01-08 07:56:46 -08:00
|
|
|
|
/**
|
2018-02-16 18:24:55 -08:00
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
2017-01-08 07:56:46 -08:00
|
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-01-08 07:56:46 -08:00
|
|
|
|
*/
|
|
|
|
|
|
2017-01-12 10:23:41 -08:00
|
|
|
|
using System;
|
2017-02-17 10:32:23 -08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using AppKit;
|
|
|
|
|
using Foundation;
|
|
|
|
|
using GuiUnit;
|
|
|
|
|
using NUnit.Framework;
|
2017-01-08 07:56:46 -08:00
|
|
|
|
|
2017-01-12 10:23:41 -08:00
|
|
|
|
namespace Facebook.Yoga.Mac.Tests
|
2017-01-08 07:56:46 -08:00
|
|
|
|
{
|
2017-02-17 10:32:23 -08:00
|
|
|
|
static class MainClass
|
|
|
|
|
{
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
NSApplication.Init();
|
|
|
|
|
RunTests();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void RunTests()
|
|
|
|
|
{
|
|
|
|
|
TestRunner.MainLoop = new NSRunLoopIntegration();
|
|
|
|
|
List<string> args = new List<string>() { typeof(MainClass).Assembly.Location, "-labels", "-noheader", "-result=TEST-Mac.xml" };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TestRunner.Main(args.ToArray());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-16 12:27:53 -07:00
|
|
|
|
[System.Runtime.InteropServices.DllImport("/usr/lib/libSystem.dylib")]
|
|
|
|
|
static extern void _exit(int exit_code);
|
|
|
|
|
|
2017-02-17 10:32:23 -08:00
|
|
|
|
class NSRunLoopIntegration : NSObject, IMainLoopIntegration
|
|
|
|
|
{
|
|
|
|
|
public void InitializeToolkit()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RunMainLoop()
|
|
|
|
|
{
|
|
|
|
|
NSApplication.SharedApplication.Run();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void InvokeOnMainLoop(InvokerHelper helper)
|
|
|
|
|
{
|
|
|
|
|
NSApplication.SharedApplication.InvokeOnMainThread(helper.Invoke);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Shutdown()
|
|
|
|
|
{
|
2017-05-16 12:27:53 -07:00
|
|
|
|
_exit(TestRunner.ExitCode);
|
2017-02-17 10:32:23 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-01-08 07:56:46 -08:00
|
|
|
|
}
|