如何让ocp build为ocaml项目运行oUnit测试?

如何让ocp build为ocaml项目运行oUnit测试?,ocaml,typerex,Ocaml,Typerex,我已经建立了一个使用ocp构建的小型ocaml项目。我很好,但是 我不知道如何让oUnit测试运行,也找不到任何好的方法 在线示例 我的项目是这样安排的: -sample_project |-src | |-main | | |-build.ocp | | |-main.ml | |-test | |-test.ml | |-test.ocp main.ml只是hello world test.ml是来自oUnit站点的一个示例测试 生成文件包含: build.ocp:

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

我的项目是这样安排的:

-sample_project
 |-src
 | |-main
 | | |-build.ocp
 | | |-main.ml
 | |-test
 |   |-test.ml
 |   |-test.ocp 
main.ml只是hello world test.ml是来自oUnit站点的一个示例测试

生成文件包含:

build.ocp:

test.ocp:

以下是运行ocp build时得到的输出:

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构建项目本身,我在线获得的源代码(定义了测试)似乎也不起作用。我得到了与我的示例项目类似的输出


提前感谢。

我最终改用了oasis,可能最终会改用just make。

不确定如何做到这一点,但fwiw显然ocp build是一个死项目。谢谢,很高兴知道这一点。我不确定最好的构建工具是什么。是的,构建系统的情况现在很糟糕。。。我总是只使用makefile。
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
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 ?