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