aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-10-20 11:15:25 -0500
committerBrad Richardson <everythingfunctional@protonmail.com>2020-10-20 11:15:25 -0500
commit20ee2333cd86909e21ca5bd88f3d7166e1941c92 (patch)
treecb35e0d6840c0a3e6dee527467ede801b1efeea4
parent078f4ca5af387ef39e331f2eb2d7f0df5ce6d720 (diff)
downloadfpm-20ee2333cd86909e21ca5bd88f3d7166e1941c92.tar.gz
fpm-20ee2333cd86909e21ca5bd88f3d7166e1941c92.zip
Add test that program produces no other files
-rw-r--r--bootstrap/src/BuildModel.hs2
-rw-r--r--bootstrap/unit_test/ProgramToCompileInfoTest.hs6
2 files changed, 8 insertions, 0 deletions
diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs
index 86dbeab..86df719 100644
--- a/bootstrap/src/BuildModel.hs
+++ b/bootstrap/src/BuildModel.hs
@@ -61,6 +61,7 @@ data Source =
data CompileTimeInfo = CompileTimeInfo {
compileTimeInfoSourceFileName :: FilePath
, compileTimeInfoObjectFileProduced :: FilePath
+ , compileTimeInfoOtherFilesProduced :: [FilePath]
}
processRawSource :: RawSource -> Source
@@ -97,6 +98,7 @@ constructCompileTimeInfo program@(Program{}) otherSources buildDirectory =
{ compileTimeInfoSourceFileName = programSourceFileName program
, compileTimeInfoObjectFileProduced = (programObjectFileName program)
buildDirectory
+ , compileTimeInfoOtherFilesProduced = []
}
constructCompileTimeInfo _ otherSources buildDirectory = undefined
diff --git a/bootstrap/unit_test/ProgramToCompileInfoTest.hs b/bootstrap/unit_test/ProgramToCompileInfoTest.hs
index ca1f228..e16ab22 100644
--- a/bootstrap/unit_test/ProgramToCompileInfoTest.hs
+++ b/bootstrap/unit_test/ProgramToCompileInfoTest.hs
@@ -9,6 +9,7 @@ import BuildModel ( Source(..)
)
import Hedge ( Result
, Test
+ , assertEmpty
, assertEquals
, givenInput
, then'
@@ -25,6 +26,7 @@ test = return $ givenInput
doCompileTimeTransformation
[ then' "it still knows the original source file" checkSourceFileName
, then' "it knows what object file will be produced" checkObjectFileName
+ , then' "there are no other files produced" checkOtherFilesProduced
]
]
@@ -53,3 +55,7 @@ checkObjectFileName :: CompileTimeInfo -> Result
checkObjectFileName cti = assertEquals
("build_dir" </> "some_file_somewhere.f90.o")
(compileTimeInfoObjectFileProduced cti)
+
+checkOtherFilesProduced :: CompileTimeInfo -> Result
+checkOtherFilesProduced cti =
+ assertEmpty (compileTimeInfoOtherFilesProduced cti)