From 55590e78dd6df0eac312eaadfc230533adfe0018 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Tue, 20 Oct 2020 14:24:55 -0500 Subject: Add tests for module's compile time info --- bootstrap/src/BuildModel.hs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'bootstrap/src') diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs index f4c809f..c6e422b 100644 --- a/bootstrap/src/BuildModel.hs +++ b/bootstrap/src/BuildModel.hs @@ -94,15 +94,28 @@ processRawSource rawSource = else undefined constructCompileTimeInfo :: Source -> [String] -> FilePath -> CompileTimeInfo -constructCompileTimeInfo program@(Program{}) availableModules buildDirectory = +constructCompileTimeInfo p@(Program{}) availableModules buildDirectory = CompileTimeInfo - { compileTimeInfoSourceFileName = programSourceFileName program - , compileTimeInfoObjectFileProduced = (programObjectFileName program) + { compileTimeInfoSourceFileName = programSourceFileName p + , compileTimeInfoObjectFileProduced = (programObjectFileName p) buildDirectory , compileTimeInfoOtherFilesProduced = [] , compileTimeInfoDirectDependencies = map (\mName -> buildDirectory mName <.> "mod") - (filter (`elem` availableModules) (programModulesUsed program)) + (filter (`elem` availableModules) (programModulesUsed p)) + } +constructCompileTimeInfo m@(Module{}) availableModules buildDirectory = + CompileTimeInfo + { compileTimeInfoSourceFileName = moduleSourceFileName m + , compileTimeInfoObjectFileProduced = (moduleObjectFileName m) + buildDirectory + , compileTimeInfoOtherFilesProduced = + (buildDirectory moduleName m <.> "mod") : if moduleProducesSmod m + then [buildDirectory moduleName m <.> "smod"] + else [] + , compileTimeInfoDirectDependencies = map + (\mName -> buildDirectory mName <.> "mod") + (filter (`elem` availableModules) (moduleModulesUsed m)) } constructCompileTimeInfo _ otherSources buildDirectory = undefined -- cgit v1.2.3