diff options
| author | ruki <[email protected]> | 2021-10-21 23:05:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-21 23:05:45 +0800 |
| commit | cc00b3574b5892f191cef90f81acd3c27b548ff8 (patch) | |
| tree | 4dce90df31721cf6bf2559accca8d67212a5334d /tests/projects/nim | |
| parent | efa63d26a7d3c5a76344141150771fe76137ef3a (diff) | |
improve tests
Diffstat (limited to 'tests/projects/nim')
| -rw-r--r-- | tests/projects/nim/console/xmake.lua | 2 | ||||
| -rw-r--r-- | tests/projects/nim/console_with_c/src/foo.c | 3 | ||||
| -rwxr-xr-x | tests/projects/nim/console_with_c/src/main | bin | 0 -> 92184 bytes | |||
| -rw-r--r-- | tests/projects/nim/console_with_c/src/main.nim | 3 | ||||
| -rw-r--r-- | tests/projects/nim/console_with_c/xmake.lua | 10 |
5 files changed, 17 insertions, 1 deletions
diff --git a/tests/projects/nim/console/xmake.lua b/tests/projects/nim/console/xmake.lua index 35bcd3792..40459a274 100644 --- a/tests/projects/nim/console/xmake.lua +++ b/tests/projects/nim/console/xmake.lua @@ -2,4 +2,4 @@ add_rules("mode.debug", "mode.release") target("test") set_kind("binary") - add_files("src/*.nim") + add_files("src/main.nim") diff --git a/tests/projects/nim/console_with_c/src/foo.c b/tests/projects/nim/console_with_c/src/foo.c new file mode 100644 index 000000000..7e3f727d6 --- /dev/null +++ b/tests/projects/nim/console_with_c/src/foo.c @@ -0,0 +1,3 @@ +int foo(int n) { + return n; +} diff --git a/tests/projects/nim/console_with_c/src/main b/tests/projects/nim/console_with_c/src/main Binary files differnew file mode 100755 index 000000000..84f0819ac --- /dev/null +++ b/tests/projects/nim/console_with_c/src/main diff --git a/tests/projects/nim/console_with_c/src/main.nim b/tests/projects/nim/console_with_c/src/main.nim new file mode 100644 index 000000000..1be3abe69 --- /dev/null +++ b/tests/projects/nim/console_with_c/src/main.nim @@ -0,0 +1,3 @@ +proc foo(n: int): int {.cdecl, importc} + +echo foo(2) diff --git a/tests/projects/nim/console_with_c/xmake.lua b/tests/projects/nim/console_with_c/xmake.lua new file mode 100644 index 000000000..c2d067cd6 --- /dev/null +++ b/tests/projects/nim/console_with_c/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + set_kind("static") + add_files("src/*.c") + +target("test") + set_kind("binary") + add_deps("foo") + add_files("src/main.nim") |
