Merge remote-tracking branch 'upstream/devel' into devel

This commit is contained in:
deansher
2019-01-29 05:34:09 -05:00
10 changed files with 67 additions and 47 deletions

View File

@@ -42,9 +42,12 @@ before_script:
- cd ..
- export PATH=$(pwd)/bin${PATH:+:$PATH}
- echo PATH:${PATH}
- set +e # prevents breaking after_failure
script:
- echo "travis_fold:start:nim_c_koch"
- nim c koch
- echo "travis_fold:end:nim_c_koch"
- ./koch runCI
before_deploy:
@@ -59,3 +62,6 @@ deploy: # https://nim-lang.github.io/Nim
keep-history: false
on:
branch: devel
# Extract failed tests
after_failure: nim c -r tools/ci_testresults.nim

View File

@@ -38,6 +38,8 @@
- The procs `parseutils.parseBiggsetInt`, `parseutils.parseInt`, `parseutils.parseBiggestUInt` and `parseutils.parseUInt` now raise a `ValueError` when the parsed integer is outside of the valid range. Previously they sometimes raised a `OverflowError` and sometimes returned `0`.
- `streams.StreamObject` now restricts its fields to only raise `system.Defect`, `system.IOError` and `system.OSError`. This change only affects custom stream implementations.
- nre's `RegexMatch.{captureBounds,captures}[]` no longer return `Option` or
`nil`/`""`, respectivly. Use the newly added `n in p.captures` method to
check if a group is captured, otherwise you'll recieve an exception.

View File

@@ -1314,11 +1314,8 @@ dt pre > span.Identifier, dt pre > span.Operator {
color: #155da4;
font-weight: 700; }
dt pre > span.Identifier ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
color: inherit;
font-weight: inherit; }
dt pre > span.Operator ~ span.Identifier {
dt pre > span.Keyword ~ span.Identifier, dt pre > span.Identifier ~ span.Identifier,
dt pre > span.Operator ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
color: inherit;
font-weight: inherit; }

View File

@@ -163,7 +163,7 @@ proc bundleNimsuggest() =
nimCompile("nimsuggest/nimsuggest.nim", options = "-d:release")
proc buildVccTool() =
nimCompile("tools/vccexe/vccexe.nim")
nimCompileFold("Compile Vcc", "tools/vccexe/vccexe.nim")
proc bundleWinTools() =
# TODO: consider building under `bin` instead of `.`
@@ -208,10 +208,10 @@ proc buildTool(toolname, args: string) =
proc buildTools() =
bundleNimsuggest()
nimCompile("tools/nimgrep.nim", options = "-d:release")
nimCompileFold("Compile nimgrep", "tools/nimgrep.nim", options = "-d:release")
when defined(windows): buildVccTool()
nimCompile("nimpretty/nimpretty.nim", options = "-d:release")
nimCompile("tools/nimfind.nim", options = "-d:release")
nimCompileFold("Compile nimpretty", "nimpretty/nimpretty.nim", options = "-d:release")
nimCompileFold("Compile nimfind", "tools/nimfind.nim", options = "-d:release")
proc nsis(latest: bool; args: string) =
bundleNimbleExe(latest)

View File

@@ -45,17 +45,22 @@ type
## here shouldn't be used directly. They are
## accessible so that a stream implementation
## can override them.
closeImpl*: proc (s: Stream) {.nimcall, tags: [], gcsafe.}
atEndImpl*: proc (s: Stream): bool {.nimcall, tags: [], gcsafe.}
setPositionImpl*: proc (s: Stream, pos: int) {.nimcall, tags: [], gcsafe.}
getPositionImpl*: proc (s: Stream): int {.nimcall, tags: [], gcsafe.}
readDataImpl*: proc (s: Stream, buffer: pointer,
bufLen: int): int {.nimcall, tags: [ReadIOEffect], gcsafe.}
peekDataImpl*: proc (s: Stream, buffer: pointer,
bufLen: int): int {.nimcall, tags: [ReadIOEffect], gcsafe.}
writeDataImpl*: proc (s: Stream, buffer: pointer, bufLen: int) {.nimcall,
tags: [WriteIOEffect], gcsafe.}
flushImpl*: proc (s: Stream) {.nimcall, tags: [WriteIOEffect], gcsafe.}
closeImpl*: proc (s: Stream)
{.nimcall, raises: [Defect, IOError, OSError], tags: [], gcsafe.}
atEndImpl*: proc (s: Stream): bool
{.nimcall, raises: [Defect, IOError, OSError], tags: [], gcsafe.}
setPositionImpl*: proc (s: Stream, pos: int)
{.nimcall, raises: [Defect, IOError, OSError], tags: [], gcsafe.}
getPositionImpl*: proc (s: Stream): int
{.nimcall, raises: [Defect, IOError, OSError], tags: [], gcsafe.}
readDataImpl*: proc (s: Stream, buffer: pointer, bufLen: int): int
{.nimcall, raises: [Defect, IOError, OSError], tags: [ReadIOEffect], gcsafe.}
peekDataImpl*: proc (s: Stream, buffer: pointer, bufLen: int): int
{.nimcall, raises: [Defect, IOError, OSError], tags: [ReadIOEffect], gcsafe.}
writeDataImpl*: proc (s: Stream, buffer: pointer, bufLen: int)
{.nimcall, raises: [Defect, IOError, OSError], tags: [WriteIOEffect], gcsafe.}
flushImpl*: proc (s: Stream)
{.nimcall, raises: [Defect, IOError, OSError], tags: [WriteIOEffect], gcsafe.}
proc flush*(s: Stream) =
## flushes the buffers that the stream `s` might use.
@@ -65,10 +70,6 @@ proc close*(s: Stream) =
## closes the stream `s`.
if not isNil(s.closeImpl): s.closeImpl(s)
proc close*(s, unused: Stream) {.deprecated.} =
## closes the stream `s`.
s.closeImpl(s)
proc atEnd*(s: Stream): bool =
## checks if more data can be read from `f`. Returns true if all data has
## been read.
@@ -111,12 +112,6 @@ proc writeData*(s: Stream, buffer: pointer, bufLen: int) =
## to the stream `s`.
s.writeDataImpl(s, buffer, bufLen)
proc writeData*(s, unused: Stream, buffer: pointer,
bufLen: int) {.deprecated.} =
## low level proc that writes an untyped `buffer` of `bufLen` size
## to the stream `s`.
s.writeDataImpl(s, buffer, bufLen)
proc write*[T](s: Stream, x: T) =
## generic write procedure. Writes `x` to the stream `s`. Implementation:
##

