diff options
| -rw-r--r-- | CMakeLists.txt | 9 | ||||
| -rw-r--r-- | assets/test_gantt.seq | 11 | ||||
| -rwxr-xr-x | scripts/test_gantt_output.sh | 70 |
3 files changed, 90 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 53d0285..12f3bd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -577,6 +577,15 @@ if(DEMO_BUILD_TESTS) ${GEN_DEMO_CC}) target_link_libraries(test_texture_manager PRIVATE 3d gpu audio procedural util ${DEMO_LIBS}) add_dependencies(test_texture_manager generate_demo_assets) + + # Gantt chart output test (bash script) + add_test( + NAME GanttOutputTest + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/test_gantt_output.sh + $<TARGET_FILE:seq_compiler> + ${CMAKE_CURRENT_SOURCE_DIR}/assets/test_gantt.seq + ${CMAKE_CURRENT_BINARY_DIR}/test_gantt_output.txt + ) endif() #-- - Extra Tools -- - diff --git a/assets/test_gantt.seq b/assets/test_gantt.seq new file mode 100644 index 0000000..92f9cfc --- /dev/null +++ b/assets/test_gantt.seq @@ -0,0 +1,11 @@ +# Test sequence file for Gantt chart testing +# BPM 120 + +# Simple timeline with two sequences +SEQUENCE 0.0 0 "Sequence A" + EFFECT + FlashEffect 0.0 2.0 + +SEQUENCE 1.0 0 "Sequence B" + EFFECT + PassthroughEffect 0.0 2.0 + +END_DEMO 4.0 diff --git a/scripts/test_gantt_output.sh b/scripts/test_gantt_output.sh new file mode 100755 index 0000000..3cfb9c3 --- /dev/null +++ b/scripts/test_gantt_output.sh @@ -0,0 +1,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 |
