diff options
author | Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> | 2021-03-31 16:13:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-31 16:13:58 +0200 |
commit | d9dc9f2ae5f196c15a7d35cddabc805c40ff86ce (patch) | |
tree | 6f61952c630b023edec391daae2747063703d489 /bootstrap/unit_test/SubmoduleToCompileInfoTest.hs | |
parent | 5422ec57f4081bf2225f5dde5cc07999bf8010f9 (diff) | |
download | fpm-d9dc9f2ae5f196c15a7d35cddabc805c40ff86ce.tar.gz fpm-d9dc9f2ae5f196c15a7d35cddabc805c40ff86ce.zip |
Phase out Haskell fpm (#420)
- remove bootstrap directory from repository
- remove stack-build from CI workflow
- move Fortran fpm to project root
- adjust install script and bootstrap instructions
Diffstat (limited to 'bootstrap/unit_test/SubmoduleToCompileInfoTest.hs')
-rw-r--r-- | bootstrap/unit_test/SubmoduleToCompileInfoTest.hs | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/bootstrap/unit_test/SubmoduleToCompileInfoTest.hs b/bootstrap/unit_test/SubmoduleToCompileInfoTest.hs deleted file mode 100644 index 621b0d5..0000000 --- a/bootstrap/unit_test/SubmoduleToCompileInfoTest.hs +++ /dev/null @@ -1,78 +0,0 @@ -module SubmoduleToCompileInfoTest - ( test - ) -where - -import BuildModel ( AvailableModule(..) - , CompileTimeInfo(..) - , Source(..) - , constructCompileTimeInfo - ) -import Hedge ( Result - , Test - , assertEquals - , givenInput - , then' - , whenTransformed - ) -import System.FilePath ( (</>) ) - -test :: IO (Test ()) -test = return $ givenInput - "a submodule and available modules" - (exampleSubmodule, availableModules) - [ whenTransformed - "its compileTimeInfo is determined" - doCompileTimeTransformation - [ then' "it still knows the original source file" checkSourceFileName - , then' "it knows what object file will be produced" checkObjectFileName - , then' "the smod file is also produced" checkOtherFilesProduced - , then' - "the direct dependencies are the parent smod and the available modules used" - checkDirectDependencies - ] - ] - -exampleSubmodule :: Source -exampleSubmodule = Submodule - { submoduleSourceFileName = submoduleSourceFileName' - , submoduleObjectFileName = \bd -> bd </> "some_file_somewhere.f90.o" - , submoduleModulesUsed = ["module1", "module2", "module3"] - , submoduleBaseModuleName = "base_module" - , submoduleParentName = "base_module@parent" - , submoduleName = "some_submodule" - } - -submoduleSourceFileName' :: FilePath -submoduleSourceFileName' = "some" </> "file" </> "somewhere.f90" - -availableModules :: [AvailableModule] -availableModules = [ AvailableModule {availableModuleName = "module1", availableModuleFile = "build_dir" </> "module1.mod"} - , AvailableModule {availableModuleName = "module3", availableModuleFile = "build_dir" </> "module3.mod"} - ] - -doCompileTimeTransformation :: (Source, [AvailableModule]) -> CompileTimeInfo -doCompileTimeTransformation (programSource, otherSources) = - constructCompileTimeInfo programSource otherSources "build_dir" - -checkSourceFileName :: CompileTimeInfo -> Result -checkSourceFileName cti = - assertEquals submoduleSourceFileName' (compileTimeInfoSourceFileName cti) - -checkObjectFileName :: CompileTimeInfo -> Result -checkObjectFileName cti = assertEquals - ("build_dir" </> "some_file_somewhere.f90.o") - (compileTimeInfoObjectFileProduced cti) - -checkOtherFilesProduced :: CompileTimeInfo -> Result -checkOtherFilesProduced cti = assertEquals - ["build_dir" </> "base_module@some_submodule.smod"] - (compileTimeInfoOtherFilesProduced cti) - -checkDirectDependencies :: CompileTimeInfo -> Result -checkDirectDependencies cti = assertEquals - [ "build_dir" </> "base_module@parent.smod" - , "build_dir" </> "module1.mod" - , "build_dir" </> "module3.mod" - ] - (compileTimeInfoDirectDependencies cti) |