From 849408957c687cde4ab32c147107f643fc55130b Mon Sep 17 00:00:00 2001 From: Cebtenzzre Date: Wed, 30 Aug 2023 02:20:26 -0400 Subject: tests : add a C compliance test (#2848) * tests : add a C compliance test * make : build C compliance test by default * make : fix clean and make sure C test fails on clang * make : move -Werror=implicit-int to CFLAGS --- tests/CMakeLists.txt | 5 +++++ tests/test-c.c | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 tests/test-c.c (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ca1f39d3..483210d7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -37,3 +37,8 @@ llama_build_and_test_executable(test-grammar-parser.cpp) llama_build_and_test_executable(test-llama-grammar.cpp) llama_build_and_test_executable(test-grad0.cpp) # SLOW # llama_build_and_test_executable(test-opt.cpp) # SLOW + +# dummy executable - not installed +get_filename_component(TEST_TARGET test-c.c NAME_WE) +add_executable(${TEST_TARGET} test-c.c) +target_link_libraries(${TEST_TARGET} PRIVATE llama) diff --git a/tests/test-c.c b/tests/test-c.c new file mode 100644 index 00000000..a0507108 --- /dev/null +++ b/tests/test-c.c @@ -0,0 +1,3 @@ +#include "llama.h" + +int main(void) {} -- cgit v1.2.3