summary refs log tree commit diff stats
path: root/tests/misc/trunner.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-01-02 12:41:44 -0800
committerGitHub <noreply@github.com>2021-01-02 21:41:44 +0100
commit471aab86a0b793afe34a36b41e4366a686b589b9 (patch)
treeb6645bddaf124f89ddeb5f1d4cce6bb2cc190613 /tests/misc/trunner.nim
parent2eccef7ad6dd2941bcc78692b499b4cb269e9a2a (diff)
downloadNim-471aab86a0b793afe34a36b41e4366a686b589b9.tar.gz
fix #16526 run config.nims before foo.nim.cfg (#16557)
* fix #16526 run config.nims before foo.nim.cfg

* add test
Diffstat (limited to 'tests/misc/trunner.nim')
-rw-r--r--tests/misc/trunner.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/misc/trunner.nim b/tests/misc/trunner.nim
index 530561cd9..874ad66d6 100644
--- a/tests/misc/trunner.nim
+++ b/tests/misc/trunner.nim
@@ -224,6 +224,25 @@ sub/mmain.idx""", context
     let cmd = fmt"{nim} r -b:cpp --hints:off --nimcache:{nimcache} --warningAsError:ProveInit {file}"
     check execCmdEx(cmd) == ("witness\n", 0)
 
+  block: # config.nims, nim.cfg, hintConf, bug #16557
+    let cmd = fmt"{nim} r {defaultHintsOff} --hint:conf tests/newconfig/bar/mfoo.nim"
+    let (outp, exitCode) = execCmdEx(cmd, options = {poStdErrToStdOut})
+    doAssert exitCode == 0
+    let dir = getCurrentDir()
+    let files = """
+config/nim.cfg
+config/config.nims
+tests/config.nims
+tests/newconfig/bar/nim.cfg
+tests/newconfig/bar/config.nims
+tests/newconfig/bar/mfoo.nim.cfg
+tests/newconfig/bar/mfoo.nims""".splitLines
+    var expected = ""
+    for a in files:
+      let b = dir / a
+      expected.add &"Hint: used config file '{b}' [Conf]\n"
+    doAssert outp == expected, outp & "\n" & expected
+
   block: # nim --eval
     let opt = "--hints:off"
     check fmt"""{nim} {opt} --eval:"echo defined(nimscript)"""".execCmdEx == ("true\n", 0)
188'>188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249