Skip to content

Commit 3b2e88d

Browse files
committed
Fixing Valgrind execution
1 parent 09c82e6 commit 3b2e88d

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

.github/workflows/valgrind.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,22 @@ jobs:
3333
.
3434
3535
- name: Run Valgrind on test suite
36-
id: valgrind_tests
3736
run: |
38-
# Run tests with Valgrind using the script inside Docker
39-
# The script wraps mpqcli with Valgrind and runs pytest
37+
mkdir -p valgrind_logs
4038
docker run --rm \
41-
-v $(pwd):/workspace:rw \
42-
-w /workspace \
43-
mpqcli-valgrind \
44-
bash -c "./scripts/run_valgrind_tests.sh"
45-
46-
echo "Test execution completed"
39+
-v $(pwd)/test:/mpqcli/test:rw \
40+
-v $(pwd)/valgrind_logs:/mpqcli/valgrind_logs:rw \
41+
mpqcli-valgrind bash -c '
42+
cp /mpqcli/build/bin/mpqcli /mpqcli/build/bin/mpqcli.real
43+
cat > /mpqcli/build/bin/mpqcli << "EOF"
44+
#!/bin/bash
45+
exec valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
46+
--log-file=/mpqcli/valgrind_logs/valgrind_$$.log \
47+
/mpqcli/build/bin/mpqcli.real "$@"
48+
EOF
49+
chmod +x /mpqcli/build/bin/mpqcli
50+
cd /mpqcli && python3 -m pytest test -v --tb=short
51+
'
4752
4853
- name: Analyze Valgrind results
4954
id: analyze

0 commit comments

Comments
 (0)