From e4b29132f6113e0c75f0346fe171635d5aeaa044 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 22 Sep 2022 14:38:05 +0200 Subject: chore: work around cabal-install 3.8.1.0 picking the wrong Main.hs See https://github.com/haskell/cabal/issues/8458 for details. Basically, cabal-install 3.8.1.0 sorts source-dirs and then picks the first matching module from that list whereas it'd respect the order in the source file before. This caused it to pick up server/Main.hs over test/Main.hs when building the test suite, failing the build. --- spacecookie.cabal | 2 +- test/EntryPoint.hs | 20 ++++++++++++++++++++ test/Main.hs | 20 -------------------- 3 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 test/EntryPoint.hs delete mode 100644 test/Main.hs diff --git a/spacecookie.cabal b/spacecookie.cabal index e6379d0..05e4b5f 100644 --- a/spacecookie.cabal +++ b/spacecookie.cabal @@ -79,7 +79,7 @@ library test-suite test import: common-settings type: exitcode-stdio-1.0 - main-is: Main.hs + main-is: EntryPoint.hs hs-source-dirs: test, server other-modules: Test.FileTypeDetection , Test.Gophermap diff --git a/test/EntryPoint.hs b/test/EntryPoint.hs new file mode 100644 index 0000000..68931cd --- /dev/null +++ b/test/EntryPoint.hs @@ -0,0 +1,20 @@ +module Main where + +import Test.Tasty + +-- library tests +import Test.Gophermap + +-- server executable tests +import Test.FileTypeDetection +import Test.Integration + +main :: IO () +main = defaultMain tests + +tests :: TestTree +tests = testGroup "tests" + [ gophermapTests + , fileTypeDetectionTests + , integrationTests + ] diff --git a/test/Main.hs b/test/Main.hs deleted file mode 100644 index 68931cd..0000000 --- a/test/Main.hs +++ /dev/null @@ -1,20 +0,0 @@ -module Main where - -import Test.Tasty - --- library tests -import Test.Gophermap - --- server executable tests -import Test.FileTypeDetection -import Test.Integration - -main :: IO () -main = defaultMain tests - -tests :: TestTree -tests = testGroup "tests" - [ gophermapTests - , fileTypeDetectionTests - , integrationTests - ] -- cgit 1.4.1