tnimbasepattern.nim 369 B

1234567891011121314151617181920212223242526
  1. discard """
  2. cmd: "nim cpp --nimbasepattern:test.h --cincludes:./tests/options $file "
  3. output:'''
  4. (a: 1)
  5. '''
  6. """
  7. const header = """
  8. #pragma once
  9. #include "nimbase.h"
  10. struct Foo {
  11. int a;
  12. };
  13. """
  14. import os
  15. static:
  16. const dir = "./tests/options/"
  17. createDir(dir)
  18. writeFile(dir / "test.h", header)
  19. type
  20. Foo {.importc.} = object
  21. a: int32 = 1
  22. echo $Foo()