summary refs log tree commit diff stats
path: root/web
Commit message (Collapse)AuthorAgeFilesLines
* improve documentation for 'var T return values'; refs #7373Andreas Rumpf2018-04-211-1/+1
|
* Support code hot reloading for JavaScript projects (#7362)zah2018-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | * Support code hot reloading for JavaScript projects * Add some missing JavaScript symbols and APIs * fix the Travis build * (review changes) remove the js type from the standard library as it doesn't follow NEP-1 * more additions to the DOM module * Follow NEP-1 in jsffi; spell 'hot code reloading' correctly * introduce a jscore module * Document jscore module. * readded js type * Remove the '$' operator that doesn't behave
* renamed future.nim to sugar.nimAraq2018-04-061-1/+1
|
* Added asyncfutures docAndrea Ferretti2018-03-301-1/+1
|
* Update website.iniAndrea Ferretti2018-03-301-1/+1
|
* yet another documentation fixAraq2018-03-061-1/+1
|
* more documentation fixesAraq2018-03-051-2/+2
|
* Move joyent_http_parser out of stdlib.Dominik Picheta2018-02-171-1/+0
|
* Fixes #5786.Dominik Picheta2018-02-171-1/+0
|
* move new sha1 module into the new 'std' namespaceAndreas Rumpf2018-02-061-1/+1
|
* fixes #6961Andreas Rumpf2018-02-021-1/+1
|
* Add a shared collections to the docsdata-man2018-01-021-0/+1
|
* move securehash back into the stdlibAraq2017-12-211-1/+1
|
* added asyncjs standard library module (#6841)Alexander Ivanov2017-12-191-1/+1
|
* added new stdlib module 'strformat'; refs #5600; refs #6507Araq2017-12-171-1/+1
|
* fixes #6033Araq2017-12-141-1/+1
|
* Remove link to ioselectors, link lenientops (#6790)Lynn C. Rees2017-11-241-1/+1
|
* Add ioselectors to doc index (#6657)Lynn C. Rees2017-11-151-1/+1
|
* Link to segfaults in docs (#6645)Lynn C. Rees2017-11-101-0/+1
|
* Add heapqueue module to doc index (#6655)Lynn C. Rees2017-11-101-0/+1
| | | Add copyright header to heapqueue modlue
* Add chains module to doc index (#6656)Lynn C. Rees2017-11-101-1/+1
|
* Remove libuv from standard library wrappers. (#6624)treeform2017-11-061-1/+1
|
* Link unlinked stdlib modules to doc index (#6672)Lynn C. Rees2017-11-021-0/+1
|
* Add jsconsole to doc index (#6658)Lynn C. Rees2017-11-011-1/+1
|
* Add oswalkdir to doc index (#6651)Lynn C. Rees2017-11-011-1/+1
|
* documentation: add 'sexp' moduleAraq2017-10-161-1/+1
|
* @dom96's comments: remove bountysource, revert configurator change.Daniil Yarancev2017-10-142-141/+0
|
* [JSON] getBVal -> getBool; getFNum -> getFloatDaniil Yarancev2017-10-141-4/+4
|
* make nimblepkglist tool work with newer versions of the websiteAraq2017-07-201-1/+2
|
* Merge branch 'araq2' into develAraq2017-05-171-2/+2
|\
| * Merge branch 'zahary' into araq2Andreas Rumpf2017-05-171-2/+2
| |\
| | * close #5757Zahary Karadjov2017-04-301-2/+0
| | |
| | * close #5726Zahary Karadjov2017-04-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turned out that the old code was wrong. I'm not sure why it used to work. `response.body` properly resolves to an async proc defined in the httpclient module with the following signature: proc body*(response: AsyncResponse): Future[string] {.async.} Perhaps the old code was somehow matching the body field of the `AsyncResponse` object, which is marked as private.
* | | More bug fixes added to list in release notes.Dominik Picheta2017-05-161-0/+119
| | |
* | | Merge pull request #5748 from J3RN/meet-xdg-base-directory-specDominik Picheta2017-05-161-0/+4
|\ \ \ | |/ / |/| | Modified ospath's getConfigDir to meet XDG spec
| * | Added getConfigDir changes to breaking changes docJonathan Arnett2017-04-281-0/+4
| | |
* | | fixed macros.getTypeImpl for a symbol of type tyGenericBody (#5788) (#5812)jcosborn2017-05-141-0/+2
| | | | | | | | | | | | | | | * fixed macros.getTypeImpl for a symbol of type tyGenericBody * added test case and commented test code
* | | Implement dial, support IPv6 in httpclient (#5763)Ruslan Mustakov2017-05-021-1/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement dial, support IPv6 in httpclient Added ``dial`` procedure to networking modules: ``net``, ``asyncdispatch``, ``asyncnet``. It merges socket creation, address resolution, and connection into single step. When using ``dial``, you don't have to worry about IPv4 vs IPv6 problem. Fixed addrInfo loop in connect to behave properly. Previously it would stop on first non-immediate failure, instead of continuing and trying the remaining addresses. Fixed newAsyncNativeSocket to raise proper error if socket creation fails. Fixes: #3811 * Check domain during connect() only on non-Windows This is how it was in the previous implementation of connect(). * Call 'osLastError' before 'close' in net.dial * Record osLastError before freeAddrInfo in net.dial * Add missing docs for 'dial' proc * Optimize dial to create one FD per domain, add tests And make async IPv6 servers work on Windows. * Add IPv6 test to uri module * Fix getAddrString error handling
* | Document breaking AsyncResponse change. Refs #5726.Dominik Picheta2017-04-281-0/+3
| |
* | WIFSIGNALED means process has exited too (with a bang!) (#5678)Jacek Sieka2017-04-271-0/+2
|/
* News items for previous commitZahary Karadjov2017-04-061-1/+7
|
* make tests green againAndreas Rumpf2017-04-041-1/+1
|
* remove the need for the .procvar annotationAndreas Rumpf2017-04-031-0/+6
|
* remove en-dash from the languageAndreas Rumpf2017-04-021-0/+2
|
* language addition: colon-block for expressions in let/var contextAndreas Rumpf2017-04-021-0/+13
|
* updated news to take PR #5390 into accountAraq2017-03-311-0/+2
|
* Merge branch 'devel' into araqAndreas Rumpf2017-03-301-13/+7
|\
| * website update; fixes #5422Araq2017-03-301-13/+7
| |
* | attempt to make travis OSX tests green and mandatoryAndreas Rumpf2017-03-291-1/+1
|/
* fixes #5599 (#5610)Andreas Rumpf2017-03-261-0/+3
|
pan class="w"> TSpec = let nimcache = nimcacheDir(filename, options, target) let options = options & " --nimCache:" & nimcache.quoteShell & extraOptions let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target], "options", options, "file", filename.quoteShell, "filedir", filename.getFileDir()]) var p = startProcess(command=c[0], args=c[1.. ^1], options={poStdErrToStdOut, poUsePath}) let outp = p.outputStream var suc = "" var err = "" var tmpl = "" var x = newStringOfCap(120) result.nimout = "" while outp.readLine(x.TaintedString) or running(p): result.nimout.add(x & "\n") if x =~ pegOfInterest: # `err` should contain the last error/warning message err = x elif x =~ pegLineTemplate and err == "": # `tmpl` contains the last template expansion before the error tmpl = x elif x =~ pegSuccess: suc = x close(p) result.msg = "" result.file = "" result.outp = "" result.line = 0 result.column = 0 result.tfile = "" result.tline = 0 result.tcolumn = 0 if tmpl =~ pegLineTemplate: result.tfile = extractFilename(matches[0]) result.tline = parseInt(matches[1]) result.tcolumn = parseInt(matches[2]) if err =~ pegLineError: result.file = extractFilename(matches[0]) result.line = parseInt(matches[1]) result.column = parseInt(matches[2]) result.msg = matches[3] elif err =~ pegOtherError: result.msg = matches[0] elif suc =~ pegSuccess: result.err = reSuccess proc callCCompiler(cmdTemplate, filename, options: string, target: TTarget): TSpec = let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target], "options", options, "file", filename.quoteShell, "filedir", filename.getFileDir()]) var p = startProcess(command="gcc", args=c[5.. ^1], options={poStdErrToStdOut, poUsePath}) let outp = p.outputStream var x = newStringOfCap(120) result.nimout = "" result.msg = "" result.file = "" result.outp = "" result.line = -1 while outp.readLine(x.TaintedString) or running(p): result.nimout.add(x & "\n") close(p) if p.peekExitCode == 0: result.err = reSuccess proc initResults: TResults = result.total = 0 result.passed = 0 result.skipped = 0 result.data = "" proc readResults(filename: string): TResults = result = marshal.to[TResults](readFile(filename).string) proc writeResults(filename: string, r: TResults) = writeFile(filename, $$r) proc `$`(x: TResults): string = result = ("Tests passed: $1 / $3 <br />\n" & "Tests skipped: $2 / $3 <br />\n") % [$x.passed, $x.skipped, $x.total] proc addResult(r: var TResults, test: TTest, target: TTarget, expected, given: string, success: TResultEnum) = let name = test.name.extractFilename & " " & $target & test.options let duration = epochTime() - test.startTime let durationStr = duration.formatFloat(ffDecimal, precision = 8) backend.writeTestResult(name = name, category = test.cat.string, target = $target, action = $test.action, result = $success, expected = expected, given = given) r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success) if success == reSuccess: styledEcho fgGreen, "PASS: ", fgCyan, alignLeft(name, 60), fgBlue, " (", durationStr, " secs)" elif success == reIgnored: styledEcho styleDim, fgYellow, "SKIP: ", styleBright, fgCyan, name else: styledEcho styleBright, fgRed, "FAIL: ", fgCyan, name styledEcho styleBright, fgCyan, "Test \"", test.name, "\"", " in category \"", test.cat.string, "\"" styledEcho styleBright, fgRed, "Failure: ", $success styledEcho fgYellow, "Expected:" styledEcho styleBright, expected, "\n" styledEcho fgYellow, "Gotten:" styledEcho styleBright, given, "\n" if existsEnv("APPVEYOR"): let (outcome, msg) = if success == reSuccess: ("Passed", "") elif success == reIgnored: ("Skipped", "") else: ("Failed", "Failure: " & $success & "\nExpected:\n" & expected & "\n\n" & "Gotten:\n" & given) var p = startProcess("appveyor", args=["AddTest", test.name.replace("\\", "/") & test.options, "-Framework", "nim-testament", "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams}) discard waitForExit(p) close(p) proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest, target: TTarget) = if strip(expected.msg) notin strip(given.msg): r.addResult(test, target, expected.msg, given.msg, reMsgsDiffer) elif expected.nimout.len > 0 and expected.nimout.normalizeMsg notin given.nimout.normalizeMsg: r.addResult(test, target, expected.nimout, given.nimout, reMsgsDiffer) elif expected.tfile == "" and extractFilename(expected.file) != extractFilename(given.file) and "internal error:" notin expected.msg: r.addResult(test, target, expected.file, given.file, reFilesDiffer) elif expected.line != given.line and expected.line != 0 or expected.column != given.column and expected.column != 0: r.addResult(test, target, $expected.line & ':' & $expected.column, $given.line & ':' & $given.column, reLinesDiffer) elif expected.tfile != "" and extractFilename(expected.tfile) != extractFilename(given.tfile) and "internal error:" notin expected.msg: r.addResult(test, target, expected.tfile, given.tfile, reFilesDiffer) elif expected.tline != given.tline and expected.tline != 0 or expected.tcolumn != given.tcolumn and expected.tcolumn != 0: r.addResult(test, target, $expected.tline & ':' & $expected.tcolumn, $given.tline & ':' & $given.tcolumn, reLinesDiffer) else: r.addResult(test, target, expected.msg, given.msg, reSuccess) inc(r.passed) proc generatedFile(test: TTest, target: TTarget): string = let (_, name, _) = test.name.splitFile let ext = targetToExt[target] result = nimcacheDir(test.name, test.options, target) / (if target == targetJS: "" else: "compiler_") & name.changeFileExt(ext) proc needsCodegenCheck(spec: TSpec): bool = result = spec.maxCodeSize > 0 or spec.ccodeCheck.len > 0 proc codegenCheck(test: TTest, target: TTarget, spec: TSpec, expectedMsg: var string, given: var TSpec) = try: let genFile = generatedFile(test, target) let contents = readFile(genFile).string let check = spec.ccodeCheck if check.len > 0: if check[0] == '\\': # little hack to get 'match' support: if not contents.match(check.peg): given.err = reCodegenFailure elif contents.find(check.peg) < 0: given.err = reCodegenFailure expectedMsg = check if spec.maxCodeSize > 0 and contents.len > spec.maxCodeSize: given.err = reCodegenFailure given.msg = "generated code size: " & $contents.len expectedMsg = "max allowed size: " & $spec.maxCodeSize except ValueError: given.err = reInvalidPeg echo getCurrentExceptionMsg() except IOError: given.err = reCodeNotFound proc nimoutCheck(test: TTest; expectedNimout: string; given: var TSpec) = let exp = expectedNimout.strip.replace("\C\L", "\L") let giv = given.nimout.strip.replace("\C\L", "\L") if exp notin giv: given.err = reMsgsDiffer proc makeDeterministic(s: string): string = var x = splitLines(s) sort(x, system.cmp) result = join(x, "\n") proc compilerOutputTests(test: TTest, target: TTarget, given: var TSpec, expected: TSpec; r: var TResults) = var expectedmsg: string = "" var givenmsg: string = "" if given.err == reSuccess: if expected.needsCodegenCheck: codegenCheck(test, target, expected, expectedmsg, given) givenmsg = given.msg if expected.nimout.len > 0: expectedmsg = expected.nimout givenmsg = given.nimout.strip nimoutCheck(test, expectedmsg, given) else: givenmsg = given.nimout.strip if given.err == reSuccess: inc(r.passed) r.addResult(test, target, expectedmsg, givenmsg, given.err) proc testSpec(r: var TResults, test: TTest, target = targetC) = let tname = test.name.addFileExt(".nim") #echo "TESTING ", tname var expected: TSpec if test.action != actionRunNoSpec: expected = parseSpec(tname) else: specDefaults expected expected.action = actionRunNoSpec if expected.err == reIgnored: r.addResult(test, target, "", "", reIgnored) inc(r.skipped) inc(r.total) return if expected.targets == {}: expected.targets.incl(target) for target in expected.targets: inc(r.total) if target notin targets: r.addResult(test, target, "", "", reIgnored) inc(r.skipped) continue case expected.action of actionCompile: var given = callCompiler(expected.cmd, test.name, test.options, target, extraOptions=" --stdout --hint[Path]:off --hint[Processing]:off") compilerOutputTests(test, target, given, expected, r) of actionRun, actionRunNoSpec: # In this branch of code "early return" pattern is clearer than deep # nested conditionals - the empty rows in between to clarify the "danger" var given = callCompiler(expected.cmd, test.name, test.options, target) if given.err != reSuccess: r.addResult(test, target, "", given.msg, given.err) continue let isJsTarget = target == targetJS var exeFile: string if isJsTarget: let (_, file, _) = splitFile(tname) exeFile = nimcacheDir(test.name, test.options, target) / file & ".js" else: exeFile = changeFileExt(tname, ExeExt) if not existsFile(exeFile): r.addResult(test, target, expected.outp, "executable not found", reExeNotFound) continue let nodejs = if isJsTarget: findNodeJs() else: "" if isJsTarget and nodejs == "": r.addResult(test, target, expected.outp, "nodejs binary not in PATH", reExeNotFound) continue let exeCmd = (if isJsTarget: nodejs & " " else: "") & exeFile var (buf, exitCode) = execCmdEx(exeCmd, options = {poStdErrToStdOut}) # Treat all failure codes from nodejs as 1. Older versions of nodejs used # to return other codes, but for us it is sufficient to know that it's not 0. if exitCode != 0: exitCode = 1 let bufB = if expected.sortoutput: makeDeterministic(strip(buf.string)) else: strip(buf.string) let expectedOut = strip(expected.outp) if exitCode != expected.exitCode: r.addResult(test, target, "exitcode: " & $expected.exitCode, "exitcode: " & $exitCode & "\n\nOutput:\n" & bufB, reExitCodesDiffer) continue if bufB != expectedOut and expected.action != actionRunNoSpec: if not (expected.substr and expectedOut in bufB): given.err = reOutputsDiffer r.addResult(test, target, expected.outp, bufB, reOutputsDiffer) continue compilerOutputTests(test, target, given, expected, r) continue of actionReject: var given = callCompiler(expected.cmd, test.name, test.options, target) cmpMsgs(r, expected, given, test, target) continue proc testNoSpec(r: var TResults, test: TTest, target = targetC) = # does not extract the spec because the file is not supposed to have any #let tname = test.name.addFileExt(".nim") inc(r.total) let given = callCompiler(cmdTemplate(), test.name, test.options, target) r.addResult(test, target, "", given.msg, given.err) if given.err == reSuccess: inc(r.passed) proc testC(r: var TResults, test: TTest) = # runs C code. Doesn't support any specs, just goes by exit code. let tname = test.name.addFileExt(".c") inc(r.total) styledEcho "Processing ", fgCyan, extractFilename(tname) var given = callCCompiler(cmdTemplate(), test.name & ".c", test.options, targetC) if given.err != reSuccess: r.addResult(test, targetC, "", given.msg, given.err) elif test.action == actionRun: let exeFile = changeFileExt(test.name, ExeExt) var (_, exitCode) = execCmdEx(exeFile, options = {poStdErrToStdOut, poUsePath}) if exitCode != 0: given.err = reExitCodesDiffer if given.err == reSuccess: inc(r.passed) proc makeTest(test, options: string, cat: Category, action = actionCompile, env: string = ""): TTest = # start with 'actionCompile', will be overwritten in the spec: result = TTest(cat: cat, name: test, options: options, action: action, startTime: epochTime()) when defined(windows): const # array of modules disabled from compilation test of stdlib. disabledFiles = ["coro.nim", "fsmonitor.nim"] else: const # array of modules disabled from compilation test of stdlib. disabledFiles = ["-"] include categories # proc runCaasTests(r: var TResults) = # for test, output, status, mode in caasTestsRunner(): # r.addResult(test, "", output & "-> " & $mode, # if status: reSuccess else: reOutputsDiffer) proc main() = os.putenv "NIMTEST_NO_COLOR", "1" os.putenv "NIMTEST_OUTPUT_LVL", "PRINT_FAILURES" backend.open() var optPrintResults = false var optFailing = false var targetsStr = "" var p = initOptParser() p.next() while p.kind == cmdLongoption: case p.key.string.normalize of "print", "verbose": optPrintResults = true of "failing": optFailing = true of "pedantic": discard "now always enabled" of "targets": targetsStr = p.val.string targets = parseTargets(targetsStr) of "nim": compilerPrefix = p.val.string else: quit Usage p.next() if p.kind != cmdArgument: quit Usage var action = p.key.string.normalize p.next() var r = initResults() case action of "all": let testsDir = "tests" & DirSep var myself = quoteShell(findExe("tests" / "testament" / "tester")) if targetsStr.len > 0: myself &= " " & quoteShell("--targets:" & targetsStr) myself &= " " & quoteShell("--nim:" & compilerPrefix) var cmds: seq[string] = @[] let rest = if p.cmdLineRest.string.len > 0: " " & p.cmdLineRest.string else: "" for kind, dir in walkDir(testsDir): assert testsDir.startsWith(testsDir) let cat = dir[testsDir.len .. ^1] if kind == pcDir and cat notin ["testament", "testdata", "nimcache"]: cmds.add(myself & " cat " & cat & rest) for cat in AdditionalCategories: cmds.add(myself & " cat " & cat & rest) quit osproc.execProcesses(cmds, {poEchoCmd, poStdErrToStdOut, poUsePath, poParentStreams}) of "c", "cat", "category": var cat = Category(p.key) p.next processCategory(r, cat, p.cmdLineRest.string) of "r", "run": let (dir, file) = splitPath(p.key.string) let (_, subdir) = splitPath(dir) var cat = Category(subdir) processSingleTest(r, cat, p.cmdLineRest.string, file) of "html": generateHtml(resultsFile, optFailing) else: quit Usage if optPrintResults: if action == "html": openDefaultBrowser(resultsFile) else: echo r, r.data backend.close() var failed = r.total - r.passed - r.skipped if failed != 0: echo "FAILURE! total: ", r.total, " passed: ", r.passed, " skipped: ", r.skipped quit(QuitFailure) if paramCount() == 0: quit Usage main()