Hi, I’ve been trying to make a jbuild file for tests (alcotest), but before running them I want to copy one file into the same directory with the tests.exe. I described an executable part in the jbuild, and below an alias to run tests with “jbuilder build @_build/default/src/runtest”. The alias part looks like
Everything works fine, but there is a warning saying “Warning: Aliases must not have targets, this target will be ignored. This will become an error in the future.”. It points out to the file2.txt. How it can be fixed?
Hi. This solution worked fine with jbuilder, but once I updated to dune the build process fails with “Error: path outside the workspace:”. I’ve updated all parts to dune according to https://dune.readthedocs.io/en/latest/migration.html.
Is there a way to add to the workspace the whole project folder or maybe only path/file1.txt? “path/file1.txt” is located in the root folder of the project.
The folder structure is
project1
project1/project1.opam
project1/src
project1/test_data
I want to copy somehow files from “test_data” folder to the “_build/default/src/” before running “tests.exe”. Maybe there is a better approach? Thanks for the help.
It works.
By having 3 “…” in the ../../../test_data/test_file.txt I thought we go back to the root project folder out of the _build/default/src, which worked somehow with jbuilder. Now I see the test_data folder in the _build/default.
Thanks for the explanation.
It indeed used to work with jbuilder, however in Dune we added the possibility to change the build directory (via a command line option or environment variable) so we made such paths forbidden.