Note: this function is memoized to ensure we compile each module only once. Without this lock, if multiple `Test`s ran concurrently in the same process, the test harness would compile each module multiple times concurrently, which is bad both for performance reasons as well as can lead to errors with toolchains like .NET which don't expect parallel invocations of their build tools on the same proj
(module: &str)
| 170 | // with toolchains like .NET which don't expect parallel invocations |
| 171 | // of their build tools on the same project folder. |
| 172 | fn compile_module(module: &str) -> (String, HostType) { |
| 173 | let module = module.to_owned(); |
| 174 | |
| 175 | memoized!(|module: String| -> (String, HostType) { |
| 176 | let module = CompiledModule::compile(module, CompilationMode::Debug); |
| 177 | (module.path().to_str().unwrap().to_owned(), module.host_type) |
| 178 | }) |
| 179 | } |
| 180 | |
| 181 | // Note: this function does not memoize because we want each test to publish the same |
| 182 | // module as a separate clean database instance for isolation purposes. |
no test coverage detected
searching dependent graphs…