2018-11-19 02:52:11 +00:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
2018-11-19 04:03:23 +00:00
|
|
|
packageName = "libp2p"
|
2019-11-06 11:01:16 +00:00
|
|
|
version = "0.0.2"
|
2018-11-19 02:52:11 +00:00
|
|
|
author = "Status Research & Development GmbH"
|
|
|
|
description = "LibP2P implementation"
|
|
|
|
license = "MIT"
|
2018-11-27 12:20:05 +00:00
|
|
|
skipDirs = @["tests", "examples", "Nim"]
|
2018-11-19 02:52:11 +00:00
|
|
|
|
2020-04-14 05:26:12 +00:00
|
|
|
requires "nim >= 1.2.0",
|
|
|
|
"nimcrypto >= 0.4.1",
|
2020-03-06 19:19:43 +00:00
|
|
|
"bearssl >= 0.1.4",
|
2020-04-21 01:24:42 +00:00
|
|
|
"chronicles >= 0.7.2",
|
2020-04-14 13:27:07 +00:00
|
|
|
"chronos >= 2.3.8",
|
|
|
|
"metrics",
|
|
|
|
"secp256k1",
|
2020-06-06 00:17:05 +00:00
|
|
|
"stew >= 0.1.0"
|
2018-11-19 02:52:11 +00:00
|
|
|
|
2020-06-01 06:41:32 +00:00
|
|
|
proc runTest(filename: string, verify: bool = true, sign: bool = true) =
|
2020-06-13 01:56:17 +00:00
|
|
|
var excstr: string = "nim c -r --opt:speed -d:debug --verbosity:0 --hints:off -d:chronicles_log_level=info"
|
2020-05-06 09:26:08 +00:00
|
|
|
excstr.add(" ")
|
|
|
|
excstr.add("-d:libp2p_pubsub_sign=" & $sign)
|
|
|
|
excstr.add(" ")
|
|
|
|
excstr.add("-d:libp2p_pubsub_verify=" & $verify)
|
|
|
|
excstr.add(" ")
|
|
|
|
excstr.add("tests/" & filename)
|
|
|
|
exec excstr
|
2020-04-14 13:21:16 +00:00
|
|
|
rmFile "tests/" & filename.toExe
|
2019-03-14 02:55:47 +00:00
|
|
|
|
2020-04-19 05:04:53 +00:00
|
|
|
proc buildSample(filename: string) =
|
|
|
|
exec "nim c --opt:speed --threads:on -d:debug --verbosity:0 --hints:off examples/" & filename
|
|
|
|
rmFile "examples" & filename.toExe
|
|
|
|
|
2020-05-06 09:26:08 +00:00
|
|
|
task testnative, "Runs libp2p native tests":
|
2020-04-23 01:27:29 +00:00
|
|
|
runTest("testnative")
|
2020-05-06 09:26:08 +00:00
|
|
|
|
|
|
|
task testdaemon, "Runs daemon tests":
|
2020-04-23 01:27:29 +00:00
|
|
|
runTest("testdaemon")
|
2020-05-06 09:26:08 +00:00
|
|
|
|
|
|
|
task testinterop, "Runs interop tests":
|
2020-04-23 01:27:29 +00:00
|
|
|
runTest("testinterop")
|
2020-04-19 05:04:53 +00:00
|
|
|
|
2020-05-06 09:26:08 +00:00
|
|
|
task testpubsub, "Runs pubsub tests":
|
|
|
|
runTest("pubsub/testpubsub")
|
|
|
|
runTest("pubsub/testpubsub", sign = false, verify = false)
|
|
|
|
|
|
|
|
task test, "Runs the test suite":
|
|
|
|
exec "nimble testnative"
|
|
|
|
exec "nimble testpubsub"
|
|
|
|
exec "nimble testdaemon"
|
|
|
|
exec "nimble testinterop"
|
|
|
|
|
2020-04-19 05:04:53 +00:00
|
|
|
task examples_build, "Build the samples":
|
2020-04-23 01:27:29 +00:00
|
|
|
buildSample("directchat")
|