diff options
| author | ruki <[email protected]> | 2021-10-17 22:20:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-17 22:20:28 +0800 |
| commit | f91fc985a24094fd90a825f68c9ca63f7aa83ce0 (patch) | |
| tree | 22b68eb7ba0027d4bcfb67e5ac3cf63fff33cd30 /tests | |
| parent | 2c018854833aa388bb16580f7d61646e90ce4bda (diff) | |
add unit_unit tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/projects/c/unit_build/src/bar/test4.c | 8 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/bar/test5.c | 8 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/foo/test1.c | 8 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/foo/test2.c | 8 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/header.h | 10 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/main.c | 7 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/test.cpp | 4 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/test2.c | 8 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/test6.c | 8 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/test7.c | 8 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/src/test8.c | 8 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/test.lua | 6 | ||||
| -rw-r--r-- | tests/projects/c/unit_build/xmake.lua | 8 |
13 files changed, 99 insertions, 0 deletions
diff --git a/tests/projects/c/unit_build/src/bar/test4.c b/tests/projects/c/unit_build/src/bar/test4.c new file mode 100644 index 000000000..a92803eb7 --- /dev/null +++ b/tests/projects/c/unit_build/src/bar/test4.c @@ -0,0 +1,8 @@ + +// main.cpp +#include "header.h" + +int test4() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/src/bar/test5.c b/tests/projects/c/unit_build/src/bar/test5.c new file mode 100644 index 000000000..2a3e7066c --- /dev/null +++ b/tests/projects/c/unit_build/src/bar/test5.c @@ -0,0 +1,8 @@ + +// main.cpp +#include "header.h" + +int test5() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/src/foo/test1.c b/tests/projects/c/unit_build/src/foo/test1.c new file mode 100644 index 000000000..e9d6c83d9 --- /dev/null +++ b/tests/projects/c/unit_build/src/foo/test1.c @@ -0,0 +1,8 @@ + +// main.cpp +#include "header.h" + +int test() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/src/foo/test2.c b/tests/projects/c/unit_build/src/foo/test2.c new file mode 100644 index 000000000..b4ce69b0f --- /dev/null +++ b/tests/projects/c/unit_build/src/foo/test2.c @@ -0,0 +1,8 @@ + +// main.cpp +#include "header.h" + +int test3() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/src/header.h b/tests/projects/c/unit_build/src/header.h new file mode 100644 index 000000000..29bfc5870 --- /dev/null +++ b/tests/projects/c/unit_build/src/header.h @@ -0,0 +1,10 @@ +// header.h +#ifndef HEADER_H +#define HEADER_H + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#endif + diff --git a/tests/projects/c/unit_build/src/main.c b/tests/projects/c/unit_build/src/main.c new file mode 100644 index 000000000..f0408cdf8 --- /dev/null +++ b/tests/projects/c/unit_build/src/main.c @@ -0,0 +1,7 @@ +#include "header.h" + +int main(int argc, char** argv) +{ + printf("hello xmake!\n"); + return 0; +} diff --git a/tests/projects/c/unit_build/src/test.cpp b/tests/projects/c/unit_build/src/test.cpp new file mode 100644 index 000000000..1cedddad9 --- /dev/null +++ b/tests/projects/c/unit_build/src/test.cpp @@ -0,0 +1,4 @@ +int test_cpp() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/src/test2.c b/tests/projects/c/unit_build/src/test2.c new file mode 100644 index 000000000..596359cd2 --- /dev/null +++ b/tests/projects/c/unit_build/src/test2.c @@ -0,0 +1,8 @@ + +// main.cpp +#include "header.h" + +int test2() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/src/test6.c b/tests/projects/c/unit_build/src/test6.c new file mode 100644 index 000000000..efbd7c6c1 --- /dev/null +++ b/tests/projects/c/unit_build/src/test6.c @@ -0,0 +1,8 @@ + +// main.cpp +#include "header.h" + +int test6() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/src/test7.c b/tests/projects/c/unit_build/src/test7.c new file mode 100644 index 000000000..24aeff619 --- /dev/null +++ b/tests/projects/c/unit_build/src/test7.c @@ -0,0 +1,8 @@ + +// main.cpp +#include "header.h" + +int test7() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/src/test8.c b/tests/projects/c/unit_build/src/test8.c new file mode 100644 index 000000000..6ad5680a6 --- /dev/null +++ b/tests/projects/c/unit_build/src/test8.c @@ -0,0 +1,8 @@ + +// main.cpp +#include "header.h" + +int test8() +{ + return 0; +} diff --git a/tests/projects/c/unit_build/test.lua b/tests/projects/c/unit_build/test.lua new file mode 100644 index 000000000..b76241be2 --- /dev/null +++ b/tests/projects/c/unit_build/test.lua @@ -0,0 +1,6 @@ +-- main entry +function main(t) + + -- build project + t:build() +end diff --git a/tests/projects/c/unit_build/xmake.lua b/tests/projects/c/unit_build/xmake.lua new file mode 100644 index 000000000..1df67c0ec --- /dev/null +++ b/tests/projects/c/unit_build/xmake.lua @@ -0,0 +1,8 @@ +target("test") + set_kind("binary") + add_includedirs("src") + add_rules("c++.unit_build", {batchsize = 2}) + add_files("src/*.c", "src/*.cpp") + add_files("src/foo/*.c", {unit_group = "foo"}) + add_files("src/bar/*.c", {unit_group = "bar"}) + |
