mirror of
https://github.com/codex-storage/nim-libp2p.git
synced 2025-01-12 20:14:09 +00:00
Move tests flags from 'nimble test' to 'config.nims' (#852)
This commit is contained in:
parent
444b837923
commit
f14ada3dcf
@ -22,9 +22,7 @@ requires "nim >= 1.2.0",
|
|||||||
import hashes
|
import hashes
|
||||||
proc runTest(filename: string, verify: bool = true, sign: bool = true,
|
proc runTest(filename: string, verify: bool = true, sign: bool = true,
|
||||||
moreoptions: string = "") =
|
moreoptions: string = "") =
|
||||||
var excstr = "nim c --skipParentCfg --opt:speed -d:debug -d:libp2p_agents_metrics -d:libp2p_protobuf_metrics -d:libp2p_network_protocols_metrics -d:libp2p_mplex_metrics "
|
var excstr = "nim c --skipParentCfg --opt:speed -d:debug "
|
||||||
excstr.add(" -d:chronicles_sinks=textlines[stdout],json[dynamic] -d:chronicles_log_level=TRACE ")
|
|
||||||
excstr.add(" -d:chronicles_runtime_filtering=TRUE ")
|
|
||||||
excstr.add(" " & getEnv("NIMFLAGS") & " ")
|
excstr.add(" " & getEnv("NIMFLAGS") & " ")
|
||||||
excstr.add(" --verbosity:0 --hints:off ")
|
excstr.add(" --verbosity:0 --hints:off ")
|
||||||
excstr.add(" -d:libp2p_pubsub_sign=" & $sign)
|
excstr.add(" -d:libp2p_pubsub_sign=" & $sign)
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
import ../config.nims
|
import ../config.nims
|
||||||
|
import strutils
|
||||||
|
|
||||||
--threads:on
|
--threads:on
|
||||||
--d:metrics
|
--d:metrics
|
||||||
--d:withoutPCRE
|
--d:withoutPCRE
|
||||||
|
--d:libp2p_agents_metrics
|
||||||
|
--d:libp2p_protobuf_metrics
|
||||||
|
--d:libp2p_network_protocols_metrics
|
||||||
|
--d:libp2p_mplex_metrics
|
||||||
|
|
||||||
|
# Only add chronicles param if the
|
||||||
|
# user didn't specify any
|
||||||
|
var hasChroniclesParam = false
|
||||||
|
for param in 0..<paramCount():
|
||||||
|
if "chronicles" in paramStr(param):
|
||||||
|
hasChroniclesParam = true
|
||||||
|
|
||||||
|
if hasChroniclesParam:
|
||||||
|
echo "Since you specified chronicles params, TRACE won't be tested!"
|
||||||
|
else:
|
||||||
|
switch("import", "stublogger")
|
||||||
|
switch("define", "chronicles_sinks=textlines[stdout],json[dynamic]")
|
||||||
|
switch("define", "chronicles_log_level=TRACE")
|
||||||
|
switch("define", "chronicles_runtime_filtering=TRUE")
|
||||||
|
@ -3,7 +3,6 @@ include ../../libp2p/protocols/pubsub/gossipsub
|
|||||||
{.used.}
|
{.used.}
|
||||||
|
|
||||||
import options
|
import options
|
||||||
import ../stublogger
|
|
||||||
import stew/byteutils
|
import stew/byteutils
|
||||||
import ../../libp2p/builders
|
import ../../libp2p/builders
|
||||||
import ../../libp2p/errors
|
import ../../libp2p/errors
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
{.used.}
|
{.used.}
|
||||||
|
|
||||||
import ../stublogger
|
|
||||||
|
|
||||||
import testfloodsub,
|
import testfloodsub,
|
||||||
testgossipsub,
|
testgossipsub,
|
||||||
testgossipsub2,
|
testgossipsub2,
|
||||||
|
@ -7,4 +7,6 @@ when defined(chronicles_runtime_filtering):
|
|||||||
when defaultChroniclesStream.outputs.type.arity == 1:
|
when defaultChroniclesStream.outputs.type.arity == 1:
|
||||||
# Hide the json logs, they're just here to check if we compile
|
# Hide the json logs, they're just here to check if we compile
|
||||||
proc noOutput(logLevel: LogLevel, msg: LogOutputStr) = discard
|
proc noOutput(logLevel: LogLevel, msg: LogOutputStr) = discard
|
||||||
defaultChroniclesStream.outputs[0].writer = noOutput
|
defaultChroniclesStream.outputs[0].writer = noOutput
|
||||||
|
|
||||||
|
{.used.}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import chronos, unittest2, helpers, stublogger
|
import chronos, unittest2, helpers
|
||||||
import ../libp2p/daemon/daemonapi, ../libp2p/multiaddress, ../libp2p/multicodec,
|
import ../libp2p/daemon/daemonapi, ../libp2p/multiaddress, ../libp2p/multicodec,
|
||||||
../libp2p/cid, ../libp2p/multihash, ../libp2p/peerid
|
../libp2p/cid, ../libp2p/multihash, ../libp2p/peerid
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import stublogger
|
|
||||||
|
|
||||||
import helpers, commoninterop
|
import helpers, commoninterop
|
||||||
import ../libp2p
|
import ../libp2p
|
||||||
import ../libp2p/crypto/crypto, ../libp2p/protocols/connectivity/relay/[relay, client]
|
import ../libp2p/crypto/crypto, ../libp2p/protocols/connectivity/relay/[relay, client]
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import stublogger
|
|
||||||
|
|
||||||
import testvarint,
|
import testvarint,
|
||||||
testconnection,
|
testconnection,
|
||||||
testminprotobuf,
|
testminprotobuf,
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
when defined(nimHasUsed): {.used.}
|
when defined(nimHasUsed): {.used.}
|
||||||
|
|
||||||
import unittest2
|
import unittest2
|
||||||
import stublogger
|
|
||||||
import ../libp2p/crypto/crypto
|
import ../libp2p/crypto/crypto
|
||||||
import nimcrypto/utils
|
import nimcrypto/utils
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user