nim-stint/stint.nimble

60 lines
2.2 KiB
Plaintext
Raw Normal View History

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-02-15 12:11:01 +00:00
srcDir = "src"
### Dependencies
2018-04-24 17:07:22 +00:00
# TODO remove test only requirements: https://github.com/nim-lang/nimble/issues/482
requires "nim >= 0.18", "https://github.com/alehander42/nim-quicktest >= 0.0.9"
2018-02-15 14:09:58 +00:00
proc test(name: string, lang: string = "c") =
if not dirExists "build":
mkDir "build"
if not dirExists "nimcache":
mkDir "nimcache"
--run
--nimcache: "nimcache"
switch("out", ("./build/" & name))
setCommand lang, "tests/" & name & ".nim"
2018-04-25 10:52:00 +00:00
task test_debug, "Run all tests - test implementation (StUint[64] = 2x uint32":
switch("define", "mpint_test")
2018-02-15 14:09:58 +00:00
test "all_tests"
2018-04-25 10:52:00 +00:00
task test_release, "Run all tests - prod implementation (StUint[64] = uint64":
test "all_tests"
2018-04-25 10:52:00 +00:00
task test_property_debug, "Run random tests (normal mode) - test implementation (StUint[64] = 2x uint32)":
requires "quicktest > 0.0.8"
switch("define", "mpint_test")
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)":
requires "quicktest > 0.0.8"
switch("define", "mpint_test")
switch("define", "release")
test "property_based"
2018-04-24 17:07:22 +00:00
task test_property_uint256_debug, "Run random tests (normal mode) vs TTMath on Uint256":
# TODO: another reference implementation?
# Note that currently importing both Stint and TTMath will crash the compiler for unknown reason.
2018-04-24 17:07:22 +00:00
requires "quicktest > 0.0.8"
test "property_based", "cpp"
task test_property_uint256_release, "Run random tests (release mode) vs TTMath on Uint256":
# TODO: another reference implementation?
# Note that currently importing both Stint and TTMath will crash the compiler for unknown reason.
2018-04-24 17:07:22 +00:00
requires "quicktest > 0.0.8"
switch("define", "release")
test "property_based", "cpp"
task test, "Run all tests - test and production implementation":
exec "nimble test_debug"
exec "nimble test_release"
exec "nimble test_property_debug"
exec "nimble test_property_release"
2018-04-24 17:07:22 +00:00
# TODO: ttmath tests, but importing both together raises illegal storage access