This commit is contained in:
parent
1f62235d4f
commit
c653d05f27
2 changed files with 11 additions and 11 deletions
|
|
@ -23,12 +23,12 @@ proc test(env, path: string) =
|
||||||
let common_args = "-r -f --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error"
|
let common_args = "-r -f --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error"
|
||||||
|
|
||||||
exec "nim " & lang & " " & env &
|
exec "nim " & lang & " " & env &
|
||||||
" -d:async_backend=none " & common_args & " " & path
|
" -d:asyncBackend=none " & common_args & " " & path
|
||||||
exec "nim " & lang & " " & env &
|
exec "nim " & lang & " " & env &
|
||||||
" -d:async_backend=chronos " & common_args & " " & path
|
" -d:asyncBackend=chronos " & common_args & " " & path
|
||||||
# TODO std backend is broken / untested
|
# TODO std backend is broken / untested
|
||||||
# exec "nim " & lang & " " & env &
|
# exec "nim " & lang & " " & env &
|
||||||
# " -d:async_backend=chronos " & common_args & " " & path
|
# " -d:asyncBackend=asyncdispatch " & common_args & " " & path
|
||||||
|
|
||||||
task test, "Run all tests":
|
task test, "Run all tests":
|
||||||
test "-d:debug --threads:on", "tests/all_tests"
|
test "-d:debug --threads:on", "tests/all_tests"
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
const
|
const
|
||||||
# To compile with async support, use `-d:async_backend=chronos|asyncdispatch`
|
# To compile with async support, use `-d:asyncBackend=chronos|asyncdispatch`
|
||||||
async_backend {.strdefine.} = "none"
|
asyncBackend {.strdefine.} = "none"
|
||||||
|
|
||||||
const
|
const
|
||||||
faststreams_async_backend {.strdefine.} = ""
|
faststreams_async_backend {.strdefine.} = ""
|
||||||
|
|
||||||
when faststreams_async_backend != "":
|
when faststreams_async_backend != "":
|
||||||
{.fatal: "use `-d:async_backend` instead".}
|
{.fatal: "use `-d:asyncBackend` instead".}
|
||||||
|
|
||||||
type
|
type
|
||||||
CloseBehavior* = enum
|
CloseBehavior* = enum
|
||||||
|
|
@ -15,11 +15,11 @@ type
|
||||||
|
|
||||||
const
|
const
|
||||||
debugHelpers* = defined(debugHelpers)
|
debugHelpers* = defined(debugHelpers)
|
||||||
fsAsyncSupport* = async_backend != "none"
|
fsAsyncSupport* = asyncBackend != "none"
|
||||||
|
|
||||||
when async_backend == "none":
|
when asyncBackend == "none":
|
||||||
discard
|
discard
|
||||||
elif async_backend == "chronos":
|
elif asyncBackend == "chronos":
|
||||||
import
|
import
|
||||||
chronos
|
chronos
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ elif async_backend == "chronos":
|
||||||
template fsAwait*(f: Future): untyped =
|
template fsAwait*(f: Future): untyped =
|
||||||
await f
|
await f
|
||||||
|
|
||||||
elif async_backend in ["std", "asyncdispatch"]:
|
elif asyncBackend == "asyncdispatch":
|
||||||
import
|
import
|
||||||
std/asyncdispatch
|
std/asyncdispatch
|
||||||
|
|
||||||
|
|
@ -47,7 +47,7 @@ elif async_backend in ["std", "asyncdispatch"]:
|
||||||
type Duration* = int
|
type Duration* = int
|
||||||
|
|
||||||
else:
|
else:
|
||||||
{.fatal: "Unrecognized network backend: " & async_backend.}
|
{.fatal: "Unrecognized network backend: " & asyncBackend .}
|
||||||
|
|
||||||
when defined(danger):
|
when defined(danger):
|
||||||
template fsAssert*(x) = discard
|
template fsAssert*(x) = discard
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue