mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-08 04:44:20 +00:00
fixup
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os, strutils
|
||||
from std/private/gitutils import diffFiles
|
||||
|
||||
const
|
||||
baseDir = "nimdoc/rst2html"
|
||||
@@ -19,7 +20,7 @@ proc testRst2Html(fixup = false) =
|
||||
exec("$1 rst2html $2" % [nimExe, sourceFile])
|
||||
let producedHtml = expectedHtml.replace('\\', '/').replace("/expected/", "/source/htmldocs/")
|
||||
if readFile(expectedHtml) != readFile(producedHtml):
|
||||
discard execShellCmd("diff -uNdr " & expectedHtml & " " & producedHtml)
|
||||
echo diffFiles(expectedHtml, producedHtml).output
|
||||
inc failures
|
||||
if fixup:
|
||||
copyFile(producedHtml, expectedHtml)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# to change expected results (after carefully verifying everything), use -d:fixup
|
||||
|
||||
import strutils, os
|
||||
from std/private/gitutils import diffFiles
|
||||
|
||||
var
|
||||
failures = 0
|
||||
@@ -40,7 +41,7 @@ proc testNimDoc(prjDir, docsDir: string; switches: NimSwitches; fixup = false) =
|
||||
inc failures
|
||||
elif readFile(expected) != readFile(produced):
|
||||
echo "FAILURE: files differ: ", produced
|
||||
discard execShellCmd("diff -uNdr " & expected & " " & produced)
|
||||
echo diffFiles(expected, produced).output
|
||||
inc failures
|
||||
if fixup:
|
||||
copyFile(produced, expected)
|
||||
|
||||
Reference in New Issue
Block a user