From c6c8df91201e920df994a5de0fa79cdde04ed9be Mon Sep 17 00:00:00 2001 From: Water-Melon Date: Tue, 23 Apr 2024 14:34:30 +0000 Subject: [PATCH] chore(tests): support running tests with valgrind --- .github/workflows/build_and_test.yml | 2 +- configure | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 4206a93..343d8b1 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -15,4 +15,4 @@ jobs: - uses: actions/checkout@v3 - name: Build and Test run: | - ./configure && make && make test && export LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH && make run + apt update && apt install -y valgrind && ./configure && make && make test && export LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH && export MLN_TEST_RUNNER=valgrind && make run diff --git a/configure b/configure index 4182e10..b280b6d 100755 --- a/configure +++ b/configure @@ -504,16 +504,17 @@ generate_Makefile() { echo "" >> Makefile echo "run:" >> Makefile + echo -e "\t@echo 'Run Tests' && \\" >> Makefile for fname in ${select_files[@]} do fname=$(echo $fname | sed 's/^src\/mln_//') binname="bin/"`echo $fname | cut -d '.' -f 1` fname="t/$fname" if [ -f $fname ]; then - echo -e "\t./$binname && \\" >> Makefile + echo -e "\techo \"====== Test $binname running... ======\" && $MLN_TEST_RUNNER ./$binname && \\" >> Makefile fi done - echo "echo 'Done'" >> Makefile + echo -e "\techo 'Done'" >> Makefile for fname in ${select_files[@]} do