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
|
|
|
|
2018-02-15 14:09:58 +00:00
|
|
|
proc test(name: string, lang: string = "c") =
|
2018-02-15 14:01:08 +00:00
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
|
|
|
--run
|
|
|
|
switch("out", ("./build/" & name))
|
|
|
|
setCommand lang, "tests/" & name & ".nim"
|
|
|
|
|
2018-05-02 15:49:31 +00:00
|
|
|
task test_internal_debug, "Run tests for internal procs - test implementation (StUint[64] = 2x uint32":
|
2018-10-06 10:18:03 +00:00
|
|
|
switch("define", "stint_test")
|
2018-05-02 15:49:31 +00:00
|
|
|
test "internal"
|
|
|
|
|
|
|
|
task test_internal_release, "Run tests for internal procs - prod implementation (StUint[64] = uint64":
|
|
|
|
test "internal"
|
|
|
|
|
2018-04-25 10:52:00 +00:00
|
|
|
task test_debug, "Run all tests - test implementation (StUint[64] = 2x uint32":
|
2018-10-06 10:18:03 +00:00
|
|
|
switch("define", "stint_test")
|
2018-02-15 14:09:58 +00:00
|
|
|
test "all_tests"
|
2018-03-26 09:46:24 +00:00
|
|
|
|
2018-04-25 10:52:00 +00:00
|
|
|
task test_release, "Run all tests - prod implementation (StUint[64] = uint64":
|
2018-03-26 09:46:24 +00:00
|
|
|
test "all_tests"
|
|
|
|
|
2018-05-03 22:11:07 +00:00
|
|
|
task test_property_debug, "Run random tests (debug mode) - test implementation (StUint[64] = 2x uint32)":
|
2018-06-10 11:11:24 +00:00
|
|
|
requires "https://github.com/alehander42/nim-quicktest >= 0.18.0"
|
2018-10-06 10:18:03 +00:00
|
|
|
switch("define", "stint_test")
|
2018-04-24 14:52:13 +00:00
|
|
|
test "property_based"
|
|
|
|
|
2018-04-25 10:52:00 +00:00
|
|
|
task test_property_release, "Run random tests (release mode) - test implementation (StUint[64] = 2x uint32)":
|
2018-06-10 11:11:24 +00:00
|
|
|
requires "https://github.com/alehander42/nim-quicktest >= 0.18.0"
|
2018-10-06 10:18:03 +00:00
|
|
|
switch("define", "stint_test")
|
2018-04-24 14:52:13 +00:00
|
|
|
switch("define", "release")
|
|
|
|
test "property_based"
|
|
|
|
|
2018-05-03 22:11:07 +00:00
|
|
|
task test_property_uint256_debug, "Run random tests Uint256 (debug mode) vs TTMath (StUint[256] = 8 x uint32)":
|
2018-04-24 17:07:22 +00:00
|
|
|
# TODO: another reference implementation?
|
2018-06-10 11:11:24 +00:00
|
|
|
requires "https://github.com/alehander42/nim-quicktest >= 0.18.0", "https://github.com/status-im/nim-ttmath"
|
2018-04-24 17:07:22 +00:00
|
|
|
test "property_based", "cpp"
|
|
|
|
|
2018-05-03 22:11:07 +00:00
|
|
|
task test_property_uint256_release, "Run random tests Uint256 (release mode) vs TTMath (StUint[256] = 4 x uint64)":
|
2018-04-24 17:07:22 +00:00
|
|
|
# TODO: another reference implementation?
|
2018-06-10 11:11:24 +00:00
|
|
|
requires "https://github.com/alehander42/nim-quicktest >= 0.18.0", "https://github.com/status-im/nim-ttmath"
|
2018-04-24 17:07:22 +00:00
|
|
|
switch("define", "release")
|
|
|
|
test "property_based", "cpp"
|
|
|
|
|
2018-03-26 09:46:24 +00:00
|
|
|
task test, "Run all tests - test and production implementation":
|
2018-05-02 15:49:31 +00:00
|
|
|
exec "nimble test_internal_debug"
|
|
|
|
exec "nimble test_internal_release"
|
2018-03-26 09:46:24 +00:00
|
|
|
exec "nimble test_debug"
|
2018-04-24 14:52:13 +00:00
|
|
|
exec "nimble test_release"
|
2018-06-10 11:11:24 +00:00
|
|
|
## TODO test only requirements don't work: https://github.com/nim-lang/nimble/issues/482
|
|
|
|
# exec "nimble test_property_debug"
|
|
|
|
# exec "nimble test_property_release"
|
|
|
|
# exec "nimble test_property_uint256_debug"
|
|
|
|
# exec "nimble test_property_uint256_release"
|