Skip to content

Commit 451c8d6

Browse files
authored
test: add utils dir (#1858)
1 parent e43c3ce commit 451c8d6

File tree

8 files changed

+28
-14
lines changed

8 files changed

+28
-14
lines changed

tests/testnative.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{.used.}
1111

1212
import ./tools/test_all
13+
import ./utils/test_all
1314
import ./crypto/test_all
1415
import ./stream/test_all
1516
import ./transports/test_all
@@ -18,8 +19,7 @@ import ./kademlia/test_all
1819
import ./mix/test_all
1920

2021
import
21-
testvarint, testminprotobuf, testsemaphore, testheartbeat, testfuture, testzeroqueue,
22-
testbytesview, testmultibase, testmultihash, testmultiaddress, testipaddr, testcid,
22+
testvarint, testminprotobuf, testmultibase, testmultihash, testmultiaddress, testcid,
2323
testpeerid, testsigned_envelope, testrouting_record, testnameresolve, testmultistream,
2424
testidentify, testobservedaddrmanager, testconnmngr, testswitch, testnoise,
2525
testpeerinfo, testpeerstore, testping, testmplex, testrelayv1, testrelayv2, testyamux,

tests/utils/test_all.nim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Nim-LibP2P
2+
# Copyright (c) 2023-2025 Status Research & Development GmbH
3+
# Licensed under either of
4+
# * Apache License, version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
5+
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
6+
# at your option.
7+
# This file may not be copied, modified, or distributed except according to
8+
# those terms.
9+
10+
{.used.}
11+
12+
import
13+
test_bytesview, test_future, test_heartbeat, test_ipaddr, test_semaphore,
14+
test_zeroqueue

tests/testbytesview.nim renamed to tests/utils/test_bytesview.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
{.used.}
1111

12-
import ../libp2p/utils/bytesview
13-
import ./tools/[unittest]
12+
import ../../libp2p/utils/bytesview
13+
import ../tools/[unittest]
1414

1515
suite "BytesView":
1616
test "basics":

tests/testfuture.nim renamed to tests/utils/test_future.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{.used.}
1111

1212
import chronos
13-
import ../libp2p/utils/future
14-
import ./tools/[unittest]
13+
import ../../libp2p/utils/future
14+
import ../tools/[unittest]
1515

1616
suite "Future":
1717
asyncTest "anyCompleted must complete with first completed future":

tests/testheartbeat.nim renamed to tests/utils/test_heartbeat.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# (up to 7 ms), so we skip test there
1414
when not defined(macosx):
1515
import chronos
16-
import ../libp2p/utils/heartbeat
17-
import ./tools/[unittest]
16+
import ../../libp2p/utils/heartbeat
17+
import ../tools/[unittest]
1818

1919
suite "Heartbeat":
2020
asyncTest "simple heartbeat":

tests/testipaddr.nim renamed to tests/utils/test_ipaddr.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{.used.}
1111

1212
import chronos, std/options
13-
import ../libp2p/[multiaddress, utils/ipaddr]
14-
import ./tools/[unittest]
13+
import ../../libp2p/[multiaddress, utils/ipaddr]
14+
import ../tools/[unittest]
1515

1616
suite "IpAddr Utils":
1717
teardown:

tests/testsemaphore.nim renamed to tests/utils/test_semaphore.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{.used.}
1111

1212
import chronos, random
13-
import ../libp2p/utils/semaphore
14-
import ./tools/[unittest]
13+
import ../../libp2p/utils/semaphore
14+
import ../tools/[unittest]
1515

1616
randomize()
1717

tests/testzeroqueue.nim renamed to tests/utils/test_zeroqueue.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
{.used.}
1111

12-
import ../libp2p/utils/zeroqueue
13-
import ./tools/[unittest]
12+
import ../../libp2p/utils/zeroqueue
13+
import ../tools/[unittest]
1414

1515
proc toSeq(p: pointer, length: int): seq[byte] =
1616
let b = cast[ptr UncheckedArray[byte]](p)

0 commit comments

Comments
 (0)