test: Add diff tests
This commit is contained in:
parent
a7484f1748
commit
43f19610f6
1 changed files with 26 additions and 0 deletions
26
test/test_all.sh
Executable file
26
test/test_all.sh
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Directory paths
|
||||||
|
DATA_DIR='../data'
|
||||||
|
CORRECT_DIR='../correct_results'
|
||||||
|
|
||||||
|
IMG_TYPES=('normal' 'depth' 'id')
|
||||||
|
|
||||||
|
for json_file in ${DATA_DIR}/*.json; do
|
||||||
|
base_name=$(basename "${json_file}" '.json')
|
||||||
|
echo "Testing ${base_name}..."
|
||||||
|
|
||||||
|
../build/raycasting "${json_file}" > /dev/null
|
||||||
|
|
||||||
|
for img_type in "${IMG_TYPES[@]}"; do
|
||||||
|
diff "${img_type}.png" "${CORRECT_DIR}/${base_name}-${img_type}.png"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
for img_type in "${IMG_TYPES[@]}"; do
|
||||||
|
rm "${img_type}.png"
|
||||||
|
done
|
||||||
|
|
Reference in a new issue