Exercise mycp a basic GNU cp clone

This commit is contained in:
Fabio Scotto di Santolo
2025-06-26 18:04:32 +02:00
parent 85ef4163db
commit 37ccfc7367
5 changed files with 273 additions and 0 deletions

19
exercises/mycp/valgrind_test.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
EXEC=./mycp
LOGFILE=valgrind_output.txt
INPUT=test_input.txt
OUTPUT=test_output.txt
echo "Testing with Valgrind..." > "$LOGFILE"
echo "Input: $INPUT → Output: $OUTPUT" >> "$LOGFILE"
echo "----------------------------------------" >> "$LOGFILE"
# Prepara input file
echo "Valgrind test content" > "$INPUT"
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
"$EXEC" "$INPUT" "$OUTPUT" 2>> "$LOGFILE"
echo "✅ Valgrind test completed. Output in $LOGFILE."