-
Notifications
You must be signed in to change notification settings - Fork 719
Add flag to disable Cabal package tests that use shared libraries #3146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module PackageTests.Tests(tests) where | ||
module PackageTests.Tests(sharedLibTests, nonSharedLibTests) where | ||
|
||
import PackageTests.PackageTester | ||
|
||
|
@@ -11,12 +11,14 @@ import Control.Monad | |
|
||
import Data.Version | ||
import Test.Tasty (TestTree, testGroup, mkTimeout, localOption) | ||
import Test.Tasty.HUnit (testCase) | ||
import qualified Test.Tasty.HUnit as HUnit | ||
|
||
-- | Tests that do not require shared libraries. | ||
|
||
-- TODO: turn this into a "test-defining writer monad". | ||
-- This will let us handle scoping gracefully. | ||
tests :: SuiteConfig -> [TestTree] | ||
tests config = | ||
nonSharedLibTests :: SuiteConfig -> [TestTree] | ||
nonSharedLibTests config = | ||
tail [ undefined | ||
|
||
--------------------------------------------------------------------- | ||
|
@@ -38,15 +40,15 @@ tests config = | |
|
||
-- Test exitcode-stdio-1.0 test suites (and HPC) | ||
[ testGroup "ExeV10" | ||
(PackageTests.TestSuiteTests.ExeV10.Check.tests config) | ||
(PackageTests.TestSuiteTests.ExeV10.Check.nonSharedLibTests config) | ||
|
||
-- Test detailed-0.9 test suites | ||
, testGroup "LibV09" $ | ||
let | ||
tcs :: FilePath -> TestM a -> TestTree | ||
tcs name m | ||
= testCase name (runTestM config ("TestSuiteTests/LibV09") | ||
(Just name) m) | ||
= HUnit.testCase name (runTestM config ("TestSuiteTests/LibV09") | ||
(Just name) m) | ||
in -- Test if detailed-0.9 builds correctly | ||
[ tcs "Build" $ cabal_build ["--enable-tests"] | ||
|
||
|
@@ -155,10 +157,6 @@ tests config = | |
-- (Cabal has to build the non-profiled version first) | ||
, tc "TemplateHaskell/profiling" $ cabal_build ["--enable-library-profiling", "--enable-profiling"] | ||
|
||
-- Test building a dynamic library/executable which uses Template | ||
-- Haskell | ||
, tc "TemplateHaskell/dynamic" $ cabal_build ["--enable-shared", "--enable-executable-dynamic"] | ||
|
||
-- Test building an executable whose main() function is defined in a C | ||
-- file | ||
, tc "CMain" $ cabal_build [] | ||
|
@@ -244,5 +242,28 @@ tests config = | |
(concat $ lines (resultOutput r)) | ||
|
||
tc :: FilePath -> TestM a -> TestTree | ||
tc name m | ||
= testCase name (runTestM config name Nothing m) | ||
tc = testCase config | ||
|
||
-- | Tests that require shared libraries. | ||
sharedLibTests :: SuiteConfig -> [TestTree] | ||
sharedLibTests config = | ||
tail [ undefined | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the purpose of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I see, it's to make rearranging test cases easier (you don't need to delete commas). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I copied the pattern from the top of the file. I meant to ask if I understood it correctly but forgot. |
||
|
||
, testGroup "TestSuiteTests" | ||
|
||
-- Test exitcode-stdio-1.0 test suites (and HPC) using | ||
-- --enable-executable-dynamic and --enable-shared | ||
[ testGroup "ExeV10" | ||
(PackageTests.TestSuiteTests.ExeV10.Check.sharedLibTests config) | ||
] | ||
|
||
-- Test building a dynamic library/executable which uses Template | ||
-- Haskell | ||
, testCase config "TemplateHaskell/dynamic" $ | ||
cabal_build ["--enable-shared", "--enable-executable-dynamic"] | ||
|
||
] | ||
|
||
testCase :: SuiteConfig -> FilePath -> TestM a -> TestTree | ||
testCase config name m | ||
= HUnit.testCase name (runTestM config name Nothing m) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ build_script: | |
- Setup configure --user --ghc-option=-Werror --enable-tests | ||
- Setup build | ||
- Setup test unit-tests --show-details=streaming | ||
# - Setup test package-tests --show-details=streaming --test-options=--skip-shared-library-tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intentional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added it because I thought we could run the package tests soon. The only failure is #3147. |
||
- Setup install | ||
- cd ..\cabal-install | ||
- ghc --make -threaded -i -i. Setup.hs -Wall -Werror | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, this broke the build on GHC <= 7.6. I changed this line to import
Data.Proxy
instead and added a dependency ontagged
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I was just looking into that.