mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 06:45:27 +00:00
Allow specifiying path to use for stdin error messages (#24595)
Implements #24569
Adds `--stdinfile` flag for specifying the file to use in place of
`stdinfile.nim` in error messages. Will enable easier integration of
tooling with nim check
(cherry picked from commit 0cba752c8a)
This commit is contained in:
16
tests/tools/tloadstdin.nim
Normal file
16
tests/tools/tloadstdin.nim
Normal file
@@ -0,0 +1,16 @@
|
||||
discard """
|
||||
action: "compile"
|
||||
cmd: "cat $file | $nim check --stdinfile:$file -"
|
||||
# Don't believe cat and pipes works on windows
|
||||
disabled: "win"
|
||||
"""
|
||||
|
||||
import std/[assertions, paths]
|
||||
|
||||
# Test the nimscript config is loaded
|
||||
assert defined(nimscriptConfigLoaded)
|
||||
|
||||
assert currentSourcePath() == $(getCurrentDir()/Path"tloadstdin.nim")
|
||||
|
||||
{.warning: "Hello".} #[tt.Warning
|
||||
^ Hello]#
|
||||
1
tests/tools/tloadstdin.nims
Normal file
1
tests/tools/tloadstdin.nims
Normal file
@@ -0,0 +1 @@
|
||||
--d:nimscriptConfigLoaded
|
||||
Reference in New Issue
Block a user