From 9c8f093e83bf3cd3f213c6d6d4cf750497807d12 Mon Sep 17 00:00:00 2001 From: Karel Gardas Date: Thu, 22 Mar 2018 16:02:20 +0100 Subject: [PATCH 1/4] fix compilation of testsuite on Ubuntu 16.04 with its GHC 7.10.x compiler --- snap-server.cabal | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/snap-server.cabal b/snap-server.cabal index c1fbc179..7b5c86d8 100644 --- a/snap-server.cabal +++ b/snap-server.cabal @@ -244,7 +244,8 @@ Test-suite testsuite parallel >= 3 && < 4, test-framework >= 0.8.0.3 && < 0.9, test-framework-hunit >= 0.2.7 && < 0.4, - test-framework-quickcheck2 >= 0.2.12.1 && < 0.4 + test-framework-quickcheck2 >= 0.2.12.1 && < 0.4, + Cabal other-extensions: BangPatterns, @@ -495,6 +496,9 @@ Executable snap-test-server System.SendFile, System.SendFile.FreeBSD + if !impl(ghc >= 8.0) + build-depends: semigroups >= 0.16 && < 0.19 + build-depends: attoparsec, base, @@ -516,7 +520,8 @@ Executable snap-test-server time, transformers, unix-compat, - vector + vector, + filepath ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -fno-warn-unused-do-bind -threaded -rtsopts From 9e8f5930225a54f4497c36b8e1ad496a43af99ac Mon Sep 17 00:00:00 2001 From: Karel Gardas Date: Thu, 22 Mar 2018 16:02:53 +0100 Subject: [PATCH 2/4] fix testsuite run script to find the right testsuite binary easily --- runTestsAndCoverage.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runTestsAndCoverage.sh b/runTestsAndCoverage.sh index d3b791dd..874a2576 100755 --- a/runTestsAndCoverage.sh +++ b/runTestsAndCoverage.sh @@ -8,7 +8,8 @@ export LANG=C rm -Rf testsuite.tix # TODO How do we find the executable without knowing the version number in dist-newstyle? -./dist-newstyle/build/snap-server-1.0.0.0/build/testsuite/testsuite -j4 -a1000 $* +TESTSUITE=`find . -type f -perm 775 -name 'testsuite'` +$TESTSUITE -j4 -a1000 $* DIR="./dist-newstyle/hpc" From 141f32f8866056d507c302d1cbfc5c0714882a99 Mon Sep 17 00:00:00 2001 From: Karel Gardas Date: Thu, 22 Mar 2018 16:06:57 +0100 Subject: [PATCH 3/4] fix README.md with information about how to build the testsuite --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index abd2bdac..99087b14 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,10 @@ The docs get put in `dist/doc/html/`. ## Building the testsuite The `snap-server` has a fairly comprehensive test suite. To build and run it, -`cd` into the `test/` directory and run +run - $ cabal configure # for the stock backend, or.. - $ cabal configure -fopenssl # for the SSL backend + $ cabal configure --enable-tests # for the stock backend, or.. + $ cabal configure -fopenssl --enable-tests # for the SSL backend $ cabal build From 0188977677ef79dcee65ac879214084b61a653c2 Mon Sep 17 00:00:00 2001 From: Karel Gardas Date: Tue, 27 Mar 2018 21:50:27 +0200 Subject: [PATCH 4/4] remove unneeded Cabal dependency which were added in previous commit --- snap-server.cabal | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snap-server.cabal b/snap-server.cabal index 7b5c86d8..6e9a4efd 100644 --- a/snap-server.cabal +++ b/snap-server.cabal @@ -244,8 +244,7 @@ Test-suite testsuite parallel >= 3 && < 4, test-framework >= 0.8.0.3 && < 0.9, test-framework-hunit >= 0.2.7 && < 0.4, - test-framework-quickcheck2 >= 0.2.12.1 && < 0.4, - Cabal + test-framework-quickcheck2 >= 0.2.12.1 && < 0.4 other-extensions: BangPatterns,