-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To be removed when we want to merge this into Prusti. Committing for now since it's relevant to my thesis.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
# ANSI escape codes for colors | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
YELLOW='\033[1;33m' | ||
NC='\033[0m' # No Color | ||
|
||
# Initialize or clear the files | ||
> passing.txt | ||
> failing.txt | ||
> panicking.txt | ||
|
||
# Initialize counters | ||
passed=0 | ||
failed=0 | ||
panicked=0 | ||
|
||
for i in prusti-tests/tests/verify/pass/**/*.rs; do | ||
echo -n "Testing file: $i" | ||
|
||
# Run the test | ||
output=$(PRUSTI_FULL_COMPILATION=false target/release/prusti-rustc --edition=2021 $i -Pcheck_overflows=false 2>&1) | ||
|
||
# Check the exit status of the test | ||
if [ $? -eq 0 ]; then | ||
# Test passed, append to passing.txt | ||
echo "$i" >> passing.txt | ||
echo -e " ...${GREEN}ok${NC}" | ||
((passed++)) | ||
else | ||
# Test failed | ||
if echo "$output" | grep -q "^thread 'rustc' panicked at"; then | ||
# There was a panic, append output to panicking.txt | ||
echo -e "\n---- $i ----\n$output" >> panicking.txt | ||
echo -e " ...${YELLOW}PANICKED${NC}" | ||
((panicked++)) | ||
else | ||
# Other error, append output to failing.txt | ||
echo -e "\n---- $i ----\n$output" >> failing.txt | ||
echo -e " ...${RED}FAILED${NC}" | ||
((failed++)) | ||
fi | ||
fi | ||
done | ||
|
||
# Print test statistics | ||
echo -e "${GREEN}$passed tests passed${NC}" | ||
echo -e "${RED}$failed tests failed${NC}" | ||
echo -e "${YELLOW}$panicked tests panicked${NC}" |