Skip to content

Commit

Permalink
Fix #6230 Reorganise repository folders
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Sep 7, 2023
1 parent 52849b6 commit d5bd155
Show file tree
Hide file tree
Showing 663 changed files with 201 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
run: |
set -ex
hlint src/
hlint --hint=.hlint-test.yaml test/
hlint --hint=.hlint-test.yaml tests/unit
3 changes: 3 additions & 0 deletions .hlint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
- name:
- NoImplicitPrelude
- CPP
- OverloadedLists
- OverloadedStrings
- QuasiQuotes
- RecordWildCards
- ScopedTypeVariables
- TemplateHaskell
- ViewPatterns
26 changes: 15 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,14 @@ That said, the following may help:

## Testing

The Stack code has both unit tests and integration tests. Integration tests can
be found in the
[test/integration](https://github.com/commercialhaskell/stack/tree/master/test/integration)
folder and unit tests, in the
[src/test](https://github.com/commercialhaskell/stack/tree/master/src/test)
folder. Tests are written using the [Hspec](https://hspec.github.io/) framework.
In order to run the full test suite, you can simply command:
The Stack code has both unit tests and integration tests.

### Working with Unit Tests

Unit tests can be found in the
[tests/unit](https://github.com/commercialhaskell/stack/tree/master/tests/unit)
directory. Tests are written using the [Hspec](https://hspec.github.io/)
framework. In order to run the full test suite, you can simply command:

~~~text
stack test
Expand All @@ -411,26 +412,25 @@ need to specify which test suite (unit test or integration) and pass arguments
to specify which module you'd specifically like to run to get quick feedback. A
description of this follows below.

### Working with Unit Tests

If you would like to run the unit tests on their own, you can command:

~~~text
stack test stack:stack-test
stack test stack:stack-unit-test
~~~

Running an individual module works with a command like this:

~~~text
stack test stack:stack-test --ta "-m <PATTERN>"
stack test stack:stack-unit-test --ta "-m <PATTERN>"
~~~

Where `<PATTERN>` is the name of the module without `Spec.hs`.

You may also load tests into GHCi and run them with these command:

~~~text
stack ghci stack:stack-test --only-main
stack ghci stack:stack-unit-test --only-main
# GHCi starting up output ...
> :main -m "<PATTERN>"
~~~
Expand All @@ -439,6 +439,10 @@ Where again, `<PATTERN>` is the name of the module without `Spec.hs`.

### Working with Integration Tests

Integration tests can be found in the
[tests/integration](https://github.com/commercialhaskell/stack/tree/master/tests/integration)
folder.

Running the integration tests is a little involved, you'll need to command:

~~~text
Expand Down
2 changes: 1 addition & 1 deletion doc/ide_command.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ and the output from the second command is:
stack:lib
stack:exe:stack
stack:exe:stack-integration-test
stack:test:stack-test
stack:test:stack-unit-test
~~~

or command:
Expand Down
24 changes: 12 additions & 12 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ extra-source-files:
- stack.yaml
- doc/*.md
- src/setup-shim/StackSetupShim.hs
- test/package-dump/ghc-7.10.txt
- test/package-dump/ghc-7.8.4-osx.txt
- test/package-dump/ghc-7.8.txt
- test/package-dump/ghc-head.txt
- src/test/Stack/Untar/test1.tar.gz
- src/test/Stack/Untar/test2.tar.gz
- tests/unit/package-dump/ghc-7.10.txt
- tests/unit/package-dump/ghc-7.8.4-osx.txt
- tests/unit/package-dump/ghc-7.8.txt
- tests/unit/package-dump/ghc-head.txt
- tests/unit/Stack/Untar/test1.tar.gz
- tests/unit/Stack/Untar/test2.tar.gz
# Support for people who prefer, or need, to build Stack with Cabal (the tool):
- cabal.project
- cabal.config
Expand Down Expand Up @@ -355,8 +355,8 @@ executables:
stack-integration-test:
main: IntegrationSpec.hs
source-dirs:
- test/integration
- test/integration/lib
- tests/integration
- tests/integration/lib
ghc-options:
- -threaded
- -rtsopts
Expand All @@ -373,15 +373,15 @@ executables:
- -static
- -pthread
tests:
stack-test:
stack-unit-test:
main: Spec.hs
source-dirs: src/test
source-dirs: tests/unit
when:
- condition: 'os(windows)'
then:
source-dirs: src/test/windows/
source-dirs: tests/unit/windows/
else:
source-dirs: src/test/unix/
source-dirs: tests/unit/unix/
ghc-options:
- -threaded
dependencies:
Expand Down
24 changes: 12 additions & 12 deletions stack.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ extra-source-files:
doc/upload_command.md
doc/yaml_configuration.md
src/setup-shim/StackSetupShim.hs
test/package-dump/ghc-7.10.txt
test/package-dump/ghc-7.8.4-osx.txt
test/package-dump/ghc-7.8.txt
test/package-dump/ghc-head.txt
src/test/Stack/Untar/test1.tar.gz
src/test/Stack/Untar/test2.tar.gz
tests/unit/package-dump/ghc-7.10.txt
tests/unit/package-dump/ghc-7.8.4-osx.txt
tests/unit/package-dump/ghc-7.8.txt
tests/unit/package-dump/ghc-head.txt
tests/unit/Stack/Untar/test1.tar.gz
tests/unit/Stack/Untar/test2.tar.gz
cabal.project
cabal.config

Expand Down Expand Up @@ -539,8 +539,8 @@ executable stack-integration-test
autogen-modules:
Paths_stack
hs-source-dirs:
test/integration
test/integration/lib
tests/integration
tests/integration/lib
ghc-options: -fwrite-ide-info -hiedir=.hie -Wall -Wmissing-export-lists -optP-Wno-nonportable-include-path -threaded -rtsopts -with-rtsopts=-N
build-depends:
Cabal >=3.8.1.0
Expand Down Expand Up @@ -630,7 +630,7 @@ executable stack-integration-test
if flag(static)
ld-options: -static -pthread

test-suite stack-test
test-suite stack-unit-test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Expand All @@ -651,7 +651,7 @@ test-suite stack-test
autogen-modules:
Paths_stack
hs-source-dirs:
src/test
tests/unit
ghc-options: -fwrite-ide-info -hiedir=.hie -Wall -Wmissing-export-lists -optP-Wno-nonportable-include-path -threaded
build-depends:
Cabal >=3.8.1.0
Expand Down Expand Up @@ -742,11 +742,11 @@ test-suite stack-test
other-modules:
Stack.Ghci.FakePaths
hs-source-dirs:
src/test/windows/
tests/unit/windows/
else
other-modules:
Stack.Ghci.FakePaths
hs-source-dirs:
src/test/unix/
tests/unit/unix/
build-tool-depends:
hspec-discover:hspec-discover
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ runApp options inner = do
simpleApp <- ask
runghc <- findExecutable "runghc" >>= either throwIO pure
srcDir <- canonicalizePath ""
testsRoot <- canonicalizePath $ srcDir </> "test/integration"
testsRoot <- canonicalizePath $ srcDir </> "tests/integration"
libdir <- canonicalizePath $ testsRoot </> "lib"
myPath <- liftIO getExecutablePath

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files

packages:
- completed:
hackage: acme-dont-1.1@sha256:8264ad3e5113d3e0417b46e71d5a9c0914a1f03b5b81319cc329f1dc0f49b96c,602
pantry-tree:
sha256: 79dbeddaf0fd507611687cefe9511c8fda489849fb0cac3894925716936290b2
size: 206
original:
hackage: acme-dont-1.1@rev:0
snapshots: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files

packages:
- completed:
hackage: acme-dont-1.1@sha256:8264ad3e5113d3e0417b46e71d5a9c0914a1f03b5b81319cc329f1dc0f49b96c,602
pantry-tree:
sha256: 79dbeddaf0fd507611687cefe9511c8fda489849fb0cac3894925716936290b2
size: 206
original:
hackage: acme-dont-1.1@rev:0
snapshots: []
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files

packages: []
snapshots:
- completed:
sha256: bfafe5735ccb74527d754b1f9999ded72d7c3a6c3a88529449661431ccfbd6cc
size: 649327
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/8.yaml
original: lts-20.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files

packages:
- completed:
hackage: stm-2.4.4.1@sha256:49cfd80cba95f84d42eda0045346c8a567df5ce434d4da3d26ac3e977826fc4f,1563
pantry-tree:
sha256: 54c488c9302afdfdfd22c639764e057bbf38d44b5e2007e4809d54a56c15b653
size: 898
original:
hackage: stm-2.4.4.1
- completed:
hackage: mtl-2.2.1@sha256:0f7c5e9e2bfa8c1102d38cd57b258b2cf519f3aae65451c8f3fccb472cb8e3c1,1801
pantry-tree:
sha256: b780d0c8065f6f449cd5eca75e5faec1e3d5c28a6b8beb2f3e7ba57cceec43c4
size: 1657
original:
hackage: mtl-2.2.1
snapshots: []
File renamed without changes.
Loading

0 comments on commit d5bd155

Please sign in to comment.