From 26dd2fa5c4875423f04d1961dc3aa0f37aeccfa8 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 13 Dec 2007 19:05:29 +0000 Subject: [PATCH] Renamed the TestUtil and TreeUtil modules to TestUtils and TreeUtils, to be consistent with the Utils module --- GenTagAST.hs | 2 +- Makefile.am | 4 ++-- TestMain.hs | 2 +- backends/BackendPassesTest.hs | 4 ++-- backends/GenerateCTest.hs | 2 +- common/CommonTest.hs | 2 +- common/FlowGraph.hs | 2 +- common/FlowGraphTest.hs | 2 +- common/Pass.hs | 2 +- common/{TestUtil.hs => TestUtils.hs} | 4 ++-- common/{TreeUtil.hs => TreeUtils.hs} | 2 +- frontends/ParseRainTest.hs | 4 ++-- frontends/RainPasses.hs | 2 +- frontends/RainPassesTest.hs | 4 ++-- frontends/RainTypesTest.hs | 4 ++-- transformations/PassTest.hs | 4 ++-- transformations/RainUsageCheckTest.hs | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) rename common/{TestUtil.hs => TestUtils.hs} (99%) rename common/{TreeUtil.hs => TreeUtils.hs} (99%) diff --git a/GenTagAST.hs b/GenTagAST.hs index 6ba1818..0723ea0 100644 --- a/GenTagAST.hs +++ b/GenTagAST.hs @@ -38,7 +38,7 @@ genHeader = [ ,"" ,"import qualified AST as A" ,"import Pattern" - ,"import TreeUtil" + ,"import TreeUtils" -- Could probably auto-generate these, too: ,"type F0 = Pattern" ,"type F1 = (Data a0) => a0 -> Pattern" diff --git a/Makefile.am b/Makefile.am index f232d96..e71ff24 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,7 +56,7 @@ tock_SOURCES_hs += transformations/Unnest.hs transformations/RainUsageCheck.hs t tock_SOURCES_hs += transformations/SimplifyComms.hs transformations/ArrayUsageCheck.hs tock_SOURCES_hs += frontends/PreprocessOccam.hs frontends/ParseRain.hs frontends/StructureOccam.hs tock_SOURCES_hs += frontends/ParseOccam.hs frontends/RainTypes.hs frontends/RainPasses.hs frontends/ParseUtils.hs -tock_SOURCES_hs += common/Pass.hs common/TreeUtil.hs common/Intrinsics.hs common/EvalLiterals.hs +tock_SOURCES_hs += common/Pass.hs common/TreeUtils.hs common/Intrinsics.hs common/EvalLiterals.hs tock_SOURCES_hs += common/Pattern.hs common/Errors.hs common/ShowCode.hs common/PrettyShow.hs tock_SOURCES_hs += common/EvalConstants.hs common/Utils.hs common/CompState.hs common/Types.hs tock_SOURCES_hs += common/Metadata.hs common/AST.hs common/FlowGraph.hs common/FlowAlgorithms.hs @@ -71,7 +71,7 @@ tock_SOURCES = $(tock_SOURCES_hs) frontends/LexOccam.x frontends/LexRain.x tocktest_SOURCES = $(tock_SOURCES) tocktest_SOURCES += transformations/PassTest.hs transformations/RainUsageCheckTest.hs tocktest_SOURCES += backends/GenerateCTest.hs backends/BackendPassesTest.hs -tocktest_SOURCES += common/TestUtil.hs common/CommonTest.hs common/FlowGraphTest.hs +tocktest_SOURCES += common/TestUtils.hs common/CommonTest.hs common/FlowGraphTest.hs tocktest_SOURCES += frontends/ParseRainTest.hs frontends/RainPassesTest.hs frontends/RainTypesTest.hs tocktest_SOURCES += TestMain.hs diff --git a/TestMain.hs b/TestMain.hs index 03d20dc..25bd49a 100644 --- a/TestMain.hs +++ b/TestMain.hs @@ -50,7 +50,7 @@ import qualified PassTest (tests) import qualified RainPassesTest (tests) import qualified RainTypesTest (tests) import qualified RainUsageCheckTest (qcTests) -import TestUtil +import TestUtils import Utils -- We run all the HUnit tests before all the QuickCheck tests. diff --git a/backends/BackendPassesTest.hs b/backends/BackendPassesTest.hs index fd13801..b8c38fd 100644 --- a/backends/BackendPassesTest.hs +++ b/backends/BackendPassesTest.hs @@ -27,8 +27,8 @@ import Test.HUnit hiding (State) import qualified AST as A import BackendPasses import Pattern -import TestUtil -import TreeUtil +import TestUtils +import TreeUtils -- | Test WaitUntil guard (should be unchanged) testTransformWaitFor0 :: Test diff --git a/backends/GenerateCTest.hs b/backends/GenerateCTest.hs index 47345f7..2709ed2 100644 --- a/backends/GenerateCTest.hs +++ b/backends/GenerateCTest.hs @@ -45,7 +45,7 @@ import Errors import GenerateC import GenerateCPPCSP import Metadata -import TestUtil +import TestUtils -- | A few helper functions for writing certain characters (that won't appear in our generated C/C++ source) -- to the WriterT monad. Useful as simple placeholders/special values during testers. diff --git a/common/CommonTest.hs b/common/CommonTest.hs index 8e45ea7..d7a06d2 100644 --- a/common/CommonTest.hs +++ b/common/CommonTest.hs @@ -26,7 +26,7 @@ import Test.HUnit hiding (State) import qualified AST as A import Metadata -import TreeUtil +import TreeUtils import Types -- | Tests the isSafeConversion function: diff --git a/common/FlowGraph.hs b/common/FlowGraph.hs index f3cc081..ad05873 100644 --- a/common/FlowGraph.hs +++ b/common/FlowGraph.hs @@ -50,7 +50,7 @@ import Data.Graph.Inductive import qualified AST as A import Metadata -import TreeUtil +import TreeUtils import Utils -- | A node will either have zero links out, one or more Seq links, or one or more Par links. diff --git a/common/FlowGraphTest.hs b/common/FlowGraphTest.hs index 517cdf4..1aec225 100644 --- a/common/FlowGraphTest.hs +++ b/common/FlowGraphTest.hs @@ -37,7 +37,7 @@ import qualified AST as A import FlowGraph import Metadata import PrettyShow -import TestUtil +import TestUtils import Utils -- | Makes a distinctive metatag for testing. The function is one-to-one. diff --git a/common/Pass.hs b/common/Pass.hs index 334ef84..aed3dfa 100644 --- a/common/Pass.hs +++ b/common/Pass.hs @@ -30,7 +30,7 @@ import CompState import Errors import Metadata import PrettyShow -import TreeUtil +import TreeUtils -- | The monad in which AST-mangling passes operate. type PassM = ErrorT ErrorReport (StateT CompState IO) diff --git a/common/TestUtil.hs b/common/TestUtils.hs similarity index 99% rename from common/TestUtil.hs rename to common/TestUtils.hs index bd26bda..46a76bc 100644 --- a/common/TestUtil.hs +++ b/common/TestUtils.hs @@ -36,7 +36,7 @@ If they are not equal, it shows them (using 'show') with the given message prefi -} -module TestUtil where +module TestUtils where import Control.Monad.Error import Control.Monad.State @@ -52,7 +52,7 @@ import Metadata (Meta,emptyMeta) import Pass import Pattern import PrettyShow -import TreeUtil +import TreeUtils import Types import Utils diff --git a/common/TreeUtil.hs b/common/TreeUtils.hs similarity index 99% rename from common/TreeUtil.hs rename to common/TreeUtils.hs index c7bb6cc..cd7c1bb 100644 --- a/common/TreeUtil.hs +++ b/common/TreeUtils.hs @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . -} -module TreeUtil ( +module TreeUtils ( MatchErrors, AnyDataItem(..), Items, castADI, assertPatternMatch, getMatchedItems, diff --git a/frontends/ParseRainTest.hs b/frontends/ParseRainTest.hs index 4b609ec..2577adf 100644 --- a/frontends/ParseRainTest.hs +++ b/frontends/ParseRainTest.hs @@ -46,8 +46,8 @@ import qualified LexRain as L import Metadata (Meta,emptyMeta) import qualified ParseRain as RP import Pattern -import TestUtil -import TreeUtil +import TestUtils +import TreeUtils data ParseTest a = Show a => ExpPass (String, RP.RainParser a , (a -> Assertion)) | ExpFail (String, RP.RainParser a) diff --git a/frontends/RainPasses.hs b/frontends/RainPasses.hs index 7b0b5a6..9514ace 100644 --- a/frontends/RainPasses.hs +++ b/frontends/RainPasses.hs @@ -31,7 +31,7 @@ import Metadata import Pass import Pattern import RainTypes -import TreeUtil +import TreeUtils import Types -- | An ordered list of the Rain-specific passes to be run. diff --git a/frontends/RainPassesTest.hs b/frontends/RainPassesTest.hs index 51c31b4..bd61e83 100644 --- a/frontends/RainPassesTest.hs +++ b/frontends/RainPassesTest.hs @@ -42,8 +42,8 @@ import Pattern import RainPasses import RainTypes import TagAST -import TestUtil -import TreeUtil +import TestUtils +import TreeUtils -- | A helper function that returns a simple A.Structured item (A.OnlyP m $ A.Skip m). skipP :: A.Structured diff --git a/frontends/RainTypesTest.hs b/frontends/RainTypesTest.hs index 08e9204..428382b 100644 --- a/frontends/RainTypesTest.hs +++ b/frontends/RainTypesTest.hs @@ -31,8 +31,8 @@ import Pass import Pattern import RainTypes import TagAST -import TestUtil -import TreeUtil +import TestUtils +import TreeUtils import Types -- | Tests that constants in expressions are folded properly. TODO these tests could do with a lot of expanding. diff --git a/transformations/PassTest.hs b/transformations/PassTest.hs index 2b670b5..77a25e2 100644 --- a/transformations/PassTest.hs +++ b/transformations/PassTest.hs @@ -30,8 +30,8 @@ import Metadata import Pattern import SimplifyComms import SimplifyExprs -import TestUtil -import TreeUtil +import TestUtils +import TreeUtils -- | A handy typed version of Nothing for use with A.Declaration noInit :: Maybe A.Expression diff --git a/transformations/RainUsageCheckTest.hs b/transformations/RainUsageCheckTest.hs index 4d3495f..703035d 100644 --- a/transformations/RainUsageCheckTest.hs +++ b/transformations/RainUsageCheckTest.hs @@ -33,7 +33,7 @@ import qualified AST as A import FlowGraph import Metadata import RainUsageCheck -import TestUtil +import TestUtils import Utils