diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5991ee8..bf05689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,6 +156,16 @@ jobs: - name: Run tests run: | nim --version - env TEST_LANG="c" nim --hints:off --verbosity:0 test - env TEST_LANG="cpp" nim --hints:off --verbosity:0 test - + env TEST_LANG="c" NIMFLAGS="${NIMFLAGS} --gc:refc" nim test + env TEST_LANG="cpp" NIMFLAGS="${NIMFLAGS} --gc:refc" nim test + if [[ "${{ matrix.branch }}" == "devel" ]]; then + echo -e "\nTesting with '--gc:orc':\n" + if env TEST_LANG="c" NIMFLAGS="${NIMFLAGS} --gc:orc" nim test; then + echo "Nim devel with --gc:orc works again! Please remove this check in ci.yml" + false + fi + if env TEST_LANG="cpp" NIMFLAGS="${NIMFLAGS} --gc:orc" nim test; then + echo "Nim devel with --gc:orc works again! Please remove this check in ci.yml" + false + fi + fi diff --git a/.gitignore b/.gitignore index 971c4f7..ae513a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ nimcache/ docs/ /nimble.develop +*.exe +test_results.xml diff --git a/tests/tunittest.nim b/tests/tunittest.nim index 370f753..6ff4dc4 100644 --- a/tests/tunittest.nim +++ b/tests/tunittest.nim @@ -57,8 +57,12 @@ proc defectiveRobot() = of 3: raise newException(IOError, "I can't do that Dave.") else: assert 2 + 2 == 5 test "unittest expect": - expect IOError, OSError, ValueError, AssertionError: - defectiveRobot() + when (NimMajor, NimMinor) >= (1, 6): + expect IOError, OSError, ValueError, AssertionDefect: + defectiveRobot() + else: + expect IOError, OSError, ValueError, AssertionError: + defectiveRobot() var a = 1 diff --git a/unittest2.nim b/unittest2.nim index a66bfee..063c2ef 100644 --- a/unittest2.nim +++ b/unittest2.nim @@ -131,6 +131,8 @@ import std/[locks, macros, sets, strutils, streams, times, monotimes] +{.warning[LockLevel]:off.} + when declared(stdout): import std/os @@ -155,13 +157,16 @@ when (NimMajor, NimMinor) > (1, 2): from std/exitprocs import nil template addExitProc(p: proc) = when (NimMajor, NimMinor) >= (1, 6): + {.warning[BareExcept]:off.} + + try: exitprocs.addExitProc(p) - else: - try: - exitprocs.addExitProc(p) - except Exception as e: - echo "Can't add exit proc", e.msg - quit(1) + except Exception as e: + echo "Can't add exit proc", e.msg + quit(1) + + when (NimMajor, NimMinor) >= (1, 6): + {.warning[BareExcept]:on.} else: template addExitProc(p: proc) = addQuitProc(p)