Skip to content
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

Split test and bench out to separate packages #43

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- package.yaml
- stack.yaml
- stack.yaml.lock
- "src/**/*.hs"
- "test/**/*.hs"
- "bitcoin/**/*.hs"
- "bitcoin-test/**/*.hs"
- ".github/workflows/build.yaml"
types:
- synchronize
Expand All @@ -27,14 +27,13 @@ on:
- package.yaml
- stack.yaml
- stack.yaml.lock
- "src/**/*.hs"
- "test/**/*.hs"
- "bitcoin/**/*.hs"
- "bitcoin-test/**/*.hs"
- ".github/workflows/build.yaml"
workflow_dispatch:
inputs: {}

jobs:

build:
strategy:
fail-fast: false
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ on:
paths:
- stack.yaml
- .hlint.yaml
- "src/**/*.hs"
- "test/**/*.hs"
- "bitcoin/**/*.hs"
- "bitcoin-test/**/*.hs"
- "bitcoin-bench/**/*.hs"
- ".github/workflows/hlint.yaml"
types:
- synchronize
Expand All @@ -26,8 +27,8 @@ on:
paths:
- stack.yaml
- .hlint.yaml
- "src/**/*.hs"
- "test/**/*.hs"
- "bitcoin/**/*.hs"
- "bitcoin-test/**/*.hs"
- ".github/workflows/hlint.yaml"
workflow_dispatch:
inputs: {}
Expand All @@ -39,14 +40,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: 'Set up HLint'
- name: "Set up HLint"
uses: haskell/actions/hlint-setup@v2
with:
version: '3.5'
version: "3.5"

- name: 'Run HLint'
- name: "Run HLint"
uses: haskell/actions/hlint-run@v2
with:
# For some reason this has to be a string containing JSON rather than a YAML sequence
path: '[ "src/", "test/"]'
path: '[ "bitcoin/", "bitcoin-test/", "bitcoin-bench/" ]'
fail-on: warning
File renamed without changes.
47 changes: 47 additions & 0 deletions bitcoin-bench/bitcoin-bench.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
cabal-version: 1.12

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

name: bitcoin-bench
version: 0.1.0
synopsis: Bitcoin benchmark library for Haskell
description: Please see the README on GitHub at <https://github.com/haskell-bitcoin/bitcoin#readme>
category: Bitcoin, Finance, Network
homepage: http://github.com/haskell-bitcoin/bitcoin#readme
bug-reports: http://github.com/haskell-bitcoin/bitcoin/issues
author: Philippe Laprade,
Jean-Pierre Rupp,
Matthew Wraith,
Keagan McClelland
maintainer: keagan.mcclelland@gmail.com
license: BSD3
build-type: Simple
extra-source-files:
./data/block-758000.dat
./data/block-758100.dat
./data/block-758200.dat
./data/block-758300.dat
./data/tx-A.dat
./data/tx-B.dat
./data/tx-C.dat

source-repository head
type: git
location: git://github.com/haskell-bitcoin/bitcoin.git

