idb/XCTestBootstrap
Marek Cirkos 41e61d75ad Fix TestFBTestManagerAPIMediator when used from command line
Summary: When xctest is bootstrapped from command line testmanagerd "hangs up" XPC connection, probobaly because of protocol differences.

Reviewed By: lawrencelomax

Differential Revision: D3144335

fb-gh-sync-id: 7a740fab46d045f516e49ba11b47e83442895db6
fbshipit-source-id: 7a740fab46d045f516e49ba11b47e83442895db6
2016-04-06 07:45:59 -07:00
..
Bundles Making sure that working directory exists and is clear, when preparing xctest 2016-04-06 01:05:27 -07:00
Categories Fix license headers 2016-03-14 09:10:48 -07:00
DeviceHandling Removed need for XCTStubApp for simulators 2016-04-01 03:30:28 -07:00
Strategies Removed need for XCTStubApp for simulators 2016-04-01 03:30:28 -07:00
TestManager Fix TestFBTestManagerAPIMediator when used from command line 2016-04-06 07:45:59 -07:00
Utility Don't load the XCTestBootstrap private Frameworks from FBSimulatorControl 2016-04-05 10:20:19 -07:00
README.md Add README for XCTestBootstrap 2016-04-05 01:55:18 -07:00
XCTestBootstrap-Info.plist Extracted XCTestBootstrap 2016-03-14 09:10:29 -07:00
XCTestBootstrap.h Added DVTFoundation initialaizer 2016-03-14 09:11:07 -07:00
XCTestBootstrap.xcconfig Resolved private framework and plugins linking 2016-04-01 02:35:23 -07:00

README.md

XCTestBootstrap

A Mac OS X library for launching XCTest & XCUITest and managing connection with testmanager daemon.

Features

  • Prepares XCTest bundle.
  • Launches application and injects XCTest bundle.
  • Opens and manages connection with testmanager daemon during the test.
  • It works with iOS simulator & device tests.
  • It works with Mac OSX tests.

Usage

In order to use XCTestBootstrap you need to provide class that implements <FBDeviceOperator> supplying basic device instructions like install application, launch application etc.

A good example is FBSimulatorControlOperator and FBSimulatorInteraction+XCTest\


  FBSimulatorTestPreparationStrategy *testPrepareStrategy =
  [FBSimulatorTestPreparationStrategy strategyWithTestRunnerBundleID:configuration.bundleID
                                                    testBundlePath:testBundlePath
                                                  workingDirectory:workingDirectory
                                                  ];
  FBSimulatorControlOperator *operator = [FBSimulatorControlOperator operatorWithSimulator:self.simulator];
  FBXCTestRunStrategy *testRunStrategy = [FBXCTestRunStrategy strategyWithDeviceOperator:operator testPrepareStrategy:testPrepareStrategy logger:simulator.logger];
  NSError *innerError = nil;
  FBTestManager *testManager = [testRunStrategy startTestManagerWithAttributes:configuration.arguments environment:configuration.environment error:&innerError];

FBTestManager needs to be kept alive in order to keep test running.

Contributing

See the CONTRIBUTING file for how to help out. There's plenty to work on the issues!

License

XCTestBootstrap is BSD-licensed. We also provide an additional patent grant.