     private func constructTestModules(modules: [Module]) throws -> [Module] {
         let testsPath = packagePath.appending("Tests")
         
-        // Don't try to walk Tests if it is in excludes.
-        guard testsPath.asString.isDirectory && !excludedPaths.contains(testsPath) else { return [] }
+        // Don't try to walk Tests if it is in excludes or doesn't exists.
+        guard fileSystem.isDirectory(testsPath) && !excludedPaths.contains(testsPath) else {
+            return []
+        }
 
         // Create the test modules
-        let testModules = try walk(testsPath, recursively: false).filter(shouldConsiderDirectory).flatMap { dir in
+        let testModules = try directoryContents(testsPath).filter(shouldConsiderDirectory).flatMap { dir in
             return [try modulify(dir, name: dir.basename, isTest: true)]
         }
 

    }
    
    private func modulify(_ path: AbsolutePath, name: String, isTest: Bool) throws -> Module {
        let walked = try walk(path, recursing: shouldConsiderDirectory).map{ $0 }
        
        let cSources = walked.filter{ isValidSource($0, validExtensions: SupportedLanguageExtension.cFamilyExtensions) }
        let swiftSources = walked.filter{ isValidSource($0, validExtensions: SupportedLanguageExtension.swiftExtensions) }

        case 0:
            return packagePath
        case 1:
            return packagePath.appending(component: viableRoots[0])
        default:
            // eg. there is a `Sources' AND a `src'
            throw ModuleError.invalidLayout(.multipleSourceRoots(viableRoots.map{ packagePath.appending(component: $0).asString }))
        }
    }

    /// Collects the modules which are defined by a package.
    private func constructModules() throws -> [Module] {
        let moduleMapPath = packagePath.appending("module.modulemap")
        if fileSystem.isFile(moduleMapPath) {
            let sources = Sources(paths: [moduleMapPath], root: packagePath)
            return [try CModule(name: manifest.name, sources: sources, path: packagePath, pkgConfig: pkgConfigPath, providers: manifest.package.providers)]
        }
