#!/bin/bash
# Test script for seq_compiler HTML Gantt chart output
set -e # Exit on error
# Arguments
SEQ_COMPILER=$1
INPUT_SEQ=$2
OUTPUT_HTML=$3
if [ -z "$SEQ_COMPILER" ] || [ -z "$INPUT_SEQ" ] || [ -z "$OUTPUT_HTML" ]; then
echo "Usage: $0 "
exit 1
fi
# Clean up any existing output
rm -f "$OUTPUT_HTML"
# Run seq_compiler with HTML Gantt output
"$SEQ_COMPILER" "$INPUT_SEQ" "--gantt-html=$OUTPUT_HTML" > /dev/null 2>&1
# Check output file exists
if [ ! -f "$OUTPUT_HTML" ]; then
echo "ERROR: HTML output file not created"
exit 1
fi
# Verify key content exists
ERRORS=0
# Check for HTML structure
if ! grep -q "" "$OUTPUT_HTML"; then
echo "ERROR: Missing HTML doctype"
ERRORS=$((ERRORS + 1))
fi
if ! grep -q "" "$OUTPUT_HTML"; then
echo "ERROR: Missing tag"
ERRORS=$((ERRORS + 1))
fi
# Check for title (matches actual format: "Demo Timeline - BPM ")
if ! grep -q "Demo Timeline" "$OUTPUT_HTML"; then
echo "ERROR: Missing page title"
ERRORS=$((ERRORS + 1))
fi
# Check for main heading
if ! grep -q "
Demo Timeline Gantt Chart
" "$OUTPUT_HTML"; then
echo "ERROR: Missing main heading"
ERRORS=$((ERRORS + 1))
fi
# Check for SVG content
if ! grep -q "