check leaks d01

This commit is contained in:
hugogogo
2022-03-14 15:05:24 +01:00
parent 3f0c94360a
commit 189f76260c
13 changed files with 38 additions and 63 deletions

View File

@@ -2,7 +2,14 @@
cd $(dirname $0)
source ./colors.sh
mkdir -p test_log
make -C ../ &> /dev/null
EXECUTABLE="sed"
LEAKS=""
if [ $1 == "leaks" ] || [ $1 == "valgrind" ]
then
LEAKS="valgrind --leak-check=full --show-leak-kinds=all"
fi
# RUN TESTS
function run_tests
@@ -10,7 +17,7 @@ EXECUTABLE="sed"
touch $TESTNAME
echo "$CONTENT" > $TESTNAME
../$EXECUTABLE $TESTNAME "$FIND" "$REPLACEMENT"
$LEAKS ../$EXECUTABLE $TESTNAME "$FIND" "$REPLACEMENT"
OUTPUT=$( cat $TESTNAME.replace )
if [ "$OUTPUT" == "$RESULT" ]
then