2011-05-27 36 views
1

我使用http://code.google.com/p/the-missing-android-xml-junit-test-runner/在jenkins環境中運行單元測試。Android儀器沒有看到我的單元測試

一個示例項目運行良好,但另一個示例項目卻出現了奇怪的結果。 螞蟻輸出

[echo] Running tests ... 
[exec] 
[exec] Test results for PolideaInstrumentationTestRunner= 
[exec] Time: 0.0 
[exec] 
[exec] OK (0 tests) 
[exec] 
[exec] 

也是如此ADB殼上午儀器-w com.mypack.tests/pl.polidea.instrumentation.PolideaInstrumentationTestRunner。

它認爲沒有測試,但有。他們成功從eclipse運行。

+0

嘗試android.test.InstrumentationTestRunner來檢測你的問題在哪裏。 – 2011-05-27 14:08:03

+0

明白了!試圖找出工程項目與不工程項目之間的差異。 – 2011-05-30 04:15:59

回答

1

原因是: 在build.properties中有相對的source.dir。喜歡的東西:

source.dir=src;./../../../other.package/src;./../../and.other/src

它編譯良好,但阻止測試運行。當我設置路徑絕對:

source.dir=${workspace}/my.package/src;${workspace}/other.package/src;${workspace}/and.other/src

測試並運行。

相關問題