OCaml dune 测试程序如何找到测试输入文件?

问题描述 投票:0回答:1
── test
    ├── dune
    ├── test_program.ml
    └── foo_files
        ├── foo_a
        └── foo_b

使用

test_program
运行时
foo_files
如何找到文件夹
dune test
下的文件?

我可以看到,当程序运行时,当前工作目录是

_build/default/test
并且
foo_files
文件夹没有复制到那里。

testing ocaml dune
1个回答
0
投票

我想有一种更惯用的方法,但由于测试程序只能从存储库副本中的

dune test
运行,因此相对路径目前工作正常,例如:

"../../../test/foo_files"

© www.soinside.com 2019 - 2024. All rights reserved.