Skip to content

Commit 2d1fc00

Browse files
committed
tests/test_cext0: Add.
Add some testing of the cext macros. This is incomplete, but a start to at least test some of it.
1 parent bd5e262 commit 2d1fc00

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

test/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ set(tests_c
22
arr_test0.c
33
arr_test1.c
44
clopts_test0.c
5+
cext_test0.c
56
err_test0.c
67
err_test1.c
78
fmt_test0.c
@@ -55,6 +56,14 @@ foreach(fn
5556
)
5657
endforeach()
5758

59+
add_executable(cext_test0_c23 cext_test0.c)
60+
target_link_libraries(cext_test0_c23 csnip)
61+
set_property(TARGET cext_test0_c23 PROPERTY C_STANDARD 23)
62+
add_test(
63+
NAME cext_test0_c23
64+
COMMAND $<TARGET_FILE:cext_test0_c23>
65+
)
66+
5867
set_property(TARGET clopts_test0 PROPERTY C_STANDARD 11)
5968
set_property(TARGET limits_test PROPERTY C_STANDARD 11)
6069
set_property(TARGET runif_getf_test PROPERTY C_STANDARD 11)

test/cext_test0.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <stdio.h>
2+
3+
#include <csnip/cext.h>
4+
5+
csnip_cext_unused static int f(void)
6+
{
7+
return 0;
8+
}
9+
10+
csnip_cext_export void g(void);
11+
12+
void g(void)
13+
{
14+
puts("Exported function");
15+
}
16+
17+
int main(void)
18+
{
19+
puts("No runtime tests here -> pass.");
20+
return 0;
21+
}

0 commit comments

Comments
 (0)