Skip to content

Commit

Permalink
Reverse examples/plugin dependency relationship
Browse files Browse the repository at this point in the history
This moves tests that depend on the plugin from concat-examples to
concat-plugin. The one shortcoming, IMO, is that it requries duplicating
the SMT flag.
  • Loading branch information
sellout committed Jan 11, 2022
1 parent 59b8bda commit 62b63fb
Show file tree
Hide file tree
Showing 92 changed files with 121 additions and 119 deletions.
119 changes: 0 additions & 119 deletions examples/concat-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ library
, concat-inline
, concat-known
, concat-classes
, concat-plugin
if flag(smt)
build-depends: z3
cpp-options: -DCONCAT_SMT
Expand Down Expand Up @@ -114,70 +113,6 @@ library
ghc-options: -O2
cpp-options: -DVectorSized

-- Stack apparently only allows per-package flags, not per-component, so the
-- whole library gets recompiled. For now, duplicate the test-suite. See
-- <https://stackoverflow.com/questions/45015821/setting-component-specific-cabal-flag-from-stack-build>

Test-Suite misc-examples
type: exitcode-stdio-1.0
default-language: Haskell98
hs-Source-Dirs: test
main-is: Examples.hs
other-modules: Miscellany
Build-Depends: base<5
, Cabal >= 1.24.0.0
, ghc-prim
, constraints >= 0.8
, newtype-generics >= 0.5.3
, pointed, keys
, distributive, adjunctions
, concat-inline
, concat-classes
, concat-plugin
, concat-examples
, ghc-prim
, integer-gmp
, distributive, adjunctions
, constraints >= 0.8
-- Array/vector experiments
, finite-typelits, vector-sized >= 1.0.0.0
ghc-options: -O2
-fplugin=ConCat.Plugin
if flag(smt)
cpp-options: -DCONCAT_SMT
cpp-options: -DVectorSized

Test-Suite misc-trace
type: exitcode-stdio-1.0
default-language: Haskell98
hs-Source-Dirs: test
main-is: Examples.hs
other-modules: Miscellany
Build-Depends: base<5
, Cabal >= 1.24.0.0
, ghc-prim
, constraints >= 0.8
, newtype-generics >= 0.5.3
, pointed, keys
, distributive, adjunctions
, concat-inline
, concat-classes
, concat-plugin
, concat-examples
, ghc-prim
, integer-gmp
, keys
, distributive, adjunctions
, constraints >= 0.8
-- Array/vector experiments
, finite-typelits, vector-sized
ghc-options: -O2
-fplugin=ConCat.Plugin
-fplugin-opt=ConCat.Plugin:trace
if flag(smt)
cpp-options: -DCONCAT_SMT
cpp-options: -DVectorSized

-- Test-Suite testHasFins
-- type: exitcode-stdio-1.0
-- default-language: Haskell98
Expand All @@ -189,57 +124,3 @@ Test-Suite misc-trace
-- , concat-examples
-- , concat-classes
-- , ghc-typelits-knownnat

Test-Suite gold-tests
type: exitcode-stdio-1.0
default-language: Haskell98
hs-Source-Dirs: test
main-is: GoldTests.hs
other-modules: BasicTests, Miscellany, Utils
Build-Depends: base<5
, Cabal >= 1.24.0.0
, ghc-prim
, constraints >= 0.8
, newtype-generics >= 0.5.3
, pointed, keys
, distributive, adjunctions
, concat-inline
, concat-classes
, concat-plugin
, concat-examples
, ghc-prim
, integer-gmp
, distributive, adjunctions
, constraints >= 0.8
, bytestring
, tasty
, tasty-golden
-- Array/vector experiments
, finite-typelits, vector-sized >= 1.0.0.0
ghc-options: -O2
-fplugin=ConCat.Plugin
-- -fplugin-opt=ConCat.Plugin:showCcc
-- -dppr-debug -dverbose-core2core -dinline-check satisfy -ddump-inlinings
if flag(smt)
cpp-options: -DCONCAT_SMT
cpp-options: -DVectorSized

