Skip to content

Commit 677070a

Browse files
authored
Merge pull request #2479 from GaloisInc/rgs/sort-tests
`crux-mir-comp`: perform tests in alphabetical order by test directory/filename
2 parents 8707f15 + fe90246 commit 677070a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crux-mir-comp/test/Test.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import qualified Data.ByteString as BS
99
import qualified Data.ByteString.Char8 as BSC
1010
import qualified Data.ByteString.UTF8 as BS8
1111
import Data.Char (isSpace)
12-
import Data.List (dropWhileEnd, isPrefixOf)
12+
import Data.List (dropWhileEnd, isPrefixOf, sort)
1313
import Data.Maybe (catMaybes)
1414
import System.Directory (listDirectory, doesDirectoryExist, doesFileExist, removeFile)
1515
import System.Exit (ExitCode(..))
@@ -301,6 +301,9 @@ testDir oracleTest dir = do
301301
False -> return Nothing
302302
True -> Just <$> testDir oracleTest (dir </> f)
303303
exists <- doesDirectoryExist dir
304-
fs <- if exists then listDirectory dir else return []
304+
-- This `sort` is not technically necessary, it just ensures that test cases
305+
-- will be performed in a stable ordering, since `listDirectory` doesn't
306+
-- guarantee such an ordering.
307+
fs <- if exists then sort <$> listDirectory dir else return []
305308
tcs <- mapM gen fs
306309
return (testGroup (takeBaseName dir) (catMaybes tcs))

0 commit comments

Comments
 (0)