I came across a problem when I tried to run the test files in a emacs project.
For example, I cloned this project into my home directory, cd into test dir and then used emacs -batch -l ert -l nrepl-tests.el -f ert-run-tests-batch-and-exit
to run the tests. But it couldn't locate the file nrepl.el which was not in the same directory. So, I copy one into ~/nrep.el/test. But it said "Cannot open load file: clojure-mode". That is the question I'm concered.
I do have clojure-mode and other libs nrepl.el use. But they are all in different directory(In my case, ~/emacs.d/packs/live/clojure-pack/lib/). Do I have to duplicate these files into my cloned nrepl project in order to run the test? Is there a better way to run test files like we do in IDE. For instance, in Intellij, I simply write import statements in test files, and it automatically prepares the dependency libs for me. This bothers me quite a lot. I'm wondering if there is a best practice for this problem.
If I understand you correctly, I'm under impression that Carton is precisely what you're looking for to overcome these dependency issues: package maintainer is expected to write a small file containing package dependencies including development ones, like ert, and run emacs via carton exec
which will make sure everything is downloaded to a certain directory and this directory is added to load-path
.