-- executable ad_rev
-- hs-source-dirs: app
-- main-is: ad_rev.lhs
-- build-depends: base >= 4.7 && < 5
-- , optparse-generic
-- , concat-classes
-- , concat-examples
-- , concat-plugin
-- default-language: Haskell2010
-- ghc-options: -O2
-- -funbox-strict-fields
-- -threaded
-- -optc-ffast-math
-- -optc-O3
-- -- -fplugin=ConCat.Plugin
-- -- -fplugin-opt=ConCat.Plugin:trace
-- -- -fplugin-opt=ConCat.Plugin:maxSteps=200
-- -- -fforce-recomp

121 changes: 121 additions & 0 deletions plugin/concat-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,124 @@ library

-- Do I want to depend on integer-gmp? Maybe conditionally depend on integer-gmp
-- or integer-simple.

-- Stack apparently only allows per-package flags, not per-component, so the
-- whole library gets recompiled. For now, duplicate the test-suite. See
-- <https://stackoverflow.com/questions/45015821/setting-component-specific-cabal-flag-from-stack-build>

Flag smt
Description: Enable SMT
Default: False

Test-Suite misc-examples
type: exitcode-stdio-1.0
default-language: Haskell98
hs-Source-Dirs: test
main-is: Examples.hs
other-modules: Miscellany
Build-Depends: base<5
, Cabal >= 1.24.0.0
, ghc-prim
, constraints >= 0.8
, newtype-generics >= 0.5.3
, pointed, keys
, distributive, adjunctions
, concat-inline
, concat-classes
, concat-plugin
, concat-examples
, ghc-prim
, integer-gmp
, distributive, adjunctions
, constraints >= 0.8
-- Array/vector experiments
, finite-typelits, vector-sized >= 1.0.0.0
ghc-options: -O2
-fplugin=ConCat.Plugin
if flag(smt)
cpp-options: -DCONCAT_SMT
cpp-options: -DVectorSized

Test-Suite misc-trace
type: exitcode-stdio-1.0
default-language: Haskell98
hs-Source-Dirs: test
main-is: Examples.hs
other-modules: Miscellany
Build-Depends: base<5
, Cabal >= 1.24.0.0
, ghc-prim
, constraints >= 0.8
, newtype-generics >= 0.5.3
, pointed, keys
, distributive, adjunctions
, concat-inline
, concat-classes
, concat-plugin
, concat-examples
, ghc-prim
, integer-gmp
, keys
, distributive, adjunctions
, constraints >= 0.8
-- Array/vector experiments
, finite-typelits, vector-sized
ghc-options: -O2
-fplugin=ConCat.Plugin
-fplugin-opt=ConCat.Plugin:trace
if flag(smt)
cpp-options: -DCONCAT_SMT
cpp-options: -DVectorSized

Test-Suite gold-tests
type: exitcode-stdio-1.0
default-language: Haskell98
hs-Source-Dirs: test
main-is: GoldTests.hs
other-modules: BasicTests, Miscellany, Utils
Build-Depends: base<5
, Cabal >= 1.24.0.0
, ghc-prim
, constraints >= 0.8
, newtype-generics >= 0.5.3
, pointed, keys
, distributive, adjunctions
, concat-inline
, concat-classes
, concat-plugin
, concat-examples
, ghc-prim
, integer-gmp
, distributive, adjunctions
, constraints >= 0.8
, bytestring
, tasty
, tasty-golden
-- Array/vector experiments
, finite-typelits, vector-sized >= 1.0.0.0
ghc-options: -O2
-fplugin=ConCat.Plugin
-- -fplugin-opt=ConCat.Plugin:showCcc
-- -dppr-debug -dverbose-core2core -dinline-check satisfy -ddump-inlinings
if flag(smt)
cpp-options: -DCONCAT_SMT
cpp-options: -DVectorSized

-- executable ad_rev
-- hs-source-dirs: app
-- main-is: ad_rev.lhs
-- build-depends: base >= 4.7 && < 5
-- , optparse-generic
-- , concat-classes
-- , concat-examples
-- , concat-plugin
-- default-language: Haskell2010
-- ghc-options: -O2
-- -funbox-strict-fields
-- -threaded
-- -optc-ffast-math
-- -optc-O3
-- -- -fplugin=ConCat.Plugin
-- -- -fplugin-opt=ConCat.Plugin:trace
-- -- -fplugin-opt=ConCat.Plugin:maxSteps=200
-- -- -fforce-recomp
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 62b63fb

Please sign in to comment.