Define explicit ownership for custom appenders and formatters
Add SharedLogState for synchronized value data and factories for independently owned appender state and captured formatter closures. Reject unsafe configuration state, update the test collector to value snapshots, and document the breaking APIs in version 3.0.0. Expand ORC ownership and sanitizer coverage and reject stale test executables.
This commit is contained in:
1 parent
851caef706
commit
b2d0e9dade
11 files changed
+808
-110
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# Package
|
||||
|
||||
version = "2.1.2"
|
||||
version = "3.0.0"
|
||||
author = "Jonathan Bernard"
|
||||
description = "Wrapper around std/logging to provide namespaced logging."
|
||||
license = "MIT"
|
||||
@@ -15,16 +15,28 @@ requires @["nim >= 2.2.0", "zero_functional"]
|
||||
requires "timeutils"
|
||||
|
||||
proc runUnitTests() =
|
||||
if fileExists("src/namespaced_logging.out"): rmFile("src/namespaced_logging.out")
|
||||
exec "nimble c --mm:orc --threads:on src/namespaced_logging.nim"
|
||||
if not fileExists("src/namespaced_logging.out"):
|
||||
raise newException(OSError, "Unit test compilation produced no executable")
|
||||
exec "src/namespaced_logging.out"
|
||||
|
||||
proc runRegressionTests() =
|
||||
if fileExists("tests/bin/writer_child"): rmFile("tests/bin/writer_child")
|
||||
if fileExists("tests/bin/regressions"): rmFile("tests/bin/regressions")
|
||||
exec "nimble c --mm:orc --threads:on -d:multithreaded --out:tests/bin/writer_child tests/writer_child.nim"
|
||||
if not fileExists("tests/bin/writer_child"):
|
||||
raise newException(OSError, "Writer test compilation produced no executable")
|
||||
exec "nimble c --mm:orc --threads:on --out:tests/bin/regressions tests/regressions.nim"
|
||||
if not fileExists("tests/bin/regressions"):
|
||||
raise newException(OSError, "Regression test compilation produced no executable")
|
||||
exec "tests/bin/regressions"
|
||||
|
||||
proc runThreadSafetyTests() =
|
||||
if fileExists("tests/bin/thread_safety"): rmFile("tests/bin/thread_safety")
|
||||
exec "nimble c --mm:orc --threads:on --passC:-fsanitize=thread --passC:-g --passL:-fsanitize=thread --out:tests/bin/thread_safety tests/thread_safety.nim"
|
||||
if not fileExists("tests/bin/thread_safety"):
|
||||
raise newException(OSError, "Thread-safety test compilation produced no executable")
|
||||
exec "bash tests/run_tsan.sh tests/bin/thread_safety"
|
||||
|
||||
task test, "Run all tests, including ThreadSanitizer, and report all failing suites.":
|
||||
|
||||
Reference in new issue
Block a user