After the Chris Hanson and Apple Blogs Automated Unit Testing with Xcode 3 and Objective-C I started implementing unit tests for my projects. However, I use many plugins (downloadable packages), and I cannot figure out how to test them.I decided that I would use the approach described by Chris Hanson for testing frameworks. I started with the Cocoa Bundle project, added a main class, and changed the type to a plugin.Then I added the unit test package, add the plugin as a direct dependency (Apple instructions) and set the following build options:
Package Loader: $ (BUILT_PRODUCTS_DIR) /CocoaPlugin.plugin/Contents/MacOS/CocoaPluginHost Testing: $ (BUNDLE_LOADER)
The problem is that as soon as I do this and create a test target, I get this message:
Error: test host '/Users/elisevanlooij/Documents/Plug-ins/CocoaPlugin/build/DebugCocoaPlugin.plugin/Contents/MacOS/CocoaPlugin' failed with code 127 (it may have crashed). [code 126 in another plugin]
I was hoping that adding a custom otest executable would help, but unfortunately not. I really hope that someone can help, because the unit test cannot, my plugin really puts a cramp on my lifestyle.
. Bundle Loader , unit-test.
, ( !), ( SenTestCase , ?).
, , , , ? , unit-test-bundle - API, , ?
. .
( , , ) , "" , Chris Hanson, . , .
- , , , unit-test. , .
, , , - , , , , , , , , , , Chris Hanson unit test , , - .
: $(BUILT_PRODUCTS_DIR)/CocoaPlugin.plugin/Contents/MacOS/CocoaPlugin
. , , , CocoaPlugin. /. (. -bundle_loader man ld)
Test Host: $(BUNDLE_LOADER)
. ( NSApplicationMain, ), . TEST_HOST . :
TEST_HOST . , , initlaize.
test_host, , NSApplicationMain TEST_HOST.
+initalize :
+initalize
+ (void)initialize { NSBundle* bundle = [NSBundle bundleWithPath:pathToPlugin]; [bundle load]; NSLog(@"Loaded:%@\n",bundle); }
- dummy_test :
int main(int argc,const char** argv) { NSBundle* bundle = [NSBundle bundleWithPath:pathToPlugin]; [bundle load]; NSLog(@"Loaded:%@\n",bundle); return NSApplicationMain(argc,argv); }
:
TEST_RIG=/Developer/Tools/otest "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
Source: https://habr.com/ru/post/1720876/More articles:.Net4, Monitor.Enter (lockObject, receivedLock) - .netRedirect to page not found if url does not exist in mVC - asp.netIntriguing SQL Server Performance Tuning Issue - sql-serverFlash Library for OpenStreetMap - flashJira RPC / SOAP GetCustomFields () can only be used by an administrator? - soapSpring Security and Struts 2 - javapress the button (stay "up" or "down") - delphihttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1720879/how-to-support-backwards-compatibility-with-the-changes-to-the-accept-header-handling-in-rails-234&usg=ALkJrhi0KSkbRaRY_6pDXnJMsS89iz8jswHow to make a Delphi control panel applet illegal? - delphiInternet Explorer profiler - internet-explorerAll Articles