簡體   English   中英

使用 mpirun 運行 Junit 測試,使用 maven surefire

[英]Running Junit tests with mpirun using maven surefire

I would like to make some Junit tests using mpirun -n 4 java <relevant arguments> , very similar to what was discussed in this question , but using maven surefire rather than ant.

從上一個問題中的評論來看,OP 似乎能夠通過創建一個專用腳本並在他的 ant 腳本引用該腳本的junit部分的jvm參數來實現這一點。

我的問題是:maven 防火中是否存在等效功能? 可以讓我將用於任意腳本的“java”命令更改為什么? 或者我應該創建一個特定的 ant 腳本以從 maven 調用?

這是我的pom.xml文件的摘錄:

         <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
           <version>2.22.1</version>
           <configuration>
             <!-- Specify a script with a relative path here ? -->
           </configuration>
         </plugin>

經過一些工作,我最終得到了一個與我預期完全不同的解決方案。

我開發了自己的 Junit4 運行器,它為我創建了正確的mpirun -np X java -cp...命令並解析每個等級的測試結果。

由於使用自定義運行器是 Junit4 的標准功能,它與運行 Junit 測試的任何環境無縫集成,包括我特別感興趣的 Maven Surefire(和 Failsafe)插件。

I will not develop the implementation details of how this custom Junit runner works but if you are interested, I just released it on GitHub (website: https://handist.github.io/mpi-junit/ ).

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM