[build] fix: ignore logging when running singular tests (#369)
* [build] fix: ignore logging when running singular tests Ensures that logging is ignored at runtime when running individual tests using `nim c -r tests/...` * [build] Allow tests to be run with -d:chronicles_log_level When running tests with chronicles_log_level set, do not hide the the logs.
This commit is contained in:
parent
5ae545bc3c
commit
086b5c3914
|
@ -0,0 +1,8 @@
|
||||||
|
--path:".."
|
||||||
|
--threads:on
|
||||||
|
--tlsEmulation:off
|
||||||
|
|
||||||
|
when not defined(chronicles_log_level):
|
||||||
|
--define:"chronicles_log_level:NONE" # compile all log statements
|
||||||
|
--define:"chronicles_sinks:textlines[dynamic]" # allow logs to be filtered at runtime
|
||||||
|
--"import":"logging" # ensure that logging is ignored at runtime
|
|
@ -4,3 +4,6 @@ proc ignoreLogging(level: LogLevel, message: LogOutputStr) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
defaultChroniclesStream.output.writer = ignoreLogging
|
defaultChroniclesStream.output.writer = ignoreLogging
|
||||||
|
|
||||||
|
{.warning[UnusedImport]:off.}
|
||||||
|
{.used.}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
--path:".."
|
|
||||||
--threads:on
|
|
||||||
--tlsEmulation:off
|
|
||||||
|
|
||||||
-d:chronicles_log_level:"NONE" # compile all log statements
|
|
||||||
-d:chronicles_sinks:"textlines[dynamic]" # allow logs to be filtered by tests
|
|
|
@ -1,4 +1,3 @@
|
||||||
import ./logging
|
|
||||||
import ./codex/teststores
|
import ./codex/teststores
|
||||||
import ./codex/testblockexchange
|
import ./codex/testblockexchange
|
||||||
import ./codex/teststorageproofs
|
import ./codex/teststorageproofs
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import ./logging
|
|
||||||
import ./contracts/testCollateral
|
import ./contracts/testCollateral
|
||||||
import ./contracts/testContracts
|
import ./contracts/testContracts
|
||||||
import ./contracts/testMarket
|
import ./contracts/testMarket
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import ./logging
|
|
||||||
import ./integration/testIntegration
|
import ./integration/testIntegration
|
||||||
import ./integration/testblockexpiration
|
import ./integration/testblockexpiration
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue