workaround for nim devel in ci

This commit is contained in:
jangko 2023-02-14 09:14:47 +07:00
parent fe3650ceea
commit bed1d50a45
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
4 changed files with 32 additions and 11 deletions

View File

@ -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

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
nimcache/
docs/
/nimble.develop
*.exe
test_results.xml

View File

@ -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

View File

@ -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)