benchmark benchmark
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules:
Paths_bitcoin_bench
build-depends:
base >=4.9 && <5
, binary >=0.8.8
, bitcoin
, bytestring >=0.10.10.0
, criterion >=1.5 && <1.7
, deepseq >=1.4.4.0
, text >=1.2.3.0
default-language: Haskell2010
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.
28 changes: 28 additions & 0 deletions bitcoin-bench/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: bitcoin-bench
version: 0.1.0
synopsis: Bitcoin benchmark library for Haskell
description: Please see the README on GitHub at <https://github.com/haskell-bitcoin/bitcoin#readme>
category: Bitcoin, Finance, Network
author:
- Philippe Laprade
- Jean-Pierre Rupp
- Matthew Wraith
- Keagan McClelland
maintainer: keagan.mcclelland@gmail.com
license: BSD3
homepage: http://github.com/haskell-bitcoin/bitcoin#readme
git: git://github.com/haskell-bitcoin/bitcoin.git
bug-reports: http://github.com/haskell-bitcoin/bitcoin/issues
extra-source-files:
- ./data/*.dat # raw data for benchmarks
benchmarks:
benchmark:
main: Main.hs
dependencies:
- bitcoin
- criterion >=1.5 && <1.7
- base >=4.9 && <5
- binary >= 0.8.8
- bytestring >= 0.10.10.0
- deepseq >= 1.4.4.0
- text >= 1.2.3.0
118 changes: 118 additions & 0 deletions bitcoin-test/bitcoin-test.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
cabal-version: 1.12

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

name: bitcoin-test
version: 0.1.0
synopsis: Bitcoin test library for Haskell
description: Please see the README on GitHub at <https://github.com/haskell-bitcoin/bitcoin#readme>
category: Bitcoin, Finance, Network
homepage: http://github.com/haskell-bitcoin/bitcoin#readme
bug-reports: http://github.com/haskell-bitcoin/bitcoin/issues
author: Philippe Laprade,
Jean-Pierre Rupp,
Matthew Wraith,
Keagan McClelland
maintainer: keagan.mcclelland@gmail.com
license: BSD3
build-type: Simple
extra-source-files:
./data/bip341.json
./data/complex_psbt.json
./data/forkid_script_tests.json
./data/forkid_sighash.json
./data/key_io_invalid.json
./data/key_io_valid.json
./data/rfc6979abc.json
./data/rfc6979core.json
./data/rfc6979DERabc.json
./data/rfc6979DERcore.json
./data/script_tests.json
./data/sig_nonstrict.json
./data/sig_strict.json
./data/sighash.json

source-repository head
type: git
location: git://github.com/haskell-bitcoin/bitcoin.git

library
exposed-modules:
Bitcoin.Address.Bech32Spec
Bitcoin.AddressSpec
Bitcoin.BlockSpec
Bitcoin.Crypto.HashSpec
Bitcoin.Crypto.SignatureSpec
Bitcoin.Keys.ExtendedSpec
Bitcoin.Keys.MnemonicSpec
Bitcoin.KeysSpec
Bitcoin.NetworkSpec
Bitcoin.Orphans
Bitcoin.ScriptSpec
Bitcoin.Transaction.PartialSpec
Bitcoin.Transaction.TaprootSpec
Bitcoin.TransactionSpec
Bitcoin.Util.Arbitrary
Bitcoin.Util.Arbitrary.Address
Bitcoin.Util.Arbitrary.Block
Bitcoin.Util.Arbitrary.Crypto
Bitcoin.Util.Arbitrary.Keys
Bitcoin.Util.Arbitrary.Message
Bitcoin.Util.Arbitrary.Network
Bitcoin.Util.Arbitrary.Script
Bitcoin.Util.Arbitrary.Transaction
Bitcoin.Util.Arbitrary.Util
Bitcoin.UtilSpec
hs-source-dirs:
lib
build-depends:
HUnit >=1.6.0.0
, QuickCheck >=2.13.2
, aeson >=1.4.6.0
, base >=4.9 && <5
, base64 ==0.4.*
, binary >=0.8.8
, bitcoin
, bytestring >=0.10.10.0
, containers >=0.6.2.1
, hspec >=2.7.1
, memory >=0.15.0
, scientific >=0.3.6.2
, secp256k1-haskell >=0.4.0
, string-conversions >=0.4.0.1
, text >=1.2.3.0
, time >=1.9.3
, transformers >=0.5.6.2
, unordered-containers >=0.2.10.0
default-language: Haskell2010

test-suite spec
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Paths_bitcoin_test
hs-source-dirs:
exec
build-depends:
HUnit >=1.6.0.0
, QuickCheck >=2.13.2
, aeson >=1.4.6.0
, base >=4.9 && <5
, base64 ==0.4.*
, binary >=0.8.8
, bitcoin
, bitcoin-test
, bytestring >=0.10.10.0
, containers >=0.6.2.1
, hspec >=2.7.1
, memory >=0.15.0
, scientific >=0.3.6.2
, secp256k1-haskell >=0.4.0
, string-conversions >=0.4.0.1
, text >=1.2.3.0
, time >=1.9.3
, transformers >=0.5.6.2
, unordered-containers >=0.2.10.0
default-language: Haskell2010
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.
47 changes: 47 additions & 0 deletions bitcoin-test/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: bitcoin-test
version: 0.1.0
synopsis: Bitcoin test library for Haskell
description: Please see the README on GitHub at <https://github.com/haskell-bitcoin/bitcoin#readme>
category: Bitcoin, Finance, Network
author:
- Philippe Laprade
- Jean-Pierre Rupp
- Matthew Wraith
- Keagan McClelland
maintainer: keagan.mcclelland@gmail.com
license: BSD3
homepage: http://github.com/haskell-bitcoin/bitcoin#readme
git: git://github.com/haskell-bitcoin/bitcoin.git
bug-reports: http://github.com/haskell-bitcoin/bitcoin/issues
extra-source-files:
- ./data/*.json # raw data for tests
dependencies:
- bitcoin
GambolingPangolin marked this conversation as resolved.
Show resolved Hide resolved
- aeson >= 1.4.6.0
- base >=4.9 && <5
- base64 ^>= 0.4
- binary >= 0.8.8
- bytestring >= 0.10.10.0
- containers >= 0.6.2.1
- hspec >= 2.7.1
- memory >= 0.15.0
- scientific >= 0.3.6.2
- secp256k1-haskell >= 0.4.0
- string-conversions >= 0.4.0.1
- text >= 1.2.3.0
- time >= 1.9.3
- transformers >= 0.5.6.2
- unordered-containers >= 0.2.10.0
- HUnit >= 1.6.0.0
- QuickCheck >= 2.13.2
library:
source-dirs: lib
when:
- condition: false
other-modules: Paths_bitcoin_test
tests:
spec:
source-dirs: exec
main: Spec.hs
dependencies:
- bitcoin-test
Loading