小编Mat*_*att的帖子

从命令行生成JUnit报告

我有一个云系统的测试设置,它使用python的混合物进行过程级控制,使用junit进行内部状态检查.从本质上讲,我将几个虚拟机作为云提供给服务器,然后是一个junit虚拟机,它是云的一部分,但可以驱动测试并检查内部状态.我们现有的云管理内容是由python驱动的,我想保持这一点.

我有一个工作设置,将通过运行JUnit命令行

java -ea -cp <classpath> org.junit.runner.JUnitCore <tests>
Run Code Online (Sandbox Code Playgroud)

但这不会产生报告文件.我知道蚂蚁能够生成一个xml报告,但我不想让蚂蚁参与这个过程(我已经有足够的移动部件了).

有没有办法从命令行启动junit,以便生成报告?

理想情况下,我会让junit测试生成xml报告,python测试生成xml报告,然后将它们合并在一起供我们的CI系统使用.

更新:命令行执行必须支持Windows,Linux和Mac.虽然包装内部蚂蚁可能是一种选择,但我们不允许运送外部蚂蚁.

junit continuous-integration junit4

18
推荐指数
1
解决办法
1万
查看次数

使用Clojure deftype作为参数化函数

我试图在编译器中使用clojure,因此需要参数化调用deftype; 但是,我很难让类型提示继续进行.请考虑以下代码:

(defn describe [x] 
  (let [fields (.getDeclaredFields x)
        names (map #(.getName %) fields)
        types (map #(.getType %) fields)]
    (interleave types names)))

(defn direct [] (deftype direct-type [^int x]))
(defn indirect-helper [] (list ^int (symbol "x")))
(defn indirect [] (eval `(deftype ~(symbol  "indirect-type") ~(indirect-helper))))
Run Code Online (Sandbox Code Playgroud)

以下来自REPL的会议:

Clojure 1.2.0-master-SNAPSHOT
1:1 user=> #<Namespace dataclass>
1:2 dataclass=> (direct)
dataclass.direct-type
1:3 dataclass=> (indirect)
dataclass.indirect-type
1:4 dataclass=> (describe direct-type)
(int "x")
1:5 dataclass=> (describe indirect-type)
(java.lang.Object "x")
Run Code Online (Sandbox Code Playgroud)

请注意,为indirect-type生成的类已经丢失了direct-type所具有的^ int提示.我如何获得这些提示?

clojure deftype

7
推荐指数
1
解决办法
480
查看次数

标签 统计

clojure ×1

continuous-integration ×1

deftype ×1

junit ×1

junit4 ×1