I’m trying to run some unittests that I wrote using @everythingfunctional 's vegetables framework, but I keep getting this error:
<ERROR>*cmd_run*:targets error:Unable to find source for module dependency: "my_module" used by "foo/bar/test/my_module_test.f90"
STOP 1
The problem seems to be with my directory structure, since I can’t seem to point the fpm test
to the correct directory.
my_repo/
├─ foo/
│ ├─ bar/
│ │ ├─ my_module.f90
│ │ ├─ test/
│ │ │ ├─ main.f90
│ │ │ ├─ my_module_test.f90
├─ fpm.toml
If I move my_module.f90
into the test
directory, all the tests run. My fpm.toml
file looks like this:
name = "My_Project"
author = "NolantheNerd"
[install]
library = true
[library]
source-dir = "foo/bar"
include-dir = "foo/bar"
[build]
external-modules = "foo/bar"
link = "foo/bar/my_module.f90"
[dev-dependencies]
vegetables = { git = "https://gitlab.com/everythingfunctional/vegetables.git", tag = "v7.2.2" }
[[test]]
name = "TestsForMyModule"
source-dir = "foo/bar/test"
main = "main.f90"
link = "foo/bar/my_module.f90"
How can I run unittests on a module contained in a different directory?