tests : add a C compliance test

This commit is contained in:
Cebtenzzre 2023-08-28 01:57:57 -04:00
parent 103cfafc77
commit 39ace3668c
3 changed files with 11 additions and 0 deletions

View file

@ -468,3 +468,6 @@ tests/test-sampling: tests/test-sampling.cpp build-info.h ggml.o llama.o common.
tests/test-tokenizer-0: tests/test-tokenizer-0.cpp build-info.h ggml.o llama.o common.o $(OBJS)
$(CXX) $(CXXFLAGS) $(filter-out %.txt,$^) -o $@ $(LDFLAGS)
tests/test-c.o: tests/test-c.c llama.h
$(CC) $(CFLAGS) -c $(filter-out %.h,$^) -o $@

View file

@ -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)

3
tests/test-c.c Normal file
View file

@ -0,0 +1,3 @@
#include "llama.h"
int main(void) {}