2018-04-25 10:52:00 +00:00
|
|
|
packageName = "stint"
|
2018-02-15 12:11:01 +00:00
|
|
|
version = "0.0.1"
|
|
|
|
author = "Status Research & Development GmbH"
|
2018-04-25 10:52:00 +00:00
|
|
|
description = "Efficient stack-based multiprecision int in Nim"
|
2018-03-02 10:48:08 +00:00
|
|
|
license = "Apache License 2.0 or MIT"
|
2018-05-08 13:51:55 +00:00
|
|
|
skipDirs = @["tests", "benchmarks"]
|
2018-02-15 12:11:01 +00:00
|
|
|
### Dependencies
|
|
|
|
|
2018-06-10 11:11:24 +00:00
|
|
|
# TODO test only requirements don't work: https://github.com/nim-lang/nimble/issues/482
|
2019-05-09 19:46:40 +00:00
|
|
|
requires "nim >= 0.19",
|
2019-07-07 09:50:53 +00:00
|
|
|
"stew"
|
2019-05-09 19:46:40 +00:00
|
|
|
#, "https://github.com/alehander42/nim-quicktest >= 0.18.0", "https://github.com/status-im/nim-ttmath"
|
2018-02-15 14:01:08 +00:00
|
|
|
|
2022-01-12 02:20:04 +00:00
|
|
|
proc test(args, path: string) =
|
2018-02-15 14:01:08 +00:00
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
2022-07-22 10:40:38 +00:00
|
|
|
let styleCheckStyle =
|
|
|
|
if (NimMajor, NimMinor) < (1, 6):
|
|
|
|
"hint"
|
|
|
|
else:
|
|
|
|
"error"
|
2022-01-12 02:20:04 +00:00
|
|
|
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & args &
|
2022-02-24 19:09:53 +00:00
|
|
|
" --outdir:build -r --hints:off --warnings:off --skipParentCfg" &
|
2022-07-22 10:40:38 +00:00
|
|
|
" --styleCheck:usages --styleCheck:" & styleCheckStyle & " " & path
|
2023-04-14 00:41:31 +00:00
|
|
|
if (NimMajor, NimMinor) > (1, 6):
|
|
|
|
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & args &
|
|
|
|
" --outdir:build -r --mm:refc --hints:off --warnings:off --skipParentCfg" &
|
|
|
|
" --styleCheck:usages --styleCheck:" & styleCheckStyle & " " & path
|
2018-04-24 17:07:22 +00:00
|
|
|
|
2018-03-26 09:46:24 +00:00
|
|
|
task test, "Run all tests - test and production implementation":
|
2022-01-12 02:20:04 +00:00
|
|
|
# Run tests for internal procs - test implementation (StUint[64] = 2x uint32
|
|
|
|
test "-d:stint_test", "tests/internal.nim"
|
|
|
|
# Run tests for internal procs - prod implementation (StUint[64] = uint64
|
|
|
|
test "", "tests/internal.nim"
|
|
|
|
# Run all tests - test implementation (StUint[64] = 2x uint32
|
|
|
|
test "-d:stint_test", "tests/all_tests.nim"
|
|
|
|
# Run all tests - prod implementation (StUint[64] = uint64
|
|
|
|
test "--threads:on", "tests/all_tests.nim"
|
|
|
|
|
|
|
|
## quicktest-0.20.0/quicktest.nim(277, 30) Error: cannot evaluate at compile time: BUILTIN_NAMES
|
|
|
|
##
|
|
|
|
# # Run random tests (debug mode) - test implementation (StUint[64] = 2x uint32)
|
|
|
|
# test "-d:stint_test", "tests/property_based.nim"
|
|
|
|
# # Run random tests (release mode) - test implementation (StUint[64] = 2x uint32)
|
|
|
|
# test "-d:stint_test -d:release", "tests/property_based.nim"
|
|
|
|
# # Run random tests Uint256 (debug mode) vs TTMath (StUint[256] = 8 x uint32)
|
|
|
|
# test "", "tests/property_based.nim"
|
|
|
|
# # Run random tests Uint256 (release mode) vs TTMath (StUint[256] = 4 x uint64)
|
|
|
|
# test "-d:release", "tests/property_based.nim"
|