nim-libp2p/tests/config.nims
diegomrsantos 86563cbddd
chore: enable Nim 2.0.x and fix compilation issues (#1146)
This PR enables Nim 2.0.x with `refc` garbage collector on CI.

The following compilation error had to be fixed: Error: undeclared
identifier: 'acceptHandler`gensym435'; if declared in a template, this
identifier may be inconsistently marked inject or gensym
2024-07-10 14:24:12 +02:00

40 lines
947 B
Nim

import ../config.nims
import strutils, os
--threads:
on
--d:
metrics
--d:
withoutPCRE
--d:
libp2p_agents_metrics
--d:
libp2p_protobuf_metrics
--d:
libp2p_network_protocols_metrics
--d:
libp2p_mplex_metrics
--d:
unittestPrintTime
--skipParentCfg
--mm:
refc
# reconsider when there's a version-2-2 branch worth testing with as we might switch to orc
# Only add chronicles param if the
# user didn't specify any
var hasChroniclesParam = false
for param in 0 ..< system.paramCount():
if "chronicles" in system.paramStr(param):
hasChroniclesParam = true
if hasChroniclesParam:
echo "Since you specified chronicles params, TRACE won't be tested!"
else:
let modulePath = currentSourcePath.parentDir / "stublogger"
switch("import", modulePath)
switch("define", "chronicles_sinks=textlines[stdout],json[dynamic]")
switch("define", "chronicles_log_level=TRACE")
switch("define", "chronicles_runtime_filtering=TRUE")