Skip to content

Commit

Permalink
move cli-integration tests to their own package
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani committed Mar 25, 2024
1 parent b8b02e9 commit eca3d94
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 80 deletions.
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ packages:
- lib/unison-util-rope
- parser-typechecker
- unison-cli
- unison-cli-integration
- unison-cli-main
- unison-core
- unison-hashing-v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import System.Process (readProcessWithExitCode)
import Text.Printf

integrationTestsDir :: FilePath
integrationTestsDir = "unison-cli-main" </> "integration-tests" </> "IntegrationTests"
integrationTestsDir = "unison-cli-integration" </> "integration-tests" </> "IntegrationTests"

uFile :: FilePath
uFile = integrationTestsDir </> "print.u"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ main = do

```ucm
.> add
.> compile main ./unison-cli-main/integration-tests/IntegrationTests/main
.> compile main ./unison-cli-integration/integration-tests/IntegrationTests/main
```
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ main = do
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
structural ability Break
type MyBool
main : '{IO, Exception} ()
Expand All @@ -47,12 +47,12 @@ main = do
.> add
⍟ I've added these definitions:
structural ability Break
type MyBool
main : '{IO, Exception} ()
resume : Request {g, Break} x -> x
.> compile main ./unison-cli-main/integration-tests/IntegrationTests/main
.> compile main ./unison-cli-integration/integration-tests/IntegrationTests/main
```
File renamed without changes.
68 changes: 68 additions & 0 deletions unison-cli-integration/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: unison-cli-integration
github: unisonweb/unison
copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors

flags:
optimized:
manual: true
default: false

ghc-options: -Wall

executables:
cli-integration-tests:
when:
- condition: false
other-modules: Paths_unison_cli_integration
source-dirs: integration-tests
main: Suite.hs
ghc-options: -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
dependencies:
- base
- code-page
- filepath
- directory
- easytest
- process
- shellmet
- time
build-tools:
- unison-cli-main:unison

when:
- condition: flag(optimized)
ghc-options: -O2 -funbox-strict-fields

default-extensions:
- ApplicativeDo
- BangPatterns
- BlockArguments
- DeriveAnyClass
- DeriveFunctor
- DeriveFoldable
- DeriveTraversable
- DeriveGeneric
- DerivingStrategies
- DerivingVia
- DoAndIfThenElse
- DuplicateRecordFields
- FlexibleContexts
- FlexibleInstances
- GADTs
- GeneralizedNewtypeDeriving
- ImportQualifiedPost
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- NumericUnderscores
- OverloadedLabels
- OverloadedStrings
- PatternSynonyms
- RankNTypes
- ScopedTypeVariables
- TupleSections
- TypeApplications
- ViewPatterns
75 changes: 75 additions & 0 deletions unison-cli-integration/unison-cli-integration.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.35.2.
--
-- see: https://github.com/sol/hpack

name: unison-cli-integration
version: 0.0.0
homepage: https://github.com/unisonweb/unison#readme
bug-reports: https://github.com/unisonweb/unison/issues
copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors
build-type: Simple

source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: False

executable cli-integration-tests
main-is: Suite.hs
other-modules:
IntegrationTests.ArgumentParsing
hs-source-dirs:
integration-tests
default-extensions:
ApplicativeDo
BangPatterns
BlockArguments
DeriveAnyClass
DeriveFunctor
DeriveFoldable
DeriveTraversable
DeriveGeneric
DerivingStrategies
DerivingVia
DoAndIfThenElse
DuplicateRecordFields
FlexibleContexts
FlexibleInstances
GADTs
GeneralizedNewtypeDeriving
ImportQualifiedPost
InstanceSigs
KindSignatures
LambdaCase
MultiParamTypeClasses
MultiWayIf
NamedFieldPuns
NumericUnderscores
OverloadedLabels
OverloadedStrings
PatternSynonyms
RankNTypes
ScopedTypeVariables
TupleSections
TypeApplications
ViewPatterns
ghc-options: -Wall -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-tool-depends:
unison-cli-main:unison
build-depends:
base
, code-page
, directory
, easytest
, filepath
, process
, shellmet
, time
default-language: Haskell2010
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
19 changes: 0 additions & 19 deletions unison-cli-main/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@ executables:
- text
- unison-cli

cli-integration-tests:
when:
- condition: false
other-modules: Paths_unison_cli_main
source-dirs: integration-tests
main: Suite.hs
ghc-options: -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
dependencies:
- base
- code-page
- filepath
- directory
- easytest
- process
- shellmet
- time
build-tools:
- unison-cli-main:unison

when:
- condition: flag(optimized)
ghc-options: -O2 -funbox-strict-fields
Expand Down
55 changes: 0 additions & 55 deletions unison-cli-main/unison-cli-main.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,61 +21,6 @@ flag optimized
manual: True
default: False

executable cli-integration-tests
main-is: Suite.hs
other-modules:
IntegrationTests.ArgumentParsing
hs-source-dirs:
integration-tests
default-extensions:
ApplicativeDo
BangPatterns
BlockArguments
DeriveAnyClass
DeriveFunctor
DeriveFoldable
DeriveTraversable
DeriveGeneric
DerivingStrategies
DerivingVia
DoAndIfThenElse
DuplicateRecordFields
FlexibleContexts
FlexibleInstances
GADTs
GeneralizedNewtypeDeriving
ImportQualifiedPost
InstanceSigs
KindSignatures
LambdaCase
MultiParamTypeClasses
MultiWayIf
NamedFieldPuns
NumericUnderscores
OverloadedLabels
OverloadedStrings
PatternSynonyms
RankNTypes
ScopedTypeVariables
TupleSections
TypeApplications
ViewPatterns
ghc-options: -Wall -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-tools:
unison
build-depends:
base
, code-page
, directory
, easytest
, filepath
, process
, shellmet
, time
default-language: Haskell2010
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields

executable unison
main-is: Main.hs
other-modules:
Expand Down

0 comments on commit eca3d94

Please sign in to comment.