blob: 3cfb9c32bfe40d50c66560f2d81504c9dd97e730 (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#!/bin/bash
# Test script for seq_compiler Gantt chart output
set -e # Exit on error
# Arguments
SEQ_COMPILER=$1
INPUT_SEQ=$2
OUTPUT_GANTT=$3
if [ -z "$SEQ_COMPILER" ] || [ -z "$INPUT_SEQ" ] || [ -z "$OUTPUT_GANTT" ]; then
echo "Usage: $0 <seq_compiler> <input.seq> <output_gantt.txt>"
exit 1
fi
# Clean up any existing output
rm -f "$OUTPUT_GANTT"
# Run seq_compiler with Gantt output
"$SEQ_COMPILER" "$INPUT_SEQ" "--gantt=$OUTPUT_GANTT" > /dev/null 2>&1
# Check output file exists
if [ ! -f "$OUTPUT_GANTT" ]; then
echo "ERROR: Gantt output file not created"
exit 1
fi
# Verify key content exists
ERRORS=0
# Check for timeline header
if ! grep -q "Demo Timeline Gantt Chart" "$OUTPUT_GANTT"; then
echo "ERROR: Missing 'Demo Timeline Gantt Chart' header"
ERRORS=$((ERRORS + 1))
fi
# Check for BPM info
if ! grep -q "BPM:" "$OUTPUT_GANTT"; then
echo "ERROR: Missing 'BPM:' information"
ERRORS=$((ERRORS + 1))
fi
# Check for time axis
if ! grep -q "Time (s):" "$OUTPUT_GANTT"; then
echo "ERROR: Missing 'Time (s):' axis"
ERRORS=$((ERRORS + 1))
fi
# Check for sequence bars (should have '█' characters)
if ! grep -q "█" "$OUTPUT_GANTT"; then
echo "ERROR: Missing sequence visualization bars"
ERRORS=$((ERRORS + 1))
fi
# Check file is not empty
FILE_SIZE=$(wc -c < "$OUTPUT_GANTT")
if [ "$FILE_SIZE" -lt 100 ]; then
echo "ERROR: Gantt output is too small ($FILE_SIZE bytes)"
ERRORS=$((ERRORS + 1))
fi
if [ $ERRORS -eq 0 ]; then
echo "✓ Gantt chart output test passed"
exit 0
else
echo "✗ Gantt chart output test failed ($ERRORS errors)"
echo "--- Output file contents ---"
cat "$OUTPUT_GANTT"
exit 1
fi
|