cardano-cli-8.23.1.0: The Cardano command-line interface
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.CLI.Util

Synopsis

Documentation

assertDirectoryMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m () Source #

Asserts that the given directory is missing.

checkTxCddlFormat Source #

Arguments

∷ (MonadTest m, MonadIO m, HasCallStack) 
FilePath

Reference/golden file

FilePath

Newly created file

→ m () 

checkTextEnvelopeFormat ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ TextEnvelopeTypeFilePathFilePath → m () Source #

Checks that the tvType and tvDescription are equivalent between two files.

equivalence ∷ (MonadTest m, Eq a, Show a, HasCallStack) ⇒ a → a → m () Source #

Check for equivalence between two types and perform a file cleanup on failure.

execCardanoCLI Source #

Arguments

∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) 
⇒ [String]

Arguments to the CLI command

→ m String

Captured stdout

Execute cardano-cli via the command line.

Waits for the process to finish and returns the stdout.

execDetailCardanoCLI Source #

Arguments

∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) 
⇒ [String]

Arguments to the CLI command

→ m (ExitCode, String, String)

Captured stdout

Execute cardano-cli via the command line, expecting it to fail.

Waits for the process to finish and returns the exit code, stdout and stderr.

tryExecCardanoCLI Source #

Arguments

∷ [String]

Arguments to the CLI command

PropertyT IO (Either Failure String)

Captured stdout, or error in case of failures

withSnd ∷ (a → b) → a → (a, b) Source #

Return the supply value with the result of the supplied function as a tuple

noteInputFile ∷ (MonadTest m, HasCallStack) ⇒ FilePath → m FilePath Source #

Return the input file path after annotating it relative to the project root directory

noteTempFile ∷ (MonadTest m, HasCallStack) ⇒ FilePathFilePath → m FilePath Source #

Return the test file path after annotating it relative to the project root directory

redactJsonFieldMonadTest m ⇒ MonadIO m ⇒ HasCallStackTextTextFilePathFilePath → m () Source #

bracketSem Source #

Arguments

MonadBaseControl IO m 
FileSem

a file semaphore

→ (FilePath → m c)

an action, a file path will be extracted from the semaphore

→ m c 

Run action acquiring a semaphore, and releasing afterwards. Guards against concurrent access to a block of code.

data FileSem Source #

A file semaphore protecting against a concurrent path access

Instances

Instances details
Show FileSem Source # 
Instance details

Defined in Test.Cardano.CLI.Util

Pretty FileSem Source # 
Instance details

Defined in Test.Cardano.CLI.Util

Methods

prettyFileSemDoc ann Source #

prettyList ∷ [FileSem] → Doc ann Source #

newFileSem Source #

Arguments

FilePath

path to be guarded by a semaphore allowing only one concurrent to access it

FileSem 

Create new file semaphore. Always use with NOINLINE pragma! Example: createTestnetDataOutSem :: FileSem createTestnetDataOutSem = newFileSem "testcardano-cli-goldenfilesgoldenconway/create-testnet-data.out" {-# NOINLINE createTestnetDataOutSem #-}