#!/bin/bash echo "=== 자동화 테스트 실행 스크립트 ===" echo "" # 색상 정의 RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # 테스트 결과 저장 디렉토리 생성 mkdir -p test_results # 현재 시간 TIMESTAMP=$(date +"%Y%m%d_%H%M%S") echo "1. 프로젝트 의존성 확인..." flutter pub get echo "" echo "2. 코드 생성 (Freezed, JsonSerializable)..." flutter pub run build_runner build --delete-conflicting-outputs echo "" echo "3. 단위 테스트 실행..." flutter test test/unit --reporter json > test_results/unit_test_$TIMESTAMP.json || { echo -e "${RED}단위 테스트 실패${NC}" } echo "" echo "4. 위젯 테스트 실행..." flutter test test/widget --reporter json > test_results/widget_test_$TIMESTAMP.json || { echo -e "${RED}위젯 테스트 실패${NC}" } echo "" echo "5. 통합 테스트 실행..." echo " - Mock API 테스트..." flutter test test/integration/mock --reporter json > test_results/mock_test_$TIMESTAMP.json || { echo -e "${RED}Mock API 테스트 실패${NC}" } echo "" echo "6. 자동화 테스트 실행..." echo " - 장비 입고 자동화 테스트..." flutter test test/integration/automated/run_equipment_in_test.dart --reporter expanded || { echo -e "${RED}장비 입고 자동화 테스트 실패${NC}" echo -e "${YELLOW}에러 로그를 확인하세요.${NC}" } echo "" echo "=== 테스트 완료 ===" echo "결과 파일들은 test_results/ 디렉토리에 저장되었습니다." echo "" # 간단한 요약 표시 echo "테스트 요약:" echo "------------" find test_results -name "*_test_$TIMESTAMP.json" -exec echo "- {}" \;