diff --git a/libp2p.nimble b/libp2p.nimble index def5c4555..f52d2c841 100644 --- a/libp2p.nimble +++ b/libp2p.nimble @@ -10,4 +10,5 @@ skipDirs = @["tests", "Nim"] requires "nim > 0.18.0" task tests, "Runs the test suite": - exec "nim c -r tests/testpbvarint" \ No newline at end of file + exec "nim c -r tests/testpbvarint" + exec "nim c -r tests/testdaemon" \ No newline at end of file diff --git a/tests/testdaemon.nim b/tests/testdaemon.nim new file mode 100644 index 000000000..35e603519 --- /dev/null +++ b/tests/testdaemon.nim @@ -0,0 +1,14 @@ +import unittest +import asyncdispatch2 +import ../libp2p/daemon/daemonapi + +proc identitySpawnTest(): Future[bool] {.async.} = + var api = await newDaemonApi(sockpath = "/tmp/p2pd-1.sock") + var data = await api.identity() + await api.close() + result = true + +when isMainModule: + suite "libp2p-daemon test suite": + test "Simple spawn and get identity test": + waitFor identitySpawnTest() == true