首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何获得ocp-build来运行ocaml项目的oUnit测试?

如何获得ocp-build来运行ocaml项目的oUnit测试?
EN

Stack Overflow用户
提问于 2015-05-28 21:24:49
回答 1查看 130关注 0票数 0

我已经建立了一个使用ocp-build的小型ocaml项目。我构建得很好,但我不知道如何让oUnit测试运行,也无法在网上找到任何好的示例。

我的项目如下所示:

代码语言:javascript
复制
-sample_project
 |-src
 | |-main
 | | |-build.ocp
 | | |-main.ml
 | |-test
 |   |-test.ml
 |   |-test.ocp 

main.ml只是"hello“,test.ml是来自oUnit站点的一个示例测试。

生成文件包含:

build.ocp:

代码语言:javascript
复制
begin program "hello"
  files = [ "main.ml"]
  requires = [ "batteries" ]
end

test.ocp:

代码语言:javascript
复制
begin program "run_test"
  files = [ "test.ml"]
  requires = [ "oUnit" ]
end

begin test "test"
  files = [ ]
  requires = [ "run_test" ]
  test_cmd = "run_test"
  tests = [ "test_list_length" ]
end

下面是运行ocp-build的输出:

代码语言:javascript
复制
sample_project>ocp-build -test
find_project_root
Warning: Could not find OCaml ocamldoc tool.
Warning: 4 missing and 2 disabled (use -print-missing)
Updating ocp-build.root
Warning: 2 missing and 1 disabled (use -print-missing)
Warning: 5 package conflicts solved (use -print-conflicts)
Build Successful in 0.13s. 0 jobs (parallelism 0.0x), 0 files generated.

sample_project>ocp-build tests
find_project_root
Warning: Could not find OCaml ocamldoc tool.
Warning: 4 missing and 2 disabled (use -print-missing)
Updating ocp-build.root
Warning: 2 missing and 1 disabled (use -print-missing)
Warning: 5 package conflicts solved (use -print-conflicts)
Error: project contains no targets
        Are your .ocp files empty ?

测试被设计为失败(并且在作为字节码运行时确实失败)。

即使是ocp构建项目本身(我在网上获得了源代码),它也定义了一个测试,但似乎不起作用。(我得到的输出与我的示例项目相似)。

提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-08 18:40:46

我最终使用了绿洲,而且可能最终会转而使用make。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30517355

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档