Initial commit
This commit is contained in:
44
srcs/RobotNet10/RobotApp/Communication/CeresSharp.Test/find_crashing_test.sh
Executable file
44
srcs/RobotNet10/RobotApp/Communication/CeresSharp.Test/find_crashing_test.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
# Script to find which test causes crash
|
||||
set -e
|
||||
|
||||
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
||||
|
||||
cd /home/robotics/anhnv/RobotNet10/srcs/RobotNet10/RobotApp/Communication/CeresSharp.Test
|
||||
|
||||
echo "=== Finding crashing test ==="
|
||||
echo ""
|
||||
|
||||
# Get all test names
|
||||
TESTS=$(dotnet test --list-tests 2>&1 | grep -E "^\s+[A-Z]" | sed 's/^\s*//')
|
||||
|
||||
CRASHED_TESTS=()
|
||||
PASSED_TESTS=()
|
||||
|
||||
for test in $TESTS; do
|
||||
echo -n "Testing: $test ... "
|
||||
|
||||
# Run test with timeout
|
||||
if timeout 10 dotnet test --filter "FullyQualifiedName~$test" 2>&1 | grep -qE "(Passed|Failed.*0.*Passed.*1)"; then
|
||||
echo "PASSED"
|
||||
PASSED_TESTS+=("$test")
|
||||
elif timeout 10 dotnet test --filter "FullyQualifiedName~$test" 2>&1 | grep -qE "(crash|Terminating|Aborted|SIGSEGV|SIGABRT)"; then
|
||||
echo "CRASHED!"
|
||||
CRASHED_TESTS+=("$test")
|
||||
else
|
||||
echo "UNKNOWN"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "=== Summary ==="
|
||||
echo "Passed: ${#PASSED_TESTS[@]}"
|
||||
echo "Crashed: ${#CRASHED_TESTS[@]}"
|
||||
echo ""
|
||||
if [ ${#CRASHED_TESTS[@]} -gt 0 ]; then
|
||||
echo "Crashed tests:"
|
||||
for test in "${CRASHED_TESTS[@]}"; do
|
||||
echo " - $test"
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user