-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #284 from camfort/make-list
Functionality to print a dependency list for a Fortran code base
- Loading branch information
Showing
9 changed files
with
124 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module leaf | ||
implicit none | ||
real :: constant = 0.1 | ||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module mid1 | ||
implicit none | ||
use leaf | ||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module mid2 | ||
implicit none | ||
use leaf | ||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module top | ||
implicit none | ||
use mid1 | ||
use mid2 | ||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module Language.Fortran.Analysis.ModGraphSpec (spec) where | ||
|
||
import Test.Hspec | ||
import TestUtil | ||
|
||
import Language.Fortran.Analysis.ModGraph | ||
import Language.Fortran.Util.Files (expandDirs) | ||
import Language.Fortran.Version | ||
import System.FilePath ((</>)) | ||
|
||
spec :: Spec | ||
spec = | ||
describe "Modgraph" $ | ||
it "Dependency graph and topological sort on small package" $ | ||
testDependencyList | ||
|
||
-- A simple test on a simple module structure to check that | ||
-- we are understanding this correctly (via the dependency graph | ||
-- and then its topological sort). | ||
testDependencyList = do | ||
paths' <- expandDirs ["test-data" </> "module"] | ||
mg <- genModGraph (Just Fortran90) ["."] Nothing paths' | ||
let list = modGraphToList mg | ||
let files = ["leaf.f90", "mid1.f90", "mid2.f90", "top.f90"] | ||
let filesWithPaths = map (("test-data" </> "module") </>) files | ||
list `shouldBe` filesWithPaths |