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 #62 from timjb/repeat-tests
Add --repeat flag for running each test multiple times
- Loading branch information
Showing
7 changed files
with
72 additions
and
13 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
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,23 @@ | ||
{-# OPTIONS_GHC -F -pgmF ./scripts/local-htfpp #-} | ||
module Repeat (repeatMain) where | ||
|
||
import Test.Framework | ||
|
||
import Data.IORef | ||
import System.IO.Unsafe | ||
|
||
globalBool :: IORef Bool | ||
globalBool = unsafePerformIO (newIORef True) | ||
{-# NOINLINE globalBool #-} | ||
|
||
readGlobalBool :: IO Bool | ||
readGlobalBool = | ||
do b <- readIORef globalBool | ||
writeIORef globalBool False | ||
return b | ||
|
||
test_globalMVarIsTrue = | ||
do b <- readGlobalBool | ||
assertEqual b True | ||
|
||
repeatMain args = htfMainWithArgs args htf_thisModulesTests |
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,13 @@ | ||
#!/bin/bash | ||
|
||
source $(dirname $0)/lib | ||
|
||
rm -f .HTF/TestHTF.history | ||
|
||
run_test Repeat.hs --repeat 1 | ||
check_success | ||
check_counts 1 1 0 0 0 0 0 | ||
|
||
run_test Repeat.hs --repeat 2 | ||
check_fail | ||
check_counts 1 0 0 1 0 0 0 |