2012-05-11 9 views
5

CI(Jenkins)で実行するユニットテストを取得しようとしています。私は、コマンドラインでテストを実行するためにいくつかのハックを使ってこのa articleをオンラインにしました。私は空のプロジェクトでユニットテストのためのデフォルトの設定でそれを試して、そこに指示がうまくいきますが、ユニットテストの設定を持つ既存のプロジェクトでそれをやろうとすると、あいまいなエラーが出ます:コマンドラインでiOSユニットテストを実行する問題(OCUnit + OCMock)

/bin/sh -c /Users/jzhwu/smule/magicpiano/build/MagicPiano.build/Debug-iphonesimulator/MagicPianoTest.build/Script-7C0B24BE155310BE001AC942.sh 
/Applications/Xcode.app/Contents/Developer/Tools/RunPlatformUnitTests.include:266: note: Started tests for architectures 'i386' 
Run unit tests for architecture 'i386' (GC OFF) 
/Applications/Xcode.app/Contents/Developer/Tools/RunPlatformUnitTests.include:273: note: Running tests for architecture 'i386' (GC OFF) 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
UIPasteboard - failed to launch pasteboardd. Make sure it's installed in UIKit.framework/Support 
2012-05-11 15:10:39:247 MP-Debug[24398:17003] loading model magic 
2012-05-11 15:10:39:250 MP-Debug[24398:17003] loading model magic-analytics 
2012-05-11 15:10:39.264 MP-Debug[24398:17003] Unresolved error Error Domain=NSCocoaErrorDomain Code=512 "The operation couldn’t be completed. (Cocoa error 512.)" UserInfo=0xa2c5ce0 {reason=Failed to create file; code = 2}, { 
reason = "Failed to create file; code = 2"; 
} 
2012-05-11 15:10:39.264 MP-Debug[24398:17003] Try deleting and reinstalling the app to fix this issue 
/Applications/Xcode.app/Contents/Developer/Tools/RunPlatformUnitTests.include: line 269: 24398 Abort trap: 6   "${TEST_HOST}" ${TEST_HOST_FLAGS} ${OTHER_TEST_FLAGS} 
/Applications/Xcode.app/Contents/Developer/Tools/RunPlatformUnitTests.include:339: error: Test host '/Users/jzhwu/smule/magicpiano/build/Debug-iphonesimulator/MP-Debug.app/MP-Debug' exited abnormally with code 134 (it may have crashed). 



** BUILD FAILED ** 


The following build commands failed: 
     PhaseScriptExecution "Run Script" build/MagicPiano.build/Debug-iphonesimulator/MagicPianoTest.build/Script-7C0B24BE155310BE001AC942.sh 
(1 failure) 

樹脂ストールアプリ部品は無視してください。これはアプリコードからのものです。これは、実行時にある時点でクラッシュしたことを示しています。単体テストはXcode 4でうまく動作しますが、コマンドラインでうまく再生できません。私はOCMockでOCUnitを使用しています。ありがとう!

+0

解決方法を見つけましたか?私は同じ問題を抱えています。コマンドラインからCedarテストを実行しようとしましたが、同じファイルを作成できませんでした。コード:2 "エラー – AFraser

+0

残念ながら私は決して解決策を見つけませんでした。私はテスト(以前のアプリケーションテスト)を論理ユニットテストに変更してしまい、正常に動作しました。 –

答えて

0

最近私が取り組んでいるアプリケーションで同様の問題が発生しました。私はコードベースを継承してテストを設定していなかったので、それらをビルドしなければなりませんでした。私はiPhoneTestsプロジェクトのサンプルに従ってAppleの標準的な設定方法を試してみましたが、うまくいきませんでした。私はGHUnitに切り替えました。私はそれをより簡単に実行できるようになりました。あなたがあまりにも遠く離れてテストを書くのでなければ、私は切り替えを提案するでしょう。

docsは本当にうまく機能していて、コマンドラインとJenkinsから実行するのに役立ちました。 私のアプリでは、メインターゲットを複製し、ビルドにGHUnitiOS.frameworkを追加し、単体テストクラスのソースを追加することで、テスト用の2番目のターゲットをセットアップしました。

あなたが探している答えではないかもしれないが、私はそれが助けてくれることを願っています!

関連する問題