From 69ae86ada0f2516e619f516f33599bbf9fe9410e Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 20 Aug 2026 18:40:58 +0000 Subject: Include aplwc-repl in the coverage run FossilOrigin-Name: 4f7329faad5e4dadb6a8cbea007164da2f95af298399b2d1a2899eb478cd030a --- CMakeLists.txt | 2 ++ src/main.c | 7 ++----- tools/checkcov | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e06a1eb..782aaff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,3 +66,5 @@ foreach(source ${TEST_SOURCES}) target_link_libraries("${test_bin}" PRIVATE common aplwc) add_test(NAME "${name}" COMMAND "${test_bin}") endforeach() + +add_test(NAME "aplwc-repl" COMMAND "aplwc-repl") diff --git a/src/main.c b/src/main.c index b0576a5..2538248 100644 --- a/src/main.c +++ b/src/main.c @@ -2,8 +2,6 @@ #include #include -#define MEMORY (1024*1024) - int main(void) { @@ -11,19 +9,18 @@ main(void) uint8_t *data; int ret; - data = malloc(MEMORY); + data = malloc(APLWC_MIN_MEM); if(data == NULL){ fprintf(stderr, "Couldn't allocate memory\n"); return 1; } - ret = aplwc_new(&aplwc, data, MEMORY); + ret = aplwc_new(&aplwc, data, APLWC_MIN_MEM); if(ret){ fprintf(stderr, "Couldn't create new aplwc instance: %s\n", aplwc_errstr(aplwc)); return 1; } - ret = aplwc_destroy(aplwc); if(ret){ fprintf(stderr, "Couldn't destroy the aplwc instance: %s\n", aplwc_errstr(aplwc)); diff --git a/tools/checkcov b/tools/checkcov index 6f2775a..32e30d7 100755 --- a/tools/checkcov +++ b/tools/checkcov @@ -5,6 +5,7 @@ cd build/$1 case "$1" in Coverage) rm -rf CMakeFiles/aplwc.dir/src/* + rm -rf CMakeFiles/aplwc-repl.dir/src/* ;; *) ;; @@ -21,7 +22,7 @@ case "$1" in ;; esac -gcov -tg CMakeFiles/aplwc.dir/src/*.gcno | awk ' +gcov -tg CMakeFiles/aplwc.dir/src/*.gcno CMakeFiles/aplwc-repl.dir/src/*.gcno | awk ' BEGIN { FS=":" } -- cgit v1.2.3