dmd -unittest foo.d Then version(unittest) blocks will be run inside modules that `foo` imports, even though the unittests for those modules will not run. Two questions: 1. Is this a bug? 2. If not, how can I tell if unittests are running in *this* module?