add failing tests; add a test at CT

This commit is contained in:
Timothee Cour 2018-12-29 14:02:04 -08:00
commit 9f7d2ca956
3 changed files with 15 additions and 1 deletions

View file

@ -18,7 +18,7 @@ proc execCmd(cmd:string)=
task test, "Test":
execCmd "nim c -r tests/tnimterop_c.nim"
#execCmd "nim cpp -r tests/tnimterop_c.nim"
# execCmd "nim cpp -r tests/tnimterop_c.nim"
execCmd "nim cpp -r tests/tnimterop_cpp.nim"
# when defined(windows):
# execCmd "nim c -r tests/tmath.nim"

View file

@ -20,6 +20,9 @@ extern "C" {
#define OSDEF 30
#endif
#define foobar1(x) OSDEF * x
#define foobar2(x) x + 1
typedef uint8_t PRIMTYPE;
typedef PRIMTYPE CUSTTYPE;

View file

@ -20,6 +20,10 @@ elif defined(windows):
else:
check OSDEF == 30
block:
# workaround for https://github.com/nim-lang/Nim/issues/10129
const ok = OSDEF
var
pt: PRIMTYPE
ct: CUSTTYPE
@ -79,3 +83,10 @@ check e3 == enum7
check e4 == enum11
cAddStdDir()
## failing tests
when false:
static: # Error: undeclared identifier: 'foobar1'
doAssert foobar1(3) == OSDEF * 3
when false: # Error: undeclared identifier: 'foobar2'
doAssert foobar2(3) == 3 + 1