Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 527

Dune test error: 'Fatal error: exception Sys_error("data/abs.decTest: No such file or directory")'

$
0
0

Hi, running dune test in CI ( https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/22cd4fd03c1642202eb2f4c2097c190285b9e91c/variant/compilers,4.08,decimal.0.1.0,tests ) is failing with the following output:

### output ###
# decimal_test alias test/runtest (exit 2)
# (cd _build/default/test && ./decimal_test.exe)
# Test file: data/abs.decTest
# Fatal error: exception Sys_error("data/abs.decTest: No such file or directory")

The line Test file: data/abs.decTest is printed from the following code in decimal_test.ml:

let eval_file filename =
  print_string "Test file: ";
  print_endline filename;
  let ch = open_in filename in
  let str = really_input_string ch (in_channel_length ch) in
  close_in ch;
  eval_str str

So it’s throwing the exception when trying to open the file data/abs.decTest. Thing is, the file (among others) does exist in the repo:

test/
  data/
    abs.decTest
  decimal_test.ml
  dune

I know that dune does the build in an internal working directory, do I need to somehow tell it to copy the test data files into that and if so how? Would that be with https://dune.readthedocs.io/en/stable/dune-files.html?highlight=copy#copy-files ?

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 527

Trending Articles