Skip to content

Commit

Permalink
Split test and bench out to separate packages
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithm committed Dec 1, 2022
1 parent 1c43de8 commit f364e8b
Show file tree
Hide file tree
Showing 67 changed files with 325 additions and 152 deletions.
67 changes: 67 additions & 0 deletions benchmark/bitcoin-bench.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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:
QuickCheck >=2.13.2
, array >=0.5.4.0
, base >=4.9 && <5
, base16 >=0.3.0.1
, binary >=0.8.8
, bitcoin
, bytestring >=0.10.10.0
, containers >=0.6.2.1
, criterion >=1.5 && <1.7
, cryptonite >=0.30
, deepseq >=1.4.4.0
, entropy >=0.4.1.5
, hashable >=1.3.0.0
, hspec >=2.7.1
, memory >=0.15.0
, murmur3 >=1.0.3
, network >=3.1.1.1
, safe >=0.3.18
, scientific >=0.3.6.2
, secp256k1-haskell >=0.4.0
, split >=0.2.3.3
, 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
, vector >=0.12.1.2
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.
49 changes: 49 additions & 0 deletions benchmark/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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
- QuickCheck >=2.13.2
- array >= 0.5.4.0
- base >=4.9 && <5
- base16 >= 0.3.0.1
- binary >= 0.8.8
- bytestring >= 0.10.10.0
- containers >= 0.6.2.1
- cryptonite >= 0.30
- deepseq >= 1.4.4.0
- entropy >= 0.4.1.5
- hashable >= 1.3.0.0
- hspec >= 2.7.1
- memory >= 0.15.0
- murmur3 >= 1.0.3
- network >= 3.1.1.1
- QuickCheck >= 2.13.2
- split >= 0.2.3.3
- safe >= 0.3.18
- 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
- vector >= 0.12.1.2
128 changes: 2 additions & 126 deletions bitcoin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,6 @@ license: BSD3
license-file: LICENSE
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
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
README.md
CHANGELOG.md

Expand All @@ -66,6 +45,7 @@ library
Bitcoin.Keys
Bitcoin.Keys.Common
Bitcoin.Keys.Extended
Bitcoin.Keys.Extended.Internal
Bitcoin.Keys.Mnemonic
Bitcoin.Network
Bitcoin.Network.Bloom
Expand All @@ -84,119 +64,15 @@ library
Bitcoin.Transaction.Segwit
Bitcoin.Transaction.Taproot
Bitcoin.Util
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
other-modules:
Bitcoin.Keys.Extended.Internal
hs-source-dirs:
src
build-depends:
QuickCheck >=2.13.2
, array >=0.5.4.0
, base >=4.9 && <5
, base16 >=0.3.0.1
, binary >=0.8.8
, bytestring >=0.10.10.0
, containers >=0.6.2.1
, cryptonite >=0.30
, deepseq >=1.4.4.0
, entropy >=0.4.1.5
, hashable >=1.3.0.0
, hspec >=2.7.1
, memory >=0.15.0
, murmur3 >=1.0.3
, network >=3.1.1.1
, safe >=0.3.18
, scientific >=0.3.6.2
, secp256k1-haskell >=0.4.0
, split >=0.2.3.3
, 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
, vector >=0.12.1.2
default-language: Haskell2010

test-suite spec
type: exitcode-stdio-1.0
main-is: Spec.hs
other-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.UtilSpec
Paths_bitcoin
hs-source-dirs:
test
build-depends:
HUnit >=1.6.0.0
, QuickCheck >=2.13.2
, aeson >=1.4.6.0
, array >=0.5.4.0
, base >=4.9 && <5
, base16 >=0.3.0.1
, base64 ==0.4.*
, binary >=0.8.8
, bitcoin
, bytestring >=0.10.10.0
, containers >=0.6.2.1
, cryptonite >=0.30
, deepseq >=1.4.4.0
, entropy >=0.4.1.5
, hashable >=1.3.0.0
, hspec >=2.7.1
, memory >=0.15.0
, murmur3 >=1.0.3
, network >=3.1.1.1
, safe >=0.3.18
, scientific >=0.3.6.2
, secp256k1-haskell >=0.4.0
, split >=0.2.3.3
, 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
, vector >=0.12.1.2
default-language: Haskell2010

benchmark benchmark
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules:
Paths_bitcoin
hs-source-dirs:
benchmark
build-depends:
QuickCheck >=2.13.2
, array >=0.5.4.0
array >=0.5.4.0
, base >=4.9 && <5
, base16 >=0.3.0.1
, binary >=0.8.8
, bitcoin
, bytestring >=0.10.10.0
, containers >=0.6.2.1
, criterion >=1.5 && <1.7
, cryptonite >=0.30
, deepseq >=1.4.4.0
, entropy >=0.4.1.5
Expand Down
8 changes: 5 additions & 3 deletions hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ cradle:
- path: "./src"
component: "bitcoin:lib"

- path: "./test"
component: "bitcoin:test:spec"
- path: "./test/lib"
component: "bitcoin-test:lib"
- path: "./test/exec/Spec.hs"
component: "bitcoin-test:test:spec"

- path: "./benchmark"
component: "bitcoin:bench:benchmark"
component: "bitcoin-bench:bench:benchmark"
23 changes: 0 additions & 23 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ 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
- data/*.dat # raw data for benchmarks
- README.md
- CHANGELOG.md
dependencies:
Expand All @@ -34,7 +32,6 @@ dependencies:
- memory >= 0.15.0
- murmur3 >= 1.0.3
- network >= 3.1.1.1
- QuickCheck >= 2.13.2
- split >= 0.2.3.3
- safe >= 0.3.18
- scientific >= 0.3.6.2
Expand All @@ -47,26 +44,6 @@ dependencies:
- vector >= 0.12.1.2
library:
source-dirs: src
other-modules: Bitcoin.Keys.Extended.Internal
when:
- condition: false
other-modules: Paths_bitcoin
tests:
spec:
main: Spec.hs
source-dirs: test
dependencies:
- aeson >= 1.4.6.0
- base64 ^>= 0.4
- bitcoin
- hspec >= 2.7.1
- HUnit >= 1.6.0.0
- QuickCheck >= 2.13.2
benchmarks:
benchmark:
main: Main.hs
source-dirs: benchmark
dependencies:
- bitcoin
- criterion >=1.5 && <1.7
- QuickCheck >=2.13.2
4 changes: 4 additions & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ nix:
extra-deps:
- fourmolu-0.8.2.0
- cryptonite-0.30
packages:
- .
- ./test
- ./benchmark
Loading

0 comments on commit f364e8b

Please sign in to comment.