Migrate to `unittest2` (#125)

* Migrate to `unittest2`

why:
  Global symbol overflow when running NIM 1.2 on Github ci suggests that
  unit tests run sort of separately. The replacement library `unittest2`
  provides that.

* Build ci dependencies
This commit is contained in:
Jordan Hrycaj 2022-07-08 10:34:21 +01:00 committed by GitHub
parent 4cab7b0879
commit 9c3596d9de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 32 additions and 28 deletions

View File

@ -155,6 +155,7 @@ jobs:
fi
nim --version
nimble --version
nimble install -y --depsOnly
env TEST_LANG=c nimble test
env TEST_LANG=cpp nimble test
@ -173,5 +174,6 @@ jobs:
- name: Test using VCC
if: runner.os == 'Windows'
run: |
nimble install -y --depsOnly
env TEST_LANG=c nimble testvcc
env TEST_LANG=cpp nimble testvcc

View File

@ -7,7 +7,8 @@ description = "Backports, standard library candidates and small utilities that
license = "Apache License 2.0"
skipDirs = @["tests"]
requires "nim >= 1.2.0"
requires "nim >= 1.2.0",
"unittest2"
### Helper functions
proc test(args, path: string) =

View File

@ -1,5 +1,5 @@
import
random, unittest,
random, unittest2,
../../stew/ranges/bitranges, ../../stew/bitseqs
proc randomBytes(n: int): seq[byte] =

View File

@ -1,5 +1,5 @@
import
unittest, math,
unittest2, math,
../../stew/ptrops,
../../stew/ranges/[stackarrays]

View File

@ -1,5 +1,5 @@
import
unittest, sets,
unittest2, sets,
../../stew/ranges/[typedranges, ptr_arith]
suite "Typed ranges":

View File

@ -10,7 +10,7 @@
{.used.}
import
std/unittest,
unittest2,
../stew/arrayops
suite "arrayops":

View File

@ -1,5 +1,5 @@
import
std/unittest,
unittest2,
../stew/assign2
suite "assign2":

View File

@ -1,4 +1,4 @@
import unittest
import unittest2
import ../stew/base10
when defined(nimHasUsed): {.used.}

View File

@ -1,4 +1,4 @@
import unittest
import unittest2
import ../stew/base32
when defined(nimHasUsed): {.used.}

View File

@ -1,4 +1,4 @@
import unittest
import unittest2
import ../stew/base58
when defined(nimHasUsed): {.used.}

View File

@ -1,4 +1,4 @@
import unittest
import unittest2
import ../stew/[base64, byteutils]
when defined(nimHasUsed): {.used.}

View File

@ -1,4 +1,4 @@
import unittest
import unittest2
import ../stew/bitops2

View File

@ -1,5 +1,5 @@
import
unittest, strformat,
unittest2, strformat,
../stew/[bitseqs]
suite "Bit fields":

View File

@ -6,7 +6,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
std/unittest,
unittest2,
../stew/byteutils
proc compilationTest {.exportc: "compilationTest".} =

View File

@ -1,4 +1,4 @@
import unittest
import unittest2
import ../stew/ctops
suite "Constant-time operations test suite":

View File

@ -1,4 +1,4 @@
import unittest
import unittest2
import ../stew/endians2

View File

@ -10,7 +10,7 @@
# distributed except according to those terms.
import
std/unittest,
unittest2,
../stew/interval_set
const

View File

@ -1,4 +1,4 @@
import unittest
import unittest2
import ../stew/io2
suite "OS Input/Output procedures test suite":

View File

@ -9,7 +9,8 @@
# according to those terms.
import
std/[algorithm, sequtils, strformat, strutils, tables, unittest],
std/[algorithm, sequtils, strformat, strutils, tables],
unittest2,
../stew/keyed_queue,
../stew/keyed_queue/kq_debug

View File

@ -1,5 +1,5 @@
import
unittest, random,
unittest2, random,
../stew/[byteutils, leb128, results]
const edgeValues = {

View File

@ -1,5 +1,5 @@
import
unittest,
unittest2,
../stew/shims/macros

View File

@ -1,5 +1,5 @@
import
unittest, typetraits,
unittest2, typetraits,
../stew/objects
when defined(nimHasUsed):

View File

@ -7,7 +7,7 @@
#
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import unittest
import unittest2
import ../stew/ptrops

View File

@ -6,7 +6,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.
import
std/unittest,
unittest2,
../stew/sequtils2
suite "sequtils2":

View File

@ -1,5 +1,5 @@
import
unittest,
unittest2,
../stew/shims/sets
suite "shims/sets":

View File

@ -11,7 +11,7 @@
import
std/[algorithm, sequtils, strformat, tables],
../stew/sorted_set,
unittest
unittest2
const
keyList = [

View File

@ -1,5 +1,5 @@
import
unittest,
unittest2,
../stew/templateutils
var computations = newSeq[string]()

View File

@ -1,5 +1,5 @@
import
unittest, random,
unittest2, random,
../stew/[varints, byteutils]
const edgeValues = {

View File

@ -1,4 +1,4 @@
import std/unittest
import unittest2
import ../stew/io2
when defined(windows):