mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-28 18:24:01 +00:00
make tests on Windows green under --pedantic
This commit is contained in:
@@ -630,7 +630,7 @@ proc getch*(): char =
|
||||
when defined(windows):
|
||||
let fd = getStdHandle(STD_INPUT_HANDLE)
|
||||
var keyEvent = KEY_EVENT_RECORD()
|
||||
var numRead: cint
|
||||
var numRead: cint
|
||||
while true:
|
||||
# Block until character is entered
|
||||
doAssert(waitForSingleObject(fd, INFINITE) == WAIT_OBJECT_0)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# fsmonitor test
|
||||
#
|
||||
discard """
|
||||
disabled: windows
|
||||
"""
|
||||
|
||||
import unittest
|
||||
import fsmonitor
|
||||
@@ -9,4 +9,3 @@ suite "fsmonitor":
|
||||
test "should not raise OSError, bug# 3611":
|
||||
let m = newMonitor()
|
||||
m.add("foo", {MonitorCloseWrite, MonitorCloseNoWrite})
|
||||
|
||||
|
||||
@@ -284,9 +284,9 @@ proc compileExample(r: var TResults, pattern, options: string, cat: Category) =
|
||||
testNoSpec r, makeTest(test, options, cat)
|
||||
|
||||
proc testStdlib(r: var TResults, pattern, options: string, cat: Category) =
|
||||
var disabledSet = disabledFiles.toSet()
|
||||
for test in os.walkFiles(pattern):
|
||||
if test notin disabledSet:
|
||||
let name = extractFilename(test)
|
||||
if name notin disabledFiles:
|
||||
let contents = readFile(test).string
|
||||
if contents.contains("when isMainModule"):
|
||||
testSpec r, makeTest(test, options, cat, actionRunNoSpec)
|
||||
|
||||
@@ -108,12 +108,6 @@ proc callCompiler(cmdTemplate, filename, options: string,
|
||||
elif suc =~ pegSuccess:
|
||||
result.err = reSuccess
|
||||
|
||||
if result.err == reNimcCrash and
|
||||
("Your platform is not supported" in result.msg or
|
||||
"cannot open 'sdl'" in result.msg or
|
||||
"cannot open 'opengl'" in result.msg):
|
||||
result.err = reIgnored
|
||||
|
||||
proc callCCompiler(cmdTemplate, filename, options: string,
|
||||
target: TTarget): TSpec =
|
||||
let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target],
|
||||
@@ -393,9 +387,14 @@ proc makeTest(test, options: string, cat: Category, action = actionCompile,
|
||||
result = TTest(cat: cat, name: test, options: options,
|
||||
target: target, action: action, startTime: epochTime())
|
||||
|
||||
const
|
||||
# array of modules disabled from compilation test of stdlib.
|
||||
disabledFiles = ["-"]
|
||||
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
|
||||
|
||||
@@ -460,7 +459,7 @@ proc main() =
|
||||
backend.close()
|
||||
if optPedantic:
|
||||
var failed = r.total - r.passed - r.skipped
|
||||
if failed > 0 : quit(QuitFailure)
|
||||
if failed > 0: quit(QuitFailure)
|
||||
|
||||
if paramCount() == 0:
|
||||
quit Usage
|
||||
|
||||
Reference in New Issue
Block a user