Test resources in Leiningen are managed using profiles. To set up a directory with test resources, you would add its path to the :resource-paths
property of the :test
profile (to make it available only to the test
task) or :dev
profile (to make it available to all dev tasks, e.g. test
, run
, repl
, etc.)
Sample project.clj
for a Maven-like project structure:
(defproject myproject "0.0.1-SNAPSHOT"
:source-paths ["src/main/clj"]
:test-paths ["src/test/clj"]
:resource-paths ["src/main/resources"]
:dev {:resource-paths ["src/test/resources"]})
When the :dev
profile is active, its :resource-paths
values are merged with the :resource-paths
from the base project, giving you what you're looking for.
See the Leiningen docs for more information on profiles.