如何运行单元测试?
2 个回答
- 投票数
-
- 2019-02-22
您可以使用以下命令运行所有测试:
dune build @runtest
如果要进行特定测试,则需要找到其"别名"
dune build @runtest_voting.sh
就是其中之一(我在
git grep runtest_vot
中发现:),文件.gitlab-ci.yml
也有很多示例.You can run all the tests with:
dune build @runtest
if you want particular tests you need to find their "alias name"
dune build @runtest_voting.sh
is one of them (That I found with
git grep runtest_vot
:), the file.gitlab-ci.yml
has many examples also).-
很棒的会尝试的.我需要单独安装沙丘吗?Awesome will try that. Do i need to install dune separately ?
- 0
- 2019-02-22
- Ezy
-
如果您已经构建了tezos,那么您已经拥有了" dune".也许您需要为外壳运行`eval $(opamenv)`才能"看到"它.If you have built tezos, you already have `dune`. Maybe you need to run `eval $(opam env)` for your shell to "see" it.
- 1
- 2019-02-22
- Seb Mondet
-
- 2019-02-22
一个人可以进入
src/proto_alpha/lib_protocol/test
并运行dune runtest
,这将执行协议alpha的所有单元测试,包括投票的单元测试.(voting.ml
中的内容).src/bin_client/test/test_voting.sh
中存在另一个测试,用于测试与投票相关的客户端命令.所有这些测试都是在运行
make test
时执行的.One can go in the
src/proto_alpha/lib_protocol/test
and rundune runtest
, which will execute all unit tests for the protocol alpha, including the ones for voting (those invoting.ml
).Another test is present in
src/bin_client/test/test_voting.sh
which tests the client commands related to voting.All these tests are executed when one runs
make test
.
我已经下载了源代码并从头开始构建节点.
我应该运行什么命令来仔细检查所有单元测试是否正常运行?
我特别想对投票进行单元测试.
>