Files
cthulhu/test-local.sh
Storm Dragon 05a4f90af2 Add local development infrastructure and documentation
Add essential development tools and documentation for Cthulhu development:

Development Scripts:
- build-local.sh: Local build and install to ~/.local
- clean-local.sh: Clean build artifacts and local installation
- test-local.sh: Test local installation

Documentation:
- README-REMOTE-CONTROLLER.md: D-Bus service API documentation
- README-DEVELOPMENT.md: Development workflow documentation
- .gitignore: Updated with local build artifact patterns

These tools enable efficient local development without system-wide installation
and provide proper documentation for the D-Bus remote control capabilities.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 14:03:48 -04:00

63 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Test script for local Cthulhu installation
set -e
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
LOCAL_PREFIX="$HOME/.local"
CTHULHU_BIN="${LOCAL_PREFIX}/bin/cthulhu"
echo -e "${GREEN}=== Testing Local Cthulhu Installation ===${NC}"
# Check if binary exists
if [[ ! -f "$CTHULHU_BIN" ]]; then
echo -e "${RED}Error: Cthulhu binary not found at $CTHULHU_BIN${NC}"
echo -e "${YELLOW}Run ./build-local.sh first${NC}"
exit 1
fi
echo -e "${YELLOW}Testing basic functionality...${NC}"
# Test version
echo -n "Version check: "
if "$CTHULHU_BIN" --version >/dev/null 2>&1; then
echo -e "${GREEN}${NC}"
else
echo -e "${RED}${NC}"
fi
# Test help
echo -n "Help option: "
if "$CTHULHU_BIN" --help >/dev/null 2>&1; then
echo -e "${GREEN}${NC}"
else
echo -e "${RED}${NC}"
fi
# Test D-Bus service import
echo -n "D-Bus service: "
if PYTHONPATH="${LOCAL_PREFIX}/lib/python3.*/site-packages" python3 -c "
import sys
sys.path.insert(0, '${LOCAL_PREFIX}/lib/python3.13/site-packages')
try:
import cthulhu.dbus_service
controller = cthulhu.dbus_service.get_remote_controller()
print('D-Bus available:', controller._dasbus_available, file=sys.stderr)
print('SUCCESS')
except Exception as e:
print('ERROR:', e, file=sys.stderr)
sys.exit(1)
" 2>/dev/null; then
echo -e "${GREEN}${NC}"
else
echo -e "${YELLOW}~ (expected during development)${NC}"
fi
echo ""
echo -e "${GREEN}Local build test complete!${NC}"
echo -e "${YELLOW}To run Cthulhu: ${CTHULHU_BIN}${NC}"