summary refs log tree commit diff stats
path: root/nimdoc/tester.nim
diff options
context:
space:
mode:
Diffstat (limited to 'nimdoc/tester.nim')
-rw-r--r--nimdoc/tester.nim11
1 files changed, 10 insertions, 1 deletions
diff --git a/nimdoc/tester.nim b/nimdoc/tester.nim
index 32dce0709..ef82ae1b9 100644
--- a/nimdoc/tester.nim
+++ b/nimdoc/tester.nim
@@ -36,7 +36,7 @@ proc testNimDoc(prjDir, docsDir: string; switches: NimSwitches; fixup = false) =
   if nimBuildIndexSwitches != "":
     exec("$1 buildIndex $2" % [nimExe, nimBuildIndexSwitches])
 
-  for expected in walkDirRec(prjDir / "expected/"):
+  for expected in walkDirRec(prjDir / "expected/", checkDir=true):
     let produced = expected.replace('\\', '/').replace("/expected/", "/$1/" % [docsDir])
     if not fileExists(produced):
       echo "FAILURE: files not found: ", produced
@@ -79,5 +79,14 @@ let
                                             "$1/$2" % [test2Dir, test2DocsDir]])
 testNimDoc(test2Dir, test2DocsDir, test2Switches, fixup)
 
+# Test `nim doc` on file with `{.doctype.}` pragma
+let
+  test3PrjDir = "test_doctype"
+  test3PrjName = "test_doctype"
+  test3Dir = baseDir / test3PrjDir
+  test3DocsDir = "htmldocs"
+  test3Switches = NimSwitches(doc: @["$1/$2.nim" % [test3Dir, test3PrjName]])
+testNimDoc(test3Dir, test3DocsDir, test3Switches, fixup)
+
 if failures > 0:
   quit "$# failures occurred; see note in nimdoc/tester.nim regarding -d:nimTestsNimdocFixup" %  $failures