如何获得 ocp-build 以 运行 oUnit 测试 ocaml 项目?
How do I get ocp-build to run oUnit tests for an ocaml project?
我建立了一个使用 ocp-build 的小型 ocaml 项目。我建造得很好,但是
我不知道如何让 oUnit 测试达到 运行,也找不到任何好的
网上的例子。
我的项目布局如下:
-sample_project
|-src
| |-main
| | |-build.ocp
| | |-main.ml
| |-test
| |-test.ml
| |-test.ocp
main.ml 只是 "hello world" test.ml 是来自 oUnit 站点的示例测试。
构建文件包含:
build.ocp:
begin program "hello"
files = [ "main.ml"]
requires = [ "batteries" ]
end
test.ocp:
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
这是我得到的输出 运行ning 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-build 项目本身(我在网上获得了源代码)似乎也不起作用。 (我得到与我的示例项目类似的输出)。
提前致谢。
我最终改用了 oasis,最终可能会改用 make。
我建立了一个使用 ocp-build 的小型 ocaml 项目。我建造得很好,但是 我不知道如何让 oUnit 测试达到 运行,也找不到任何好的 网上的例子。
我的项目布局如下:
-sample_project
|-src
| |-main
| | |-build.ocp
| | |-main.ml
| |-test
| |-test.ml
| |-test.ocp
main.ml 只是 "hello world" test.ml 是来自 oUnit 站点的示例测试。
构建文件包含:
build.ocp:
begin program "hello"
files = [ "main.ml"]
requires = [ "batteries" ]
end
test.ocp:
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
这是我得到的输出 运行ning 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-build 项目本身(我在网上获得了源代码)似乎也不起作用。 (我得到与我的示例项目类似的输出)。
提前致谢。
我最终改用了 oasis,最终可能会改用 make。