libcruft-util/test/json/schema/test.sh
Danny Robson 94640d00f0 json: rearrange schema test to allow for modified output
Schemas can insert default values, so we need to be able to test the
resultant files.
2018-07-05 15:02:14 +10:00

25 lines
603 B
Bash
Executable File

#!/bin/bash
tool="/home/danny/src/lobo/build/debug/gcc/cruft/util/json-schema"
src="/home/danny/src/lobo/cruft/util/test/json/schema"
for base in $(ls "${src}"); do
[ -d ${base} ] || continue
echo "testing ${base}"
schema="${base}/schema.json"
for good in $(ls "${base}/good/"*.input.json); do
[ -f "${good}" ] || continue
expected="${good%.input.json}.result.json"
echo "${tool} ${schema} ${good} ${expected}"
done
for bad in $(ls "${base}/bad/"*.json); do
[ -f "${bad}" ] || continue
echo "${tool} ${schema} ${bad}"
done
done