summary refs log tree commit diff stats
path: root/tests/pragmas
diff options
context:
space:
mode:
authorJake Leahy <jake@leahy.dev>2022-12-16 05:22:45 +1100
committerGitHub <noreply@github.com>2022-12-15 19:22:45 +0100
commitd00477dffb2c62732b87a440c61706de5b480f48 (patch)
tree66a4e5fa32e50df2e35732e8b0988d822e5053c8 /tests/pragmas
parent8054be6e529db9e65a18e4c4a37ec54f64f9121c (diff)
downloadNim-d00477dffb2c62732b87a440c61706de5b480f48.tar.gz
Check file exists in `{.compile.}` pragma (#21105)
* Add test

* Check file exists before adding it into compilation

* Make error message look like other error messages

i.e. following the format `error msg: file`
Diffstat (limited to 'tests/pragmas')
-rw-r--r--tests/pragmas/tcompile_missing_file.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/pragmas/tcompile_missing_file.nim b/tests/pragmas/tcompile_missing_file.nim
new file mode 100644
index 000000000..fd90bd57d
--- /dev/null
+++ b/tests/pragmas/tcompile_missing_file.nim
@@ -0,0 +1,5 @@
+discard """
+  joinable: false
+  errormsg: "cannot find: noexist.c"
+"""
+{.compile: "noexist.c".}