View File

@@ -1139,11 +1139,8 @@ dt pre > span.Identifier, dt pre > span.Operator {
color: #155da4;
font-weight: 700; }
dt pre > span.Identifier ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
color: inherit;
font-weight: inherit; }
dt pre > span.Operator ~ span.Identifier {
dt pre > span.Keyword ~ span.Identifier, dt pre > span.Identifier ~ span.Identifier,
dt pre > span.Operator ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
color: inherit;
font-weight: inherit; }

View File

@@ -1139,11 +1139,8 @@ dt pre > span.Identifier, dt pre > span.Operator {
color: #155da4;
font-weight: 700; }
dt pre > span.Identifier ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
color: inherit;
font-weight: inherit; }
dt pre > span.Operator ~ span.Identifier {
dt pre > span.Keyword ~ span.Identifier, dt pre > span.Identifier ~ span.Identifier,
dt pre > span.Operator ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
color: inherit;
font-weight: inherit; }

View File

@@ -1139,11 +1139,8 @@ dt pre > span.Identifier, dt pre > span.Operator {
color: #155da4;
font-weight: 700; }
dt pre > span.Identifier ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
color: inherit;
font-weight: inherit; }
dt pre > span.Operator ~ span.Identifier {
dt pre > span.Keyword ~ span.Identifier, dt pre > span.Identifier ~ span.Identifier,
dt pre > span.Operator ~ span.Identifier, dt pre > span.Operator ~ span.Identifier {
color: inherit;
font-weight: inherit; }

24
tools/ci_testresults.nim Normal file
View File

@@ -0,0 +1,24 @@
## Print summary of failed tests for CI
import os, json, sets, strformat
const skip = toSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
when isMainModule:
for fn in walkFiles("testresults/*.json"):
let entries = fn.readFile().parseJson()
for j in entries:
let res = j["result"].getStr()
if skip.contains(res):
continue
echo fmt """
Category: {j["category"].getStr()}
Name: {j["name"].getStr()}
Action: {j["action"].getStr()}
Result: {res}
-------- Expected -------
{j["expected"].getStr()}
--------- Given --------
{j["given"].getStr()}
-------------------------
"""

View File

@@ -42,10 +42,10 @@ proc execFold*(desc, cmd: string, errorcode: int = QuitFailure, additionalPath =
## Execute shell command. Add log folding on Travis CI.
# https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719
if existsEnv("TRAVIS"):
echo "travis_fold:start:" & desc.replace(" ", "")
echo "travis_fold:start:" & desc.replace(" ", "_")
exec(cmd, errorcode, additionalPath)
if existsEnv("TRAVIS"):
echo "travis_fold:end:" & desc.replace(" ", "")
echo "travis_fold:end:" & desc.replace(" ", "_")
proc execCleanPath*(cmd: string,
additionalPath = ""; errorcode: int = QuitFailure) =
@@ -69,6 +69,11 @@ proc nimCompile*(input: string, outputDir = "bin", mode = "c", options = "") =
let cmd = findNim() & " " & mode & " -o:" & output & " " & options & " " & input
exec cmd
proc nimCompileFold*(desc, input: string, outputDir = "bin", mode = "c", options = "") =
let output = outputDir / input.splitFile.name.exe
let cmd = findNim() & " " & mode & " -o:" & output & " " & options & " " & input
execFold(desc, cmd)
const
pdf = """
doc/manual.rst