summary refs log tree commit diff stats
path: root/tests/options
diff options
context:
space:
mode:
authorJuan M Gómez <info@jmgomez.me>2023-06-24 07:13:15 +0100
committerGitHub <noreply@github.com>2023-06-24 08:13:15 +0200
commitbeaac609ab5756114a0938360a60eca0f605f4a1 (patch)
tree5113b6847b57f764028fe9dce1eb6caa52bb4490 /tests/options
parent88114948c41f38d7366dc8d80abc09f00c2492fa (diff)
downloadNim-beaac609ab5756114a0938360a60eca0f605f4a1.tar.gz
adds nimbasePattern compiler option (#22144)
adds optonal --nimbasepattern
Diffstat (limited to 'tests/options')
-rw-r--r--tests/options/tnimbasepattern.nim26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/options/tnimbasepattern.nim b/tests/options/tnimbasepattern.nim
new file mode 100644
index 000000000..1237af5c5
--- /dev/null
+++ b/tests/options/tnimbasepattern.nim
@@ -0,0 +1,26 @@
+discard """
+  cmd: "nim cpp --nimbasepattern:test.h --cincludes:./tests/options $file "
+  output:'''
+(a: 1)
+'''
+"""
+const header = """
+#pragma once
+#include "nimbase.h"
+struct Foo {
+  int a;
+};
+"""
+
+import os
+static:
+  const dir = "./tests/options/"
+  createDir(dir)
+  writeFile(dir / "test.h", header)
+
+type 
+  Foo {.importc.} = object
+    a: int32 = 1
+  
+
+echo $Foo()
\ No newline at end of file