Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build test with chronicles to json enabled #215

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions json_rpc.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ proc run(args, path: string) =
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:refc -r", path

proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "") =
if not dirExists "build":
mkDir "build"
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") &
" -r -f --skipUserCfg:on --skipParentCfg:on --verbosity:0" &
" --debuginfo --path:'.' --threads:on -d:chronicles_log_level=ERROR" &
" --styleCheck:usages --styleCheck:hint" &
" --hint[XDeclaredButNotUsed]:off --hint[Processing]:off " &
" --out:./build/" & name & " " & params & " " & srcDir & name & ".nim" &
" " & cmdParams
proc buildOnly(args, path: string) =
build args, path
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:refc -r", path

task test, "run tests":
run "", "tests/all"

when not defined(windows):
# on windows, socker server build failed
buildOnly "-d:\"chronicles_sinks=textlines[dynamic],json[dynamic]\"", "tests/all"
2 changes: 1 addition & 1 deletion json_rpc/clients/socketclient.nim
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ proc processData(client: RpcSocketClient) {.async: (raises: []).} =

# async loop reconnection and waiting
try:
info "Reconnect to server", address=client.address
info "Reconnect to server", address=`$`(client.address)
client.transport = await connect(client.address)
except TransportError as exc:
error "Error when reconnecting to server", msg=exc.msg
Expand Down