-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbench.sh
29 lines (24 loc) · 825 Bytes
/
bench.sh
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
#!/bin/bash
while IFS= read -r -d $'\0' framework_file; do
framework=$(basename "$framework_file" .dart)
frameworks+=("$framework")
done < <(find ./frameworks -maxdepth 1 -type f -name "*.dart" -print0)
if [ ${#frameworks[@]} -eq 0 ]; then
echo "Error: No Dart files found in ./frameworks directory."
exit 1
fi
for framework in "${frameworks[@]}"
do
echo "==================== $framework ===================="
echo "$(date)"
# compile to native
echo "Compiling $framework to native..."
dart compile exe "frameworks/$framework.dart" -o "frameworks/$framework" || exit 1
echo "Running benchmark for $framework..."
{ ./frameworks/$framework | tee bench/$framework.md; } 2>&1;
rm "frameworks/$framework"
if [ $? -ne 0 ]; then
echo "Error running benchmark for $framework"
exit 1
fi
done