Skip to content

Commit

Permalink
ouroboros-network-testing: renamed modules
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Dec 19, 2024
1 parent eb7d95c commit f978ce6
Show file tree
Hide file tree
Showing 33 changed files with 144 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Test.Ouroboros.Network.RawBearer where
import Ouroboros.Network.IOManager
import Ouroboros.Network.RawBearer
import Ouroboros.Network.Snocket
import Ouroboros.Network.Testing.Data.AbsBearerInfo

import Control.Concurrent.Class.MonadMVar
import Control.Exception (Exception)
Expand All @@ -34,6 +33,7 @@ import System.Directory (removeFile)
import System.IO.Error (ioeGetErrorType, isDoesNotExistErrorType)
import System.IO.Unsafe

import Test.Ouroboros.Network.Data.AbsBearerInfo
import Test.Simulation.Network.Snocket (toBearerInfo)
import Test.Tasty
import Test.Tasty.QuickCheck
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,20 @@ import Ouroboros.Network.Snocket qualified as Snocket

import Simulation.Network.Snocket

import Ouroboros.Network.Testing.Data.AbsBearerInfo hiding (delay)
import Ouroboros.Network.Testing.Utils (WithName (..), WithTime (..),
genDelayWithPrecision, nightlyTest, sayTracer, tracerWithTime)

import Test.Ouroboros.Network.ConnectionManager.Experiments
import Test.Ouroboros.Network.ConnectionManager.Timeouts
import Test.Ouroboros.Network.ConnectionManager.Utils
(abstractStateIsFinalTransition, allValidTransitionsNames,
validTransitionMap, verifyAbstractTransition,
verifyAbstractTransitionOrder)
import Test.Ouroboros.Network.Data.AbsBearerInfo hiding (delay)
import Test.Ouroboros.Network.InboundGovernor.Utils
(allValidRemoteTransitionsNames, remoteStrIsFinalTransition,
validRemoteTransitionMap, verifyRemoteTransition,
verifyRemoteTransitionOrder)
import Test.Ouroboros.Network.Orphans ()
import Test.Ouroboros.Network.Utils (WithName (..), WithTime (..),
genDelayWithPrecision, nightlyTest, sayTracer, tracerWithTime)
import Test.Simulation.Network.Snocket hiding (tests)

tests :: TestTree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import Network.TypedProtocol.ReqResp.Client
import Network.TypedProtocol.ReqResp.Server
import Network.TypedProtocol.ReqResp.Type

import Ouroboros.Network.Testing.Data.AbsBearerInfo
import Test.Ouroboros.Network.Data.AbsBearerInfo
import Test.Ouroboros.Network.Orphans ()

import Test.QuickCheck hiding (Result (..))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import Ouroboros.Network.ConnectionId
import Ouroboros.Network.ConnectionManager.ConnMap as ConnMap
import Ouroboros.Network.ConnectionManager.Types

import Ouroboros.Network.Testing.Utils (WithName (..))
import Test.Ouroboros.Network.Utils (WithName (..))

-- | 'ConnectionManager' state: for each peer we keep a 'ConnectionState' in
-- a mutable variable, which reduces congestion on the 'TMVar' which keeps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import Ouroboros.Network.ConnectionManager.Types (AddressType (..))
import Ouroboros.Network.RawBearer
import Ouroboros.Network.Snocket

import Ouroboros.Network.Testing.Data.Script (Script (..), stepScriptSTM)
import Test.Ouroboros.Network.Data.Script (Script (..), stepScriptSTM)

data Connection m addr = Connection
{ -- | Attenuated channels of a connection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ import Ouroboros.Network.Server2 (RemoteTransitionTrace)
import Ouroboros.Network.Server2 qualified as Server
import Ouroboros.Network.Snocket (Snocket)
import Ouroboros.Network.Snocket qualified as Snocket
import Ouroboros.Network.Testing.Utils (WithName (..))

import Test.Ouroboros.Network.ConnectionManager.Timeouts
import Test.Ouroboros.Network.Orphans ()
import Test.Ouroboros.Network.Utils (WithName (..))

import Ouroboros.Network.ConnectionManager.InformationChannel
(newInformationChannel)
Expand Down
2 changes: 1 addition & 1 deletion ouroboros-network-protocols/test/Test/Chain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import Test.Tasty.QuickCheck (testProperty)
import Ouroboros.Network.Block (blockPrevHash, pattern GenesisPoint, pointHash)
import Ouroboros.Network.Mock.Chain (Chain (..))
import Ouroboros.Network.Mock.Chain qualified as Chain
import Ouroboros.Network.Testing.Serialise (prop_serialise)

import Test.ChainGenerators hiding (tests)
import Test.Ouroboros.Network.Serialise (prop_serialise)


--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
-- TODO rename to `Test.Ouroboros.Network.Protocols.Utils`
module Test.Ouroboros.Network.Testing.Utils where

import Codec.CBOR.FlatTerm qualified as CBOR
Expand Down
1 change: 1 addition & 0 deletions ouroboros-network-testing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Breaking changes

* Renamed modules from `Ouroboros.Network.Testing.*` to `Test.Ouroboros.Network.*`
* Added `IOError` field to `ErrorInterval :: AbsAttenuation` constructor.

### Non-Breaking changes
Expand Down
14 changes: 7 additions & 7 deletions ouroboros-network-testing/ouroboros-network-testing.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ library
-- At this experiment/prototype stage everything is exposed.
-- This has to be tidied up once the design becomes clear.
exposed-modules:
Ouroboros.Network.Testing.Data.AbsBearerInfo
Ouroboros.Network.Testing.Data.Script
Ouroboros.Network.Testing.Data.Signal
Ouroboros.Network.Testing.QuickCheck
Ouroboros.Network.Testing.Serialise
Ouroboros.Network.Testing.Utils
Test.Ouroboros.Network.Data.AbsBearerInfo
Test.Ouroboros.Network.Data.Script
Test.Ouroboros.Network.Data.Signal
Test.Ouroboros.Network.QuickCheck
Test.Ouroboros.Network.Serialise
Test.Ouroboros.Network.Utils

default-language: Haskell2010
default-extensions: ImportQualifiedPost
Expand Down Expand Up @@ -98,7 +98,7 @@ test-suite test
type: exitcode-stdio-1.0
main-is: Main.hs
hs-source-dirs: test
other-modules: Test.Ouroboros.Network.Testing.Data.AbsBearerInfo
other-modules: Test.Ouroboros.Network.Data.AbsBearerInfo.Test
build-depends:
QuickCheck,
base >=4.14 && <4.21,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE NumericUnderscores #-}

module Ouroboros.Network.Testing.Data.AbsBearerInfo
module Test.Ouroboros.Network.Data.AbsBearerInfo
( AbsBearerInfoScript (..)
, canFail
, NonFailingAbsBearerInfo (..)
Expand All @@ -24,22 +24,21 @@ module Ouroboros.Network.Testing.Data.AbsBearerInfo
, AbsIOErrType (..)
) where

import Control.Monad.Class.MonadTime.SI (DiffTime, Time (..), addTime)
import Control.Monad.Class.MonadTime.SI (DiffTime, Time (..), addTime)

import qualified Data.List as List
import qualified Data.List.NonEmpty as NonEmpty
import Data.Monoid (Any (..))
import GHC.IO.Exception (IOException (..), IOErrorType (..))
import Foreign.C.Error (Errno (..), eCONNABORTED)
import Data.List qualified as List
import Data.List.NonEmpty qualified as NonEmpty
import Data.Monoid (Any (..))
import Foreign.C.Error (Errno (..), eCONNABORTED)
import GHC.IO.Exception (IOErrorType (..), IOException (..))

import Network.Mux.Bearer.AttenuatedChannel (Size,
SuccessOrFailure (..))
import Network.Mux.Types (SDUSize (..))
import Network.Mux.Bearer.AttenuatedChannel (Size, SuccessOrFailure (..))
import Network.Mux.Types (SDUSize (..))

import Ouroboros.Network.Testing.Data.Script (Script (..))
import Ouroboros.Network.Testing.Utils (Delay (..))
import Test.Ouroboros.Network.Data.Script (Script (..))
import Test.Ouroboros.Network.Utils (Delay (..))

import Test.QuickCheck hiding (Result (..))
import Test.QuickCheck hiding (Result (..))


data AbsDelay = SmallDelay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE TupleSections #-}

module Ouroboros.Network.Testing.Data.Script
module Test.Ouroboros.Network.Data.Script
( -- * Test scripts
Script (..)
, NonEmpty (..)
Expand Down Expand Up @@ -31,23 +31,23 @@ module Ouroboros.Network.Testing.Data.Script
, interpretPickScript
) where

import Data.Functor (($>))
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NonEmpty
import Data.Set (Set)
import qualified Data.Set as Set

import Control.Concurrent.Class.MonadSTM.Strict
import Control.Concurrent.Class.MonadSTM (TVar)
import qualified Control.Concurrent.Class.MonadSTM as LazySTM
import Control.Monad.Class.MonadAsync
import Control.Monad.Class.MonadFork
import Control.Monad.Class.MonadTimer.SI
import Control.Tracer (Tracer, traceWith)

import Ouroboros.Network.Testing.Utils (ShrinkCarefully,
prop_shrink_nonequal, shrinkVector)
import Test.QuickCheck
import Data.Functor (($>))
import Data.List.NonEmpty (NonEmpty (..))
import Data.List.NonEmpty qualified as NonEmpty
import Data.Set (Set)
import Data.Set qualified as Set

import Control.Concurrent.Class.MonadSTM (TVar)
import Control.Concurrent.Class.MonadSTM qualified as LazySTM
import Control.Concurrent.Class.MonadSTM.Strict
import Control.Monad.Class.MonadAsync
import Control.Monad.Class.MonadFork
import Control.Monad.Class.MonadTimer.SI
import Control.Tracer (Tracer, traceWith)

import Test.Ouroboros.Network.Utils (ShrinkCarefully, prop_shrink_nonequal,
shrinkVector)
import Test.QuickCheck

--
-- Test script abstraction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Ouroboros.Network.Testing.Data.Signal
module Test.Ouroboros.Network.Data.Signal
( -- * Events
Events
, eventsFromList
Expand Down Expand Up @@ -47,23 +47,23 @@ module Ouroboros.Network.Testing.Data.Signal
, keyedUntil
) where

import Prelude hiding (scanl, until)
import Prelude hiding (scanl, until)

import Data.Bool (bool)
import qualified Data.Foldable as Deque (toList)
import Data.List (groupBy)
import Data.Maybe (maybeToList)
import Data.OrdPSQ (OrdPSQ)
import qualified Data.OrdPSQ as PSQ
import Data.Set (Set)
import qualified Data.Set as Set
import Deque.Lazy (Deque)
import qualified Deque.Lazy as Deque
import Data.Bool (bool)
import Data.Foldable qualified as Deque (toList)
import Data.List (groupBy)
import Data.Maybe (maybeToList)
import Data.OrdPSQ (OrdPSQ)
import Data.OrdPSQ qualified as PSQ
import Data.Set (Set)
import Data.Set qualified as Set
import Deque.Lazy (Deque)
import Deque.Lazy qualified as Deque

import Control.Monad.Class.MonadTime.SI (DiffTime, Time (..), addTime)
import Control.Monad.Class.MonadTime.SI (DiffTime, Time (..), addTime)


import Test.QuickCheck
import Test.QuickCheck

--
-- Time stamps and events
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{-# LANGUAGE RankNTypes #-}

module Ouroboros.Network.Testing.QuickCheck
module Test.Ouroboros.Network.QuickCheck
( runSimGen
, monadicSim
) where

import Test.QuickCheck
import Test.QuickCheck.Gen.Unsafe (Capture (..), capture)
import Test.QuickCheck.Monadic
import Test.QuickCheck
import Test.QuickCheck.Gen.Unsafe (Capture (..), capture)
import Test.QuickCheck.Monadic

import Control.Monad.IOSim
import Control.Monad.IOSim

-- | 'IOSim' analogue of 'runSTGen'
--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{-# LANGUAGE CPP #-}
module Ouroboros.Network.Testing.Serialise
module Test.Ouroboros.Network.Serialise
( -- * Class
Serialise (..)
, prop_serialise
, prop_serialise_valid
, prop_serialise_roundtrip
) where

import Codec.CBOR.FlatTerm
import Codec.Serialise
import Test.QuickCheck (Property, counterexample, property, (.&&.),
(===))
import Codec.CBOR.FlatTerm
import Codec.Serialise
import Test.QuickCheck (Property, counterexample, property, (.&&.), (===))

-- Class properties
--
Expand Down
Loading

0 comments on commit f978ce6

Please sign in to comment.