#!/bin/bash set -e echo "=== Knoe Installer Build System Test ===" echo "" echo "1. Testing Makefile..." make help > /dev/null && echo " ✓ Makefile works" echo "" echo "2. Testing icon file..." test -f img/knoeIcon.png && echo " ✓ Icon file exists" echo "" echo "3. Testing Python modules..." python3 -c "from knoe.ui.screens import KnoeController; KnoeController('.')" && echo " ✓ KnoeController works" python3 -c "from knoe.ncurses_installer import run_ncurses_installer" && echo " ✓ Ncurses installer imports" python3 -c "from knoe.ncurses_ui import CursesWindow" && echo " ✓ Ncurses UI imports" echo "" echo "4. Testing command-line interface..." python3 -m knoe.ui.screens --help > /dev/null && echo " ✓ --help works" echo "" echo "5. Testing spec generator..." test -f scripts/generate_spec.py && python3 scripts/generate_spec.py && echo " ✓ Spec generator works" echo "" echo "6. Testing icon conversion..." make clean > /dev/null 2>&1 make build/knoe.icns > /dev/null 2>&1 && echo " ✓ Icon conversion works" test -f build/knoe.icns && echo " ✓ ICNS file created" echo "" echo "=== All Tests Passed ===" echo "" echo "Ready to build!" echo "" echo "Next steps:" echo " 1. Install build dependencies: make install" echo " 2. Build the installer: make package" echo " 3. Test the build: make test"