-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-validation.sh
More file actions
executable file
·31 lines (26 loc) · 1.03 KB
/
test-validation.sh
File metadata and controls
executable file
·31 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Test validation script for sysml2
# Counts how many files pass/fail validation
cd /Users/zbigniew/Code/sysml2/build
echo "Running validation tests..."
RESULTS=$(find /Users/zbigniew/Code/SysML-v2-Release \( -name "*.sysml" -o -name "*.kerml" \) -type f \
-exec sh -c './sysml2 --no-resolve "$1" >/dev/null 2>&1 && echo ok || echo fail' _ {} \;)
OK=$(echo "$RESULTS" | grep -c "^ok$")
FAIL=$(echo "$RESULTS" | grep -c "^fail$")
TOTAL=$((OK + FAIL))
echo "=================================="
echo "Validation Results:"
echo " OK: $OK / $TOTAL"
echo " FAIL: $FAIL / $TOTAL"
echo "=================================="
# Show E3004 files if requested
if [ "$1" = "-v" ] || [ "$1" = "--verbose" ]; then
echo ""
echo "Files with E3004 (duplicate) errors:"
find /Users/zbigniew/Code/SysML-v2-Release \( -name "*.sysml" -o -name "*.kerml" \) -type f 2>/dev/null | \
while IFS= read -r f; do
if ./sysml2 --no-resolve "$f" 2>&1 | grep -q "E3004"; then
echo " $f"
fi
done
fi