-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench.sh
More file actions
executable file
·65 lines (51 loc) · 2.51 KB
/
Copy pathbench.sh
File metadata and controls
executable file
·65 lines (51 loc) · 2.51 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
#!/usr/bin/env bash
# Main entry point for the benchmark suite.
set -e
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
# --- Colors and Styles ---
RESET="\033[0m"
BOLD="\033[1m"
CYAN="\033[36m"
MAGENTA="\033[35m"
DIM="\033[2m"
GREEN="\033[32m"
ACTION=${1:-"run"}
FILTER=${2:-""}
print_header() {
if [ -t 1 ]; then
clear
fi
echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════════════════════════════╗${RESET}"
echo -e "${BOLD}${CYAN}║ ⚡ CODE-IMPL-PATTERN BENCHMARK SUITE ⚡ ║${RESET}"
echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════════════════════════════╝${RESET}"
echo -e " ${BOLD}Action:${RESET} ${MAGENTA}${ACTION^^}${RESET} | ${BOLD}Scope:${RESET} ${DIM}benchmarks/${FILTER:-"all"}${RESET}\n"
}
if [ "$ACTION" = "reports" ]; then
print_header
if [ -n "$FILTER" ]; then
echo -e "${BOLD}${CYAN}-> Generating reports incrementally for:${RESET} ${BOLD}benchmarks/$FILTER${RESET}\n"
python3 scripts/generate-reports.py "$FILTER"
else
echo -e "${BOLD}${CYAN}-> Generating reports for all tasks...${RESET}\n"
python3 scripts/generate-reports.py
fi
echo -e "\n${BOLD}${GREEN}✔ Report generation completed.${RESET}"
if [ -n "$FILTER" ]; then
echo -e "${DIM}Open reports/$FILTER/index.html${RESET}\n"
else
echo -e "${DIM}Open reports/index.html${RESET}\n"
fi
exit 0
fi
print_header
find "benchmarks/$FILTER" -mindepth 1 -maxdepth 4 -name "metadata.json" | sort | while read -r meta_path; do
TARGET_DIR=$(dirname "$meta_path")
DOMAIN=$(echo "$TARGET_DIR" | cut -d'/' -f2)
TASK=$(echo "$TARGET_DIR" | cut -d'/' -f3)
echo -e "${BOLD}${CYAN}◈ Domain:${RESET} $DOMAIN ${DIM}❯${RESET} ${BOLD}${MAGENTA}Task:${RESET} $TASK"
echo -e " ${DIM}└─ Target:${RESET} ${BOLD}$TARGET_DIR${RESET}"
"./scripts/executer/code-impl-pattern.sh" "$ACTION" "$TARGET_DIR"
echo -e "${DIM}──────────────────────────────────────────────────────────────────${RESET}"
done
echo -e "\n${BOLD}${CYAN}✔ All tasks completed successfully.${RESET}\n"