diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-05-20 00:45:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 09:45:34 +0200 |
commit | 3d20f141939b0cb76079a9b0ae7784f7877f1698 (patch) | |
tree | ff6c7b9943309b0df409be3c15143ffad56b0e9f /nimdoc | |
parent | 4ae341353de5c58dc339e47b0eec2bbb4649dc10 (diff) | |
download | Nim-3d20f141939b0cb76079a9b0ae7784f7877f1698.tar.gz |
fix #10731 ; `runnableExamples "-b:cpp --run:off": code` works (#14384)
* runnableExamples "-b:cpp -r:off": code
Diffstat (limited to 'nimdoc')
-rw-r--r-- | nimdoc/tester.nim | 5 | ||||
-rw-r--r-- | nimdoc/testproject/expected/testproject.html | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/nimdoc/tester.nim b/nimdoc/tester.nim index a1500455e..58272a9b6 100644 --- a/nimdoc/tester.nim +++ b/nimdoc/tester.nim @@ -24,12 +24,13 @@ proc testNimDoc(prjDir, docsDir: string; switches: NimSwitches; fixup = false) = nimBuildIndexSwitches = switches.buildIndex.join(" ") putEnv("SOURCE_DATE_EPOCH", "100000") + const nimExe = getCurrentCompilerExe() # so that `bin/nim_temp r nimdoc/tester.nim` works if nimDocSwitches != "": - exec("nim doc $1" % [nimDocSwitches]) + exec("$1 doc $2" % [nimExe, nimDocSwitches]) if nimBuildIndexSwitches != "": - exec("nim buildIndex $1" % [nimBuildIndexSwitches]) + exec("$1 buildIndex $2" % [nimExe, nimBuildIndexSwitches]) for expected in walkDirRec(prjDir / "expected/"): let produced = expected.replace('\\', '/').replace("/expected/", "/$1/" % [docsDir]) diff --git a/nimdoc/testproject/expected/testproject.html b/nimdoc/testproject/expected/testproject.html index 77f178265..4eb8ed44c 100644 --- a/nimdoc/testproject/expected/testproject.html +++ b/nimdoc/testproject/expected/testproject.html @@ -183,7 +183,7 @@ function main() { <div id="tocRoot"></div> <p class="module-desc">This is the top level module. -<p><strong class="examples_text">Examples:</strong></p> +<p><strong class="examples_text">Example:</strong></p> <pre class="listing"><span class="Keyword">import</span> <span class="Identifier">subdir</span> <span class="Operator">/</span> <span class="Identifier">subdir_b</span> <span class="Operator">/</span> <span class="Identifier">utils</span> |