Skip to content

Commit

Permalink
chore(tests): support running tests with valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
Water-Melon committed Apr 23, 2024
1 parent f2403b3 commit c6c8df9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6c8df9

Please sign in to comment.