Skip to content

Commit

Permalink
Merge 2b68c25 into 6ac6fbd
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Mar 27, 2020
2 parents 6ac6fbd + 2b68c25 commit 7651f83
Show file tree
Hide file tree
Showing 91 changed files with 298 additions and 519 deletions.
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@ os: linux

cache:
directories:
- $HOME/.local
- $HOME/.stack

addons:
apt:
packages:
- libsodium-dev

before_install:
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://github.com/TokTok/hs-tools/releases/download/v0.6/hs-tools-v0.6.tar.gz | tar xz -C $HOME

install:
# Where to find libraries.
- export LD_LIBRARY_PATH=$HOME/.local/lib
- export PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig
# libsodium
- git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium
- test -f $HOME/.local/lib/libsodium.so || (cd libsodium && ./configure --prefix=$HOME/.local && make install -j$(nproc))

script:
- hlint .
- stylish-haskell-lhs -i .
- git diff --exit-code
- stack --no-terminal test --coverage
- shc hstox testsuite
- stack --no-terminal test --coverage --extra-include-dirs=$HOME/.local/include --extra-lib-dirs=$HOME/.local/lib
- shc toxcore testsuite
37 changes: 12 additions & 25 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library")
load("@rules_haskell//haskell:defs.bzl", "haskell_library", "haskell_test")
load("//third_party/haskell/hspec-discover:build_defs.bzl", "hspec_library")
load("@rules_haskell//haskell:defs.bzl", "haskell_library")
load("//third_party/haskell/hspec-discover:build_defs.bzl", "hspec_test")
load("//tools/project:build_defs.bzl", "project")

project()

haskell_library(
name = "hs-toxcore",
srcs = glob(["src/tox/**/*.*hs"]),
srcs = glob(["src/**/*.*hs"]),
compiler_flags = [
"-j4",
"-Wno-unused-imports",
],
src_strip_prefix = "src/tox",
version = "0.0.2",
src_strip_prefix = "src",
version = "0.2.11",
visibility = ["//visibility:public"],
deps = [
"//hs-msgpack",
"//hs-msgpack-rpc",
"//hs-msgpack-binary",
"//hs-msgpack-rpc-conduit",
hazel_library("MonadRandom"),
hazel_library("QuickCheck"),
hazel_library("base"),
Expand All @@ -39,20 +39,20 @@ haskell_library(
],
)

hspec_library(
hspec_test(
name = "testsuite",
size = "small",
compiler_flags = [
"-j4",
"-Wno-unused-imports",
],
src_strip_prefix = "src/testsuite",
version = "0.0.2",
deps = [
":hs-toxcore",
"//hs-msgpack",
"//hs-msgpack-rpc",
"//hs-msgpack-binary",
"//hs-msgpack-rpc-conduit",
"//hs-msgpack-types",
hazel_library("QuickCheck"),
hazel_library("async"),
hazel_library("base"),
hazel_library("binary"),
hazel_library("binary-bits"),
Expand All @@ -64,16 +64,3 @@ hspec_library(
hazel_library("text"),
],
)

haskell_test(
name = "test",
srcs = glob(["test/**/*.*hs"]),
compiler_flags = ["-Wno-unused-imports"],
src_strip_prefix = "test",
deps = [
":hs-toxcore",
":testsuite",
hazel_library("async"),
hazel_library("base"),
],
)
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.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ newKeyPair = do
(sk, pk) <- Sodium.newKeypair
return $ KeyPair (Key sk) (Key pk)
newKeyPairR :: Rpc.RpcIO (Rpc.Returns KeyPair)
newKeyPairR :: Rpc.Rpc (Rpc.ReturnsM IO KeyPair)
newKeyPairR =
Rpc.stubsIO "KeyPair.newKeyPair"
(Ret "keyPair")
Rpc.stubs "KeyPair.newKeyPair"
(RetM "keyPair")
newKeyPair
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import Network.Tox.Crypto.Key
newNonce :: IO Nonce
newNonce = Key <$> Sodium.newNonce
newNonceR :: Rpc.RpcIO (Rpc.Returns Nonce)
newNonceR :: Rpc.Rpc (Rpc.ReturnsM IO Nonce)
newNonceR =
Rpc.stubsIO "Nonce.newNonce"
(Ret "nonce")
Rpc.stubs "Nonce.newNonce"
(RetM "nonce")
newNonce
Expand Down
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.
29 changes: 0 additions & 29 deletions src/testsuite/Network/Tox/Crypto/CombinedKeySpec.hs

This file was deleted.

67 changes: 0 additions & 67 deletions src/testsuite/Network/Tox/Crypto/KeyPairSpec.hs

This file was deleted.

127 changes: 0 additions & 127 deletions src/testsuite/Network/Tox/RPCTest.hs

This file was deleted.

1 change: 0 additions & 1 deletion src/testsuite/ToxTestSuite.hs

This file was deleted.

7 changes: 0 additions & 7 deletions src/tox-refsut.hs

This file was deleted.

0 comments on commit 7651f83

Please sign in to comment.