chore: Improve testing

main
Sean McBride 4 years ago
parent e895d3fed9
commit 2f9b72bdc2

@ -0,0 +1,19 @@
#!/bin/bash
# Executes the runtime in GDB
# Substitutes the absolute path from the container with a path relatively derived from the location of this script
# This allows debugging outside of the Docker container
# Also disables pagination and stopping on SIGUSR1
experiment_directory=$(pwd)
project_directory=$(cd ../../.. && pwd)
binary_directory=$(cd "$project_directory"/bin && pwd)
export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH"
export PATH="$binary_directory:$PATH"
gdb --eval-command="handle SIGUSR1 nostop" \
--eval-command="handle SIGPIPE nostop" \
--eval-command="set pagination off" \
--eval-command="set substitute-path /sledge/runtime $project_directory" \
--eval-command="run $experiment_directory/spec.json" \
sledgert

@ -20,32 +20,26 @@ else
echo "Running under gdb" echo "Running under gdb"
fi fi
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@samples/goforward.raw" localhost:10000 2>/dev/null # expected_size="$(find expected_result.jpg -printf "%s")"
exit
# WIP - Need to cleanup below
expected_size="$(find expected_result.jpg -printf "%s")"
success_count=0 success_count=0
total_count=50 total_count=50
for ((i = 0; i < total_count; i++)); do for ((i = 0; i < total_count; i++)); do
echo "$i" echo "$i"
ext="$RANDOM" # ext="$RANDOM"
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@plate.jpg" --output "result_$ext.jpg" localhost:10000 2>/dev/null curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@goforward.raw" localhost:10000 2>/dev/null
actual_size="$(find result_"$ext".jpg -printf "%s")"
# # echo "$result"
# echo "$result" # if [[ "$expected_size" == "$actual_size" ]]; then
if [[ "$expected_size" == "$actual_size" ]]; then # echo "SUCCESS $success_count"
echo "SUCCESS $success_count" # else
else # echo "FAIL"
echo "FAIL" # echo "Expected Size:"
echo "Expected Size:" # echo "$expected_size"
echo "$expected_size" # echo "==============================================="
echo "===============================================" # echo "Actual Size:"
echo "Actual Size:" # echo "$actual_size"
echo "$actual_size" # fi
fi
done done
echo "$success_count / $total_count" echo "$success_count / $total_count"

@ -1 +1 @@
Subproject commit 9be33cac8e14bf3c0d647759ef6e68739ae624f5 Subproject commit 859db012144cbcec0cfccaedea4bee45ae50776f
Loading…
Cancel
Save