-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_install.sh
More file actions
161 lines (133 loc) · 4.31 KB
/
test_install.sh
File metadata and controls
161 lines (133 loc) · 4.31 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/bin/bash
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
DIM='\033[2m'
NC='\033[0m' # No Color
# Helper to print command before running
run_cmd() {
echo -e "${DIM}\$ $@${NC}"
"$@"
}
echo -e "${CYAN}"
echo "╭──────────────────────────────────────────────────────────╮"
echo "│ QuickCall VoiceOver - Installation Test │"
echo "╰──────────────────────────────────────────────────────────╯"
echo -e "${NC}"
# Test directory
TEST_DIR="/tmp/quickcall-voiceover-test"
# Cleanup previous test
if [ -d "$TEST_DIR" ]; then
echo -e "${YELLOW}Cleaning up previous test directory...${NC}"
run_cmd rm -rf "$TEST_DIR"
fi
# Create test directory
echo -e "${CYAN}Creating test directory${NC}"
run_cmd mkdir -p "$TEST_DIR"
cd "$TEST_DIR"
echo ""
# Initialize uv project
echo -e "${CYAN}Initializing uv project${NC}"
run_cmd uv init --name voiceover-test
echo ""
# Install from local path
PACKAGE_PATH="/Users/sagar/work/all-things-quickcall/voice-over"
echo -e "${CYAN}Installing quickcall-voiceover${NC}"
run_cmd uv add "$PACKAGE_PATH"
echo ""
# Verify installation
echo -e "${GREEN}✓ Package installed${NC}"
echo ""
# Test 1: Show help
echo -e "${YELLOW}━━━ Test 1: CLI Help ━━━${NC}"
run_cmd uv run quickcall-voiceover --help
echo ""
# Test 2: Show voices
echo -e "${YELLOW}━━━ Test 2: Show Voices ━━━${NC}"
run_cmd uv run quickcall-voiceover --voices
echo ""
# Test 3: Config-based generation
echo -e "${YELLOW}━━━ Test 3: Config-based Generation ━━━${NC}"
# Create test config
cat > test_config.json << 'CONFIGEOF'
{
"voice": {
"model": "en_US-hfc_male-medium",
"length_scale": 1.0,
"noise_scale": 0.667,
"noise_w": 0.8,
"sentence_silence": 0.3
},
"output": {
"format": "wav"
},
"segments": [
{
"id": "01_hello",
"text": "Hello! This is a test of QuickCall VoiceOver."
},
{
"id": "02_features",
"text": "This tool generates high quality voice overs from text."
},
{
"id": "03_goodbye",
"text": "Thanks for testing. Goodbye!"
}
]
}
CONFIGEOF
echo -e "${CYAN}Created test_config.json${NC}"
run_cmd cat test_config.json
echo ""
run_cmd uv run quickcall-voiceover test_config.json --combine
echo ""
echo -e "${GREEN}Generated files:${NC}"
run_cmd ls -lah output/
echo ""
# Test 4: Programmatic API test
echo -e "${YELLOW}━━━ Test 4: Programmatic API ━━━${NC}"
# Create a simple Python script to test programmatic usage
cat > test_programmatic.py << 'PYEOF'
from pathlib import Path
from quickcall_voiceover import generate_from_text
lines = [
"This is a programmatic test.",
"Generated using the Python API.",
"QuickCall VoiceOver works great!"
]
success = generate_from_text(
lines=lines,
voice="en_US-hfc_male-medium",
output_dir=Path("./output_programmatic"),
combine=True,
combined_filename="programmatic_combined.wav",
)
print(f"\nProgrammatic test: {'SUCCESS' if success else 'FAILED'}")
PYEOF
echo -e "${CYAN}Created test_programmatic.py${NC}"
run_cmd cat test_programmatic.py
echo ""
run_cmd uv run python test_programmatic.py
echo ""
echo -e "${GREEN}Programmatic output:${NC}"
run_cmd ls -lah output_programmatic/
echo ""
# Summary
echo -e "${CYAN}"
echo "╭──────────────────────────────────────────────────────────╮"
echo "│ Test Summary │"
echo "╰──────────────────────────────────────────────────────────╯"
echo -e "${NC}"
echo -e "${GREEN}✓ CLI help works${NC}"
echo -e "${GREEN}✓ Voice listing works${NC}"
echo -e "${GREEN}✓ Config-based generation works${NC}"
echo -e "${GREEN}✓ Programmatic API works${NC}"
echo ""
echo -e "${CYAN}Test directory: $TEST_DIR${NC}"
echo -e "${CYAN}To clean up: rm -rf $TEST_DIR${NC}"
echo ""
echo -e "${GREEN}All tests completed successfully!${NC}"