forked from eclipse-velocitas/vehicle-app-cpp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-mode2.sh
More file actions
executable file
Β·672 lines (532 loc) Β· 20 KB
/
test-mode2.sh
File metadata and controls
executable file
Β·672 lines (532 loc) Β· 20 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
#!/bin/bash
# Mode 2 Blackbox Utility Test Script
# Tests the velocitas-quick container with optional proxy configuration
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Configuration
CONTAINER_NAME="velocitas-quick"
PROXY_CONTAINER_NAME="velocitas-quick-proxy"
TEST_RESULTS_DIR="test_results"
LOG_FILE=""
USE_PROXY=false
USE_VERBOSE=false
PROXY_HOST="127.0.0.1:3128"
TEST_TIMEOUT=120
# Test counters
TOTAL_TESTS=0
PASSED_TESTS=0
FAILED_TESTS=0
# Usage function
show_usage() {
cat << EOF
Mode 2 Blackbox Utility Test Script
Usage: $0 [OPTIONS]
This script runs comprehensive tests for the velocitas-quick container including:
- Basic build functionality (8 tests)
- Granular commands (gen-model, compile, finalize + aliases) (5 tests)
- Run/rerun commands (2 tests)
- Sequential granular workflow (1 test)
- Verbose build mode (1 test)
Total: 17 test cases covering all velocitas-quick functionality
OPTIONS:
-p, --proxy Enable proxy testing (default: false)
--proxy-host HOST Proxy host:port (default: 127.0.0.1:3128)
-v, --verbose Enable verbose build mode testing (default: false)
-t, --timeout SEC Test timeout in seconds (default: 120)
-o, --output DIR Output directory for logs (default: test_results)
-h, --help Show this help message
EXAMPLES:
# Run all 17 tests without proxy
$0
# Run all tests with proxy
$0 --proxy
# Run tests with verbose mode
$0 --verbose
# Run tests with proxy and verbose mode
$0 --proxy --verbose
# Run tests with custom proxy host
$0 --proxy --proxy-host 192.168.1.100:8080
# Run tests with custom timeout and output directory
$0 --proxy --verbose --timeout 180 --output my_test_results
EOF
}
# Parse command line arguments
parse_args() {
while [[ $# -gt 0 ]]; do
case $1 in
-p|--proxy)
USE_PROXY=true
shift
;;
--proxy-host)
PROXY_HOST="$2"
shift 2
;;
-v|--verbose)
USE_VERBOSE=true
shift
;;
-t|--timeout)
TEST_TIMEOUT="$2"
shift 2
;;
-o|--output)
TEST_RESULTS_DIR="$2"
shift 2
;;
-h|--help)
show_usage
exit 0
;;
*)
echo "Unknown option: $1"
show_usage
exit 1
;;
esac
done
}
# Initialize test environment
init_test_env() {
# Create test results directory
mkdir -p "$TEST_RESULTS_DIR"
# Set log file name
if [[ "$USE_PROXY" == "true" ]]; then
LOG_FILE="$TEST_RESULTS_DIR/proxy_test_$(date +%Y%m%d_%H%M%S).txt"
CONTAINER_NAME="$PROXY_CONTAINER_NAME"
else
LOG_FILE="$TEST_RESULTS_DIR/no_proxy_test_$(date +%Y%m%d_%H%M%S).txt"
fi
# Initialize log file
{
echo "π§ͺ Mode 2 Test Suite - $(date)"
echo "π Configuration:"
echo " Proxy: $USE_PROXY"
if [[ "$USE_PROXY" == "true" ]]; then
echo " Proxy Host: $PROXY_HOST"
fi
echo " Verbose: $USE_VERBOSE"
echo " Container: $CONTAINER_NAME"
echo " Timeout: ${TEST_TIMEOUT}s"
echo " Output: $TEST_RESULTS_DIR"
echo ""
echo "π System Info:"
echo " Docker: $(docker --version)"
echo " OS: $(uname -a)"
echo " Disk: $(df -h / | tail -1)"
echo ""
} | tee "$LOG_FILE"
}
# Helper function to build proxy arguments
get_proxy_args() {
if [[ "$USE_PROXY" == "true" ]]; then
echo "-e HTTP_PROXY=http://$PROXY_HOST -e HTTPS_PROXY=http://$PROXY_HOST -e http_proxy=http://$PROXY_HOST -e https_proxy=http://$PROXY_HOST"
fi
}
# Helper function to build verbose arguments
get_verbose_args() {
if [[ "$USE_VERBOSE" == "true" ]]; then
echo "-e VERBOSE_BUILD=1"
fi
}
# Helper function to build combined environment arguments
get_env_args() {
local proxy_args=$(get_proxy_args)
local verbose_args=$(get_verbose_args)
local network_args=$(get_network_args)
echo "$proxy_args $verbose_args $network_args"
}
# Helper function to build proxy build arguments
get_proxy_build_args() {
if [[ "$USE_PROXY" == "true" ]]; then
echo "--build-arg HTTP_PROXY=http://$PROXY_HOST --build-arg HTTPS_PROXY=http://$PROXY_HOST --build-arg http_proxy=http://$PROXY_HOST --build-arg https_proxy=http://$PROXY_HOST --network=host"
fi
}
# Helper function to get network arguments
get_network_args() {
if [[ "$USE_PROXY" == "true" ]]; then
echo "--network=host"
fi
}
# Log test start
log_test_start() {
local test_num=$1
local test_name=$2
TOTAL_TESTS=$((TOTAL_TESTS + 1))
echo -e "${BLUE}π§ TEST $test_num: $test_name${NC}"
echo "π§ TEST $test_num: $test_name" >> "$LOG_FILE"
echo "Started: $(date)" >> "$LOG_FILE"
}
# Log test result
log_test_result() {
local test_num=$1
local test_name=$2
local exit_code=$3
local duration=$4
echo "Completed: $(date)" >> "$LOG_FILE"
echo "Exit Code: $exit_code" >> "$LOG_FILE"
echo "Duration: ${duration}s" >> "$LOG_FILE"
echo "" >> "$LOG_FILE"
if [[ $exit_code -eq 0 ]]; then
PASSED_TESTS=$((PASSED_TESTS + 1))
echo -e "${GREEN}β
TEST $test_num PASSED: $test_name${NC}"
echo "β
TEST $test_num PASSED: $test_name" >> "$LOG_FILE"
else
FAILED_TESTS=$((FAILED_TESTS + 1))
echo -e "${RED}β TEST $test_num FAILED: $test_name${NC}"
echo "β TEST $test_num FAILED: $test_name" >> "$LOG_FILE"
fi
}
# Test 1: Container Build
test_container_build() {
log_test_start 1 "Container Build"
local start_time=$(date +%s)
local build_args=$(get_proxy_build_args)
if [[ "$USE_VERBOSE" == "true" ]]; then
# Verbose mode: show build output to console and log
echo -e "${BLUE}π§ Building container with verbose output...${NC}"
if [[ "$USE_PROXY" == "true" ]]; then
docker build -f Dockerfile.quick $build_args -t "$CONTAINER_NAME" . 2>&1 | tee -a "$LOG_FILE"
else
docker build -f Dockerfile.quick -t "$CONTAINER_NAME" . 2>&1 | tee -a "$LOG_FILE"
fi
else
# Normal mode: hide build output
if [[ "$USE_PROXY" == "true" ]]; then
docker build -f Dockerfile.quick $build_args -t "$CONTAINER_NAME" . >> "$LOG_FILE" 2>&1
else
docker build -f Dockerfile.quick -t "$CONTAINER_NAME" . >> "$LOG_FILE" 2>&1
fi
fi
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 1 "Container Build" $exit_code $duration
return $exit_code
}
# Test 2: Help Command
test_help_command() {
log_test_start 2 "Help Command"
local start_time=$(date +%s)
docker run --rm "$CONTAINER_NAME" help >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 2 "Help Command" $exit_code $duration
return $exit_code
}
# Test 3: Basic Build via Stdin
test_basic_build_stdin() {
log_test_start 3 "Basic Build via Stdin"
local start_time=$(date +%s)
local env_args=$(get_env_args)
timeout "$TEST_TIMEOUT" bash -c "cat templates/app/src/VehicleApp.template.cpp | docker run --rm -i $env_args '$CONTAINER_NAME' build" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 3 "Basic Build via Stdin" $exit_code $duration
return $exit_code
}
# Test 4: Validation Command
test_validation_command() {
log_test_start 4 "Validation Command"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "cat templates/app/src/VehicleApp.template.cpp | docker run --rm -i $proxy_args '$CONTAINER_NAME' validate" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 4 "Validation Command" $exit_code $duration
return $exit_code
}
# Test 5: Custom VSS Support
test_custom_vss() {
log_test_start 5 "Custom VSS Support"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "cat templates/app/src/VehicleApp.template.cpp | docker run --rm -i $proxy_args -e VSS_SPEC_URL=https://raw.githubusercontent.com/COVESA/vehicle_signal_specification/main/spec/VehicleSignalSpecification.json '$CONTAINER_NAME' build" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 5 "Custom VSS Support" $exit_code $duration
return $exit_code
}
# Test 6: Error Handling
test_error_handling() {
log_test_start 6 "Error Handling"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "echo 'invalid cpp code' | docker run --rm -i $proxy_args '$CONTAINER_NAME' build" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
# For error handling test, we expect failure (exit code 1)
if [[ $exit_code -eq 1 ]]; then
exit_code=0 # Convert expected failure to success
else
exit_code=1 # Unexpected success or other error
fi
log_test_result 6 "Error Handling" $exit_code $duration
return $exit_code
}
# Test 7: File Mount Input
test_file_mount_input() {
log_test_start 7 "File Mount Input"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "docker run --rm -v \$(pwd)/templates/app/src/VehicleApp.template.cpp:/input $proxy_args '$CONTAINER_NAME' build" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 7 "File Mount Input" $exit_code $duration
return $exit_code
}
# Test 8: Directory Mount Input
test_directory_mount_input() {
log_test_start 8 "Directory Mount Input"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "docker run --rm -v \$(pwd)/templates/app/src/VehicleApp.template.cpp:/input/VehicleApp.cpp $proxy_args '$CONTAINER_NAME' build" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 8 "Directory Mount Input" $exit_code $duration
return $exit_code
}
# Test 9: Granular Command - gen-model
test_granular_gen_model() {
log_test_start 9 "Granular Command - gen-model"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "docker run --rm $proxy_args '$CONTAINER_NAME' gen-model" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 9 "Granular Command - gen-model" $exit_code $duration
return $exit_code
}
# Test 10: Granular Command - model (alias)
test_granular_model_alias() {
log_test_start 10 "Granular Command - model (alias)"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "docker run --rm $proxy_args '$CONTAINER_NAME' model" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 10 "Granular Command - model (alias)" $exit_code $duration
return $exit_code
}
# Test 11: Granular Command - compile
test_granular_compile() {
log_test_start 11 "Granular Command - compile"
local start_time=$(date +%s)
local env_args=$(get_env_args)
timeout "$TEST_TIMEOUT" bash -c "cat templates/app/src/VehicleApp.template.cpp | docker run --rm -i $env_args '$CONTAINER_NAME' compile" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 11 "Granular Command - compile" $exit_code $duration
return $exit_code
}
# Test 12: Granular Command - build-cpp (alias)
test_granular_build_cpp_alias() {
log_test_start 12 "Granular Command - build-cpp (alias)"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "cat templates/app/src/VehicleApp.template.cpp | docker run --rm -i $proxy_args '$CONTAINER_NAME' build-cpp" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 12 "Granular Command - build-cpp (alias)" $exit_code $duration
return $exit_code
}
# Test 13: Granular Command - finalize
test_granular_finalize() {
log_test_start 13 "Granular Command - finalize"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
timeout "$TEST_TIMEOUT" bash -c "docker run --rm $proxy_args '$CONTAINER_NAME' finalize" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 13 "Granular Command - finalize" $exit_code $duration
return $exit_code
}
# Test 14: Run Command (build and run)
test_run_command() {
log_test_start 14 "Run Command (build and run)"
local start_time=$(date +%s)
local env_args=$(get_env_args)
# Run command always needs --network=host for service connectivity
local network_host=""
if [[ "$USE_PROXY" != "true" ]]; then
network_host="--network=host"
fi
timeout "$TEST_TIMEOUT" bash -c "cat templates/app/src/VehicleApp.template.cpp | docker run --rm -i $network_host $env_args '$CONTAINER_NAME' run" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 14 "Run Command (build and run)" $exit_code $duration
return $exit_code
}
# Test 15: Rerun Command (pre-built template)
test_rerun_command() {
log_test_start 15 "Rerun Command (pre-built template)"
local start_time=$(date +%s)
local env_args=$(get_env_args)
# Rerun command always needs --network=host for service connectivity
local network_host=""
if [[ "$USE_PROXY" != "true" ]]; then
network_host="--network=host"
fi
timeout "$TEST_TIMEOUT" bash -c "docker run --rm $network_host $env_args '$CONTAINER_NAME' rerun" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 15 "Rerun Command (pre-built template)" $exit_code $duration
return $exit_code
}
# Test 16: Granular Workflow (sequential steps)
test_granular_workflow() {
log_test_start 16 "Granular Workflow (sequential steps)"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
local workflow_success=true
echo "Step 1: Generate model..." >> "$LOG_FILE"
if ! timeout "$TEST_TIMEOUT" bash -c "docker run --rm $proxy_args '$CONTAINER_NAME' gen-model" >> "$LOG_FILE" 2>&1; then
workflow_success=false
fi
echo "Step 2: Compile application..." >> "$LOG_FILE"
if [[ "$workflow_success" == "true" ]]; then
if ! timeout "$TEST_TIMEOUT" bash -c "cat templates/app/src/VehicleApp.template.cpp | docker run --rm -i $proxy_args '$CONTAINER_NAME' compile" >> "$LOG_FILE" 2>&1; then
workflow_success=false
fi
fi
echo "Step 3: Finalize build..." >> "$LOG_FILE"
if [[ "$workflow_success" == "true" ]]; then
if ! timeout "$TEST_TIMEOUT" bash -c "docker run --rm $proxy_args '$CONTAINER_NAME' finalize" >> "$LOG_FILE" 2>&1; then
workflow_success=false
fi
fi
local exit_code=0
if [[ "$workflow_success" != "true" ]]; then
exit_code=1
fi
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_test_result 16 "Granular Workflow (sequential steps)" $exit_code $duration
return $exit_code
}
# Test 17: Verbose Build Mode
test_verbose_build_mode() {
log_test_start 17 "Verbose Build Mode"
local start_time=$(date +%s)
local proxy_args=$(get_proxy_args)
# Force verbose mode for this test regardless of USE_VERBOSE setting
timeout "$TEST_TIMEOUT" bash -c "cat templates/app/src/VehicleApp.template.cpp | docker run --rm -i $proxy_args -e VERBOSE_BUILD=1 '$CONTAINER_NAME' build" >> "$LOG_FILE" 2>&1
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
# Check if verbose output was actually generated
if [[ $exit_code -eq 0 ]] && grep -q "Dependencies installed/verified successfully\|VSS specification downloaded\|C++ compilation completed successfully" "$LOG_FILE"; then
log_test_result 17 "Verbose Build Mode" 0 $duration
return 0
else
log_test_result 17 "Verbose Build Mode" 1 $duration
return 1
fi
}
# Run all tests
run_all_tests() {
echo -e "${YELLOW}π Starting Mode 2 Test Suite...${NC}"
echo ""
# Check if VehicleApp template exists
if [[ ! -f "templates/app/src/VehicleApp.template.cpp" ]]; then
echo -e "${RED}β ERROR: templates/app/src/VehicleApp.template.cpp not found${NC}"
exit 1
fi
# Run basic tests
test_container_build || true
test_help_command || true
test_basic_build_stdin || true
test_validation_command || true
test_custom_vss || true
test_error_handling || true
test_file_mount_input || true
test_directory_mount_input || true
# Run granular command tests
test_granular_gen_model || true
test_granular_model_alias || true
test_granular_compile || true
test_granular_build_cpp_alias || true
test_granular_finalize || true
# Run run/rerun command tests
test_run_command || true
test_rerun_command || true
# Run granular workflow test
test_granular_workflow || true
# Run verbose mode test
test_verbose_build_mode || true
}
# Print summary
print_summary() {
echo ""
echo -e "${YELLOW}π TEST SUMMARY${NC}"
echo "============================================"
echo "Total Tests: $TOTAL_TESTS"
echo -e "Passed: ${GREEN}$PASSED_TESTS${NC}"
echo -e "Failed: ${RED}$FAILED_TESTS${NC}"
echo "Success Rate: $(( PASSED_TESTS * 100 / TOTAL_TESTS ))%"
echo ""
if [[ "$USE_PROXY" == "true" ]]; then
echo -e "${BLUE}π Proxy Configuration: $PROXY_HOST${NC}"
else
echo -e "${BLUE}π« No Proxy Configuration${NC}"
fi
echo -e "${BLUE}π Log File: $LOG_FILE${NC}"
echo ""
# Write summary to log file
{
echo ""
echo "π TEST SUMMARY"
echo "============================================"
echo "Total Tests: $TOTAL_TESTS"
echo "Passed: $PASSED_TESTS"
echo "Failed: $FAILED_TESTS"
echo "Success Rate: $(( PASSED_TESTS * 100 / TOTAL_TESTS ))%"
echo "Completed: $(date)"
} >> "$LOG_FILE"
if [[ $FAILED_TESTS -gt 0 ]]; then
echo -e "${RED}β Some tests failed. Check the log file for details.${NC}"
exit 1
else
echo -e "${GREEN}β
All tests passed successfully!${NC}"
exit 0
fi
}
# Cleanup function
cleanup() {
echo ""
echo -e "${YELLOW}π§Ή Cleaning up...${NC}"
# Remove test containers if they exist
docker ps -a --format "table {{.Names}}" | grep -E "^test_" | xargs -r docker rm -f 2>/dev/null || true
echo -e "${GREEN}β
Cleanup completed${NC}"
}
# Signal handlers
trap cleanup EXIT
trap 'echo ""; echo -e "${RED}β Test interrupted${NC}"; exit 130' INT TERM
# Main execution
main() {
parse_args "$@"
init_test_env
run_all_tests
print_summary
}
# Run main function with all arguments
main "$@"