From 92641b552df95973b0d844a5e25c0f7e0eb7582b Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Sat, 4 Dec 2021 17:55:13 +0100 Subject: [PATCH] Switch warningAsError only works for Nim >= 1.4.0 --- testmodules/nim.cfg | 2 -- testmodules/options/test.nimble | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 testmodules/nim.cfg diff --git a/testmodules/nim.cfg b/testmodules/nim.cfg deleted file mode 100644 index 222cb3d..0000000 --- a/testmodules/nim.cfg +++ /dev/null @@ -1,2 +0,0 @@ ---warningAsError[UnsafeDefault]:"on" ---warningAsError[ProveInit]:"on" diff --git a/testmodules/options/test.nimble b/testmodules/options/test.nimble index d389ae1..1aa991e 100644 --- a/testmodules/options/test.nimble +++ b/testmodules/options/test.nimble @@ -4,4 +4,8 @@ description = "Questionable tests for std/option" license = "MIT" task test, "Runs the test suite": - exec "nim c -f -r test.nim" + var options = "-f -r" + when (NimMajor, NimMinor) >= (1, 4): + options &= " --warningAsError[UnsafeDefault]:on" + options &= " --warningAsError[ProveInit]:on" + exec "nim c " & options & " test.nim"