Merge branch 'devel' into araq-big-refactoring

This commit is contained in:
Andreas Rumpf 2018-05-28 12:13:50 +02:00
commit afdd77363e
8 changed files with 36 additions and 12 deletions

View file

@ -803,6 +803,7 @@ proc acceptAddr*(server: Socket, client: var Socket, address: var string,
else:
address = ret[1]
client.fd = sock
client.domain = getSockDomain(sock)
client.isBuffered = server.isBuffered
# Handle SSL.

View file

@ -70,7 +70,8 @@ when defined(windows):
proc existsFile*(filename: string): bool {.rtl, extern: "nos$1",
tags: [ReadDirEffect].} =
## Returns true if the file exists, false otherwise.
## Returns true if `filename` exists and is a regular file or symlink.
## (directories, device files, named pipes and sockets return false)
when defined(windows):
when useWinUnicode:
wrapUnary(a, getFileAttributesW, filename)

View file

@ -462,6 +462,8 @@ template suite*(name, body) {.dirty.} =
finally:
suiteEnded()
template exceptionTypeName(e: typed): string = $e.name
template test*(name, body) {.dirty.} =
## Define a single test case identified by `name`.
##
@ -476,7 +478,7 @@ template test*(name, body) {.dirty.} =
## .. code-block::
##
## [OK] roses are red
bind shouldRun, checkpoints, formatters, ensureInitialized, testEnded
bind shouldRun, checkpoints, formatters, ensureInitialized, testEnded, exceptionTypeName
ensureInitialized()
@ -495,8 +497,10 @@ template test*(name, body) {.dirty.} =
except:
when not defined(js):
checkpoint("Unhandled exception: " & getCurrentExceptionMsg())
var stackTrace {.inject.} = getCurrentException().getStackTrace()
let e = getCurrentException()
let eTypeDesc = "[" & exceptionTypeName(e) & "]"
checkpoint("Unhandled exception: " & getCurrentExceptionMsg() & " " & eTypeDesc)
var stackTrace {.inject.} = e.getStackTrace()
fail()
finally: