2018-12-15 15:14:26 +00:00
|
|
|
# Package
|
2018-03-15 23:07:09 +00:00
|
|
|
|
2020-09-07 14:51:33 +00:00
|
|
|
version = "0.5.4"
|
2018-03-15 23:07:09 +00:00
|
|
|
author = "Eugene Kabanov"
|
|
|
|
description = "Nim cryptographic library"
|
|
|
|
license = "MIT"
|
2018-11-02 06:17:09 +00:00
|
|
|
skipDirs = @["tests", "examples", "Nim", "docs"]
|
2018-03-15 23:07:09 +00:00
|
|
|
|
2018-12-15 15:14:26 +00:00
|
|
|
# Dependencies
|
|
|
|
|
2018-03-29 08:58:26 +00:00
|
|
|
requires "nim > 0.18.0"
|
2018-03-21 09:12:35 +00:00
|
|
|
|
2018-12-15 15:14:26 +00:00
|
|
|
# Tests
|
|
|
|
|
2019-09-01 20:13:12 +00:00
|
|
|
task test, "Runs the test suite":
|
2021-02-25 16:52:26 +00:00
|
|
|
var testCommands = @[
|
2019-09-01 20:13:12 +00:00
|
|
|
"nim c -f -r tests/",
|
2019-10-29 15:43:28 +00:00
|
|
|
"nim c -f -d:danger -r tests/",
|
|
|
|
"nim c -f -d:danger --threads:on -r tests/",
|
2019-09-01 20:13:12 +00:00
|
|
|
]
|
2021-02-25 16:52:26 +00:00
|
|
|
|
|
|
|
when (NimMajor, NimMinor) >= (1, 5):
|
|
|
|
testCommands.add "nim c -f --gc:orc --threads:on -r tests/"
|
|
|
|
|
2019-01-18 22:07:30 +00:00
|
|
|
let exampleFiles = @[
|
2019-09-01 20:13:12 +00:00
|
|
|
"ecb", "cbc", "ofb", "cfb", "ctr", "gcm"
|
|
|
|
]
|
2021-02-25 16:52:26 +00:00
|
|
|
var exampleCommands = @[
|
2019-01-18 22:07:30 +00:00
|
|
|
"nim c -f -r --threads:on examples/",
|
2019-09-01 20:13:12 +00:00
|
|
|
]
|
|
|
|
|
2021-02-25 16:52:26 +00:00
|
|
|
when (NimMajor, NimMinor) >= (1, 5):
|
|
|
|
exampleCommands.add "nim c -f --gc:orc --threads:on -r examples/"
|
|
|
|
|
2019-09-01 20:13:12 +00:00
|
|
|
for cmd in testCommands:
|
2019-09-01 20:53:09 +00:00
|
|
|
echo "\n" & cmd & "testall"
|
|
|
|
exec cmd & "testall"
|
|
|
|
rmFile("tests/testall".toExe())
|
2019-01-18 22:07:30 +00:00
|
|
|
|
|
|
|
for efile in exampleFiles:
|
|
|
|
for cmd in exampleCommands:
|
|
|
|
echo "\n" & cmd & efile
|
|
|
|
exec cmd & efile
|
2019-01-18 15:17:02 +00:00
|
|
|
rmFile("examples/" & efile.toExe())
|
2019-01-07 23:35:28 +00:00
|
|
|
|
2019-09-01 20:13:12 +00:00
|
|
|
exec("nim c -f -r -d:nimcryptoLowercase tests/testapi")
|
|
|
|
exec("nim c -f -r -d:nimcrypto0xPrefix tests/testapi")
|
|
|
|
exec("nim c -f -r -d:nimcrypto0xPrefix -d:nimcryptoLowercase tests/testapi")
|