The -unittest flag should just accept a pattern, same as -i, so you can explicitly add or remove things that get the unittest build. Then you can be like dmd -unittest=foo.bar -i main.d and it will build foo.bar with unitest and skip the rest while still auto-following imports.