summary refs log tree commit diff stats
path: root/tests/arc
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-03-19 22:58:16 +0100
committerGitHub <noreply@github.com>2020-03-19 22:58:16 +0100
commit35fb38629f2f56d15afea15ba8597f18e2794229 (patch)
tree4391789c10dcfa7afce5de1744dcde51da33fc68 /tests/arc
parent705e283fef845a7dd78a2f0e241b1ad0f05490d3 (diff)
downloadNim-35fb38629f2f56d15afea15ba8597f18e2794229.tar.gz
cycle breaker (#13593)
* cycle breaking as an alternative to cycle detection
Diffstat (limited to 'tests/arc')
-rw-r--r--tests/arc/tasyncawait.nim19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/arc/tasyncawait.nim b/tests/arc/tasyncawait.nim
index 89e924104..6b5b301a6 100644
--- a/tests/arc/tasyncawait.nim
+++ b/tests/arc/tasyncawait.nim
@@ -1,5 +1,5 @@
 discard """
-  output: "5000"
+  outputsub: "result: 5000"
   cmd: "nim c --gc:arc $file"
 """
 
@@ -59,11 +59,16 @@ proc createServer(port: Port) {.async.} =
   while true:
     asyncCheck readMessages(await accept(server))
 
-asyncCheck createServer(Port(10335))
-asyncCheck launchSwarm(Port(10335))
-while true:
-  poll()
-  if clientCount == swarmSize: break
+proc main =
+  asyncCheck createServer(Port(10335))
+  asyncCheck launchSwarm(Port(10335))
+  while true:
+    poll()
+    if clientCount == swarmSize: break
+
+let mem = getOccupiedMem()
+main()
 
 assert msgCount == swarmSize * messagesToSend
-echo msgCount
+echo "result: ", msgCount
+echo "memory: ", formatSize(getOccupiedMem() - mem)