summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs5
-rw-r--r--src/Parser.hs7
-rw-r--r--src/Test.hs1
3 files changed, 12 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 2c16a16..d4134bd 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -190,6 +190,11 @@ runTest tool test = do
p <- getProcess net pname
expect p regex
+ Wait -> do
+ putStr "Waiting..."
+ hFlush stdout
+ void $ getLine
+
exitNetwork net
main :: IO ()
diff --git a/src/Parser.hs b/src/Parser.hs
index 97a64fc..d4c5a13 100644
--- a/src/Parser.hs
+++ b/src/Parser.hs
@@ -110,9 +110,14 @@ testExpect = do
pname <- procName
return $ Expect pname re
+testWait :: TestParser TestStep
+testWait = do
+ wsymbol "wait"
+ return $ Wait
+
parseTestDefinition :: TestParser Test
parseTestDefinition = label "test definition" $ toplevel $ do
- block (\name steps -> return $ Test name steps) header (testSpawn <|> testSend <|> testExpect)
+ block (\name steps -> return $ Test name steps) header (testSpawn <|> testSend <|> testExpect <|> testWait)
where header = do
wsymbol "test"
lexeme $ TL.toStrict <$> takeWhileP (Just "test name") (/=':')
diff --git a/src/Test.hs b/src/Test.hs
index f26e67a..8136afb 100644
--- a/src/Test.hs
+++ b/src/Test.hs
@@ -19,6 +19,7 @@ data Test = Test
data TestStep = Spawn ProcName NodeName
| Send ProcName Text
| Expect ProcName Regex
+ | Wait
newtype ProcName = ProcName Text
deriving (Eq, Ord)