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

Fix test suite #116

Merged
merged 8 commits into from
Jan 21, 2021
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
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,14 @@ jobs:
rm -rf .git
- name: Install test dependencies
shell: bash
# Workaround #113 and https://github.com/status-im/nim-serialization/issues/33
# and nimble flaky pinning / dependency resolution,
# json_serialization install would override nim-serialization pinning
run: |
nimble refresh
nimble install -y gmp stew serialization json_serialization
nimble install -y gmp stew json_serialization
nimble uninstall -y serialization
nimble install serialization@#217d78a
- name: Run Constantine tests (with Assembler & with GMP)
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.target.cpu == 'amd64'
shell: bash
Expand Down
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ before_script:
- export PATH="$PWD/nim-${CHANNEL}/bin${PATH:+:$PATH}"
script:
- nimble refresh
- nimble install -y gmp stew serialization json_serialization
- nimble install -y gmp stew json_serialization
# Workaround #113 and https://github.com/status-im/nim-serialization/issues/33
# and nimble flaky pinning / dependency resolution,
# json_serialization install would override nim-serialization pinning
- nimble uninstall -y serialization
- nimble install serialization@#217d78a

# Installing Clang9.0 or later is a pain in Travis
# for inline assembly "flag output constraint"
# Also MacOS build is timing out with 2 series of tests.
Expand Down
7 changes: 6 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,15 @@ steps:
displayName: 'Downloading GMP (Linux 32-bit)'
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['UCPU'], 'i686'))

# Workaround #113 and https://github.com/status-im/nim-serialization/issues/33
# and nimble flaky pinning / dependency resolution,
# json_serialization install would override nim-serialization pinning
- bash: |
echo "PATH=${PATH}"
nimble refresh
nimble install -y gmp stew serialization json_serialization
nimble install -y gmp stew json_serialization
nimble uninstall -y serialization
nimble install serialization@#217d78a
displayName: 'Installing package and testing dependencies'

- bash: |
Expand Down
27 changes: 26 additions & 1 deletion benchmarks/bench_sha256.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,41 @@ import

proc separator*() = separator(69)

# Deal with platform mess
# --------------------------------------------------------------------
when defined(windows):
when sizeof(int) == 8:
const DLLSSLName* = "(libssl-1_1-x64|ssleay64|libssl64).dll"
else:
const DLLSSLName* = "(libssl-1_1|ssleay32|libssl32).dll"
else:
when defined(macosx):
const versions = "(.1.1|.38|.39|.41|.43|.44|.45|.46|.47|.48|.10|.1.0.2|.1.0.1|.1.0.0|.0.9.9|.0.9.8|)"
else:
const versions = "(.1.1|.1.0.2|.1.0.1|.1.0.0|.0.9.9|.0.9.8|.48|.47|.46|.45|.44|.43|.41|.39|.38|.10|)"

when defined(macosx):
const DLLSSLName* = "libssl" & versions & ".dylib"
elif defined(genode):
const DLLSSLName* = "libssl.lib.so"
else:
const DLLSSLName* = "libssl.so" & versions

# OpenSSL wrapper
# --------------------------------------------------------------------

proc SHA256[T: byte|char](
msg: openarray[T],
digest: ptr array[32, byte] = nil
): ptr array[32, byte] {.cdecl, dynlib: "libssl.so", importc.}
): ptr array[32, byte] {.cdecl, dynlib: DLLSSLName, importc.}

proc SHA256_OpenSSL[T: byte|char](
digest: var array[32, byte],
s: openarray[T]) =
discard SHA256(s, digest.addr)

# --------------------------------------------------------------------

proc report(op: string, bytes: int, startTime, stopTime: MonoTime, startClk, stopClk: int64, iters: int) =
let ns = inNanoseconds((stopTime-startTime) div iters)
let throughput = 1e9 / float64(ns)
Expand Down
Loading