Custom test runners do not copy test files in directories. #5384
Answered
by
rgrinberg
tmcgilchrist
asked this question in
Q&A
-
Expected BehaviourGiven a setup of this custom diff executable: ;; Custom diff executable.
(executable
(package gitlab-unix)
(libraries gitlab-unix cmdliner)
(public_name diff)
(modules diff)
(name diff))
; Run diff.exe on each GitLab sample json from test/cases/
(rule
(with-stdout-to events_output.json
(run ./diff.exe events)))
(rule
(alias runtest)
(action
(diff cases/events/expected.json events_output.json))) This directory structure test
├── cases
│ └── events
│ ├── event.json
│ └── expected.json
├── diff.ml
└── dune I expected that Actual Behavior$ dune runtest
diff test/events_output.json (exit 1)
(cd _build/default/test && ./diff.exe events) > _build/default/test/events_output.json
diff: internal error, uncaught exception:
Sys_error("cases/events/event.json: No such file or directory")
$ ls _build/default/test
diff.exe diff.ml If the diff behaviour is written as a test like this with a (test
(name test)
(package gitlab-unix)
(libraries gitlab-unix alcotest)
(modules test)
(deps
(source_tree cases))) Specifications
|
Beta Was this translation helpful? Give feedback.
Answered by
rgrinberg
Jan 26, 2022
Replies: 1 comment 1 reply
-
The following rule:
Attempts to read
Cheers. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tmcgilchrist
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following rule:
Attempts to read
cases/events/event.json
but does not declare a dependency on this file. You can amend the rule to declare the dependency with the long form for rules:Cheers.