remove nim 1.2 and 1.4 support
This commit is contained in:
parent
b178f47527
commit
21ed62449d
|
@ -23,7 +23,7 @@ jobs:
|
|||
cpu: amd64
|
||||
#- os: windows
|
||||
#cpu: i386
|
||||
branch: [version-1-2, version-1-4, version-1-6, version-2-0, devel]
|
||||
branch: [version-1-6, version-2-0, devel]
|
||||
include:
|
||||
- target:
|
||||
os: linux
|
||||
|
|
|
@ -56,12 +56,8 @@ proc defectiveRobot() =
|
|||
of 3: raise newException(IOError, "I can't do that Dave.")
|
||||
else: assert 2 + 2 == 5
|
||||
test "unittest expect":
|
||||
when (NimMajor, NimMinor) >= (1, 6):
|
||||
expect IOError, OSError, ValueError, AssertionDefect:
|
||||
defectiveRobot()
|
||||
else:
|
||||
expect IOError, OSError, ValueError, AssertionError:
|
||||
defectiveRobot()
|
||||
expect CatchableError:
|
||||
if true: raise CatchableError.newException("Okay")
|
||||
expect CatchableError, ValueError:
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
# (c) Copyright 2021-Onwards Status Research and Development
|
||||
#
|
||||
|
||||
when (NimMajor, NimMinor) < (1, 4):
|
||||
{.push raises: [Defect].}
|
||||
else:
|
||||
{.push raises: [].}
|
||||
|
||||
## :Authors: Zahary Karadjov, Ștefan Talpalaru
|
||||
|
@ -156,7 +153,6 @@ when declared(stdout):
|
|||
else:
|
||||
const paralleliseTests* = false
|
||||
|
||||
when (NimMajor, NimMinor) > (1, 2):
|
||||
from std/exitprocs import nil
|
||||
template addExitProc(p: proc) =
|
||||
when defined(nimHasWarnBareExcept):
|
||||
|
@ -170,9 +166,6 @@ when (NimMajor, NimMinor) > (1, 2):
|
|||
|
||||
when defined(nimHasWarnBareExcept):
|
||||
{.warning[BareExcept]:on.}
|
||||
else:
|
||||
template addExitProc(p: proc) =
|
||||
addQuitProc(p)
|
||||
|
||||
when paralleliseTests:
|
||||
import threadpool
|
||||
|
@ -187,10 +180,7 @@ when paralleliseTests:
|
|||
proc repeatableSync*() =
|
||||
sync()
|
||||
for flowVar in flowVars:
|
||||
when (NimMajor, NimMinor, NimPatch) >= (1, 4, 0):
|
||||
blockUntil(flowVar[])
|
||||
else:
|
||||
blockUntil(flowVar)
|
||||
flowVars = @[]
|
||||
|
||||
# make sure all the spawned tests are done before exiting
|
||||
|
@ -369,11 +359,6 @@ method suiteStarted*(formatter: ConsoleOutputFormatter, suiteName: string) =
|
|||
template rawPrint() = echo("\n[Suite] ", suiteName)
|
||||
when useTerminal:
|
||||
if formatter.colorOutput:
|
||||
when (NimMajor, NimMinor) < (1, 4) and defined(windows):
|
||||
try:
|
||||
styledEcho styleBright, fgBlue, "\n[Suite] ", resetStyle, suiteName
|
||||
except Exception: rawPrint() # Work around exceptions in `terminal.nim`
|
||||
else:
|
||||
try:
|
||||
styledEcho styleBright, fgBlue, "\n[Suite] ", resetStyle, suiteName
|
||||
except CatchableError: rawPrint() # Work around exceptions in `terminal.nim`
|
||||
|
@ -419,12 +404,6 @@ method testEnded*(formatter: ConsoleOutputFormatter, testResult: TestResult) =
|
|||
of TestStatus.OK: fgGreen
|
||||
of TestStatus.FAILED: fgRed
|
||||
of TestStatus.SKIPPED: fgYellow
|
||||
when (NimMajor, NimMinor) < (1, 4) and defined(windows):
|
||||
try:
|
||||
styledEcho styleBright, color, testHeader,
|
||||
resetStyle, testResult.testName
|
||||
except Exception: rawPrint() # Work around exceptions in `terminal.nim`
|
||||
else:
|
||||
try:
|
||||
styledEcho styleBright, color, testHeader,
|
||||
resetStyle, testResult.testName
|
||||
|
@ -1019,9 +998,6 @@ macro expect*(exceptions: varargs[typed], body: untyped): untyped =
|
|||
of 3: raise newException(IOError, "I can't do that Dave.")
|
||||
else: assert 2 + 2 == 5
|
||||
|
||||
when (NimMajor, NimMinor, NimPatch) < (1, 4, 0):
|
||||
type AssertionDefect = AssertionError
|
||||
|
||||
expect IOError, OSError, ValueError, AssertionDefect:
|
||||
defectiveRobot()
|
||||
|
||||
|
|
Loading…
Reference in New Issue