如何使用 cabal new-test 通过测试选项?

How can I pass test-options with cabal new-test?

在旧的 cabal 中,您可以通过 cabal test --test-option=--color --test-option=--match=name 来通过 --color--match=name 等测试选项。这可以用 cabal new-test 来完成吗?我在 cabal new-test --help.

的帮助输出中没有看到 --test-option

不,不可能,大概是因为new-test 运行都是test suite,所以不清楚传给哪个test。

但是 cabal 的新版本在 new-test 的帮助中告诉您:

To pass command-line arguments to a test suite, see the new-run command.

所以这就是 运行 带有选项的单个测试套件的方法。