iPhoneã®ã¦ããããã¹ãã§GHUnitã使ã
ä»æ¥ã¯ä¹
ã
ã«iPhoneã¢ããªã®åå¼·ããããã¨ãããã®ã®ã
ã¾ã£ããè¦ãã¦ãªãã®ã§Xcodeã«è§¦ãæ
£ããããã«GHUnitã®ãµã³ãã«ãåããæã¾ã§ãã£ã¦ã¿ããã¨ã«ããã
GHUnitã§UnitTest
Xcodeã«ã¯å
ããOCUnitã£ã¦ããUnitTestã®ãã¬ã¼ã ã¯ã¼ã¯ãããã¿ããã§ã
ããã試ãã¦æ¥è¨æ¸ããã¨ãããã§ããã
æ¤ç´¢ãã¦ãéä¸ã«GHUnitãè¦ã¤ãã¦ãã¾ã£ããã¨ãããã
ä½ããã£ã¡ã®æ¹ãé¢ç½ããã§ãã³ã·ã§ã³ä¸ããããã ã£ãã®ã§GHUnitã®æ¹ã«ãã¦ã¿ã¾ããã
åèã«ãããµã¤ã
- InstallGHUnit - iphone-codes - ユニットテストフレームワーク「GHUnit」の導入方法 - iPhoneアプリのサンプルコード集と開発に必要な情報 - Google Project Hosting
- GHUnitè¦ã¤ãããã£ããã
- ãã£ããã£å ¥ãã ãä¸å¯§ã ãã³ãããã¦ããã ãã§æ¸ããããããããã
- gabriel/gh-unit · GitHub
- æ¬å®¶ãµã¤ãã
- ä¸ã®ãµã¤ãã®éãã«ãã£ã¦ã¿ãã®ã ãã©ãã©ã£ãã§ééãã¦ä¸æããããªããªã£ã¦ãã£ã¡ã®ãµã¤ããåèã«ãã¾ããã
æµã
- InstallGHUnit - iphone-codes - ユニットテストフレームワーク「GHUnit」の導入方法 - iPhoneアプリのサンプルコード集と開発に必要な情報 - Google Project Hostingã®éããã£ã¦ãã ããå¤åæ¬å½ãªãããã§ãããã¯ãã
ä½ãä¸æããããªãã£ã
ãµã¤ããåèã«ããªãã試ããã¨ããã
"_main", referenced from: start in crt1.10.5.o
ã£ã¦ã¨ã©ã¼ãåºã¦ãä½ã®ãããããããããã
ã¨ãããã[ã¿ã¼ã²ãã]>[Tests]ã®ãæ
å ±ããããä»ã®ãªã³ã«ãã©ã°ãã®é
ç®ã«è¡ãã
ã-dynamiclibãã追å ãããã¨ã©ã¼ãæ¶ããã
# ãã ããããªãã¨ããªãã¦ãæçµçã«ã¯ã-ObjC -framework Foundation -framework UIKitãã§åé¡ãªãã£ãã¿ããã
ã§ãã¨ã©ã¼ãæ¶ãã¦ãããããã«ããã¦é²è¡ãã試ãã¦ã¿ããã ãã©ã
ããã«ãã¯åé¡ãªãå®äºãã¾ãããã£ã¦åºãããã«iPhoneã·ãã¥ã¬ã¼ã¿ãèµ·åããªãã
ã¾ãã¾ãã©ããã£ã¦è§£æ±ºãã¦è¯ãã®ãããããã
ã°ã°ã£ã¦ã¿ãã¨ãããXcodebuild throws assert failures after successful build? - Stack Overflowã«æ¸ãã¦ãããã¨ã試ãããä¸æãiPhoneã·ãã¥ã¬ã¼ã¿ãèµ·åãã¦ãããã
find . -type f -name "*.pbxuser" -exec rm -f {} \; find . -type f -name "*.perspectivev3" -exec rm -f {} \;
ãã¨ã¯ã¿ã¼ã²ããã®Testsãå³ã¯ãªãã¯ãã¦ä¸åãã¯ãªã¼ãã³ã°ããããä¸æãããã¾ããã
ããããExampleãç½®ãã¦ãã£ã
ä¸ã®ããã£ãã¨ãããã©ãã«ã解決ãããã¨èºèµ·ã«ãªã£ã¦ãã®ã§ããã
An example of an iPhone project with GHUnit test setup can be found at: MyTestable-IPhone.
ã¨æ¸ãã¦ããéãgitã®ä¸ã«Exampleã£ã¦ã®ããã£ãã®ã§ããããã£ã¨æ©ãå®è¡ãã¦ãã°è¯ãã£ãã§ãã
ï¼çµå±ãã®Exampleã¨ç
§ããåããã¦ããã£ãã¨ããã解決ã§ããã®ã§æ©ãã§ãæéç¡é§ã ã£ããªã¨ãï¼
Exampleã®å®è¡æ¹æ³
- GHUnitå
¨ä½ãgitã§åã£ã¦ãã
- git clone http://github.com/gabriel/gh-unit.git
- Exampleã®ããã¸ã§ã¯ããéã
- open gh-unit/Examples/MyTestable-IPhone/MyTestable.xcodeproj
- ã¢ã¯ãã£ãã¿ã¼ã²ãããTestsã«å¤æ´ãã
- ⌘(command)+rã§ããã«ããã¦é²è¡ãããã¨iPhoneã·ãã¥ã¬ã¼ã¿ãèµ·åãã
- ã·ãã¥ã¬ã¼ã¿ã®å³ä¸ã®ãRunããã¯ãªãã¯ããã°ããã¾ãã
ä½ã³ã¬è¶
ç°¡åããã³ããã£ã¨æ©ããã£ã¦ããã°è¯ãã£ããã
ãããã©ããã§ç¡é§ãªä½å使ã£ãã®ã§ä»æ¥ã¯ããã¾ã§ã«ãã¦å®éã®ãã¹ãã¯ãã¨ã§è¦ã¦ã¿ãã