Skip to content

Commit

Permalink
Sort cabal check output so that tests are less platform-sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
quasicomputational committed Jun 10, 2018
1 parent da18670 commit a9b819e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Cabal/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ data PackageCheck =
-- quite legitimately refuse to publicly distribute packages with these
-- problems.
| PackageDistInexcusable { explanation :: String }
deriving (Eq)
deriving (Eq, Ord)

instance Show PackageCheck where
show notice = explanation notice
Expand Down Expand Up @@ -1844,7 +1844,10 @@ checkPackageFiles :: PackageDescription -> FilePath -> NoCallStackIO [PackageChe
checkPackageFiles pkg root = do
contentChecks <- checkPackageContent checkFilesIO pkg
missingFileChecks <- checkPackageMissingFiles pkg root
return (contentChecks ++ missingFileChecks)
-- Sort because different platforms will provide files from
-- `getDirectoryContents` in different orders, and we'd like to be
-- stable for test output.
return (sort contentChecks ++ sort missingFileChecks)
where
checkFilesIO = CheckPackageContentOps {
doesFileExist = System.doesFileExist . relative,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: In 'data-files': the pattern 'data/*.dat' does not match the file 'data/foo.bar.dat' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 3.0' or higher.
Warning: In 'extra-doc-files': the pattern 'doc/*.html' does not match the file 'doc/foo.en.html' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 3.0' or higher.
Warning: In 'extra-doc-files': the pattern 'doc/*.html' does not match the file 'doc/foo.fr.html' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 3.0' or higher.
Warning: In 'data-files': the pattern 'data/*.dat' does not match the file 'data/foo.bar.dat' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 3.0' or higher.

0 comments on commit a9b819e

Please sign in to comment.