count=0
for basetst in test-suite-data/[A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9]/; do
for tst in ${basetst} ${basetst}[0-9][0-9]/ ${basetst}[0-9][0-9][0-9]/; do
if [ ! -e "$tst/===" ]; then
continue
fi
if [ -e "$tst/error" ]; then
continue
fi
if [ ! -e "$tst/in.json" ]; then
continue
fi
count=`expr $count + 1`
done
done
echo 1..$count
skiplist="C4HZ"
xfaillist=""
i=0
for basetst in test-suite-data/[A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9]/; do
for tst in ${basetst} ${basetst}[0-9][0-9]/ ${basetst}[0-9][0-9][0-9]/; do
if [ -e "$tst/error" ]; then
continue
fi
if [ ! -e "$tst/in.json" ]; then
continue
fi
i=`expr $i + 1`
t=${tst%/}
test_subtest_id=`echo $t | cut -d/ -f2-`
test_id=`echo $test_subtest_id | cut -d/ -f1`
subtest_id=`echo $test_subtest_id | cut -s -d/ -f2`
desctxt=`cat 2>/dev/null "$tst/==="`
directive=""
for skip in $skiplist; do
if [ "$test_subtest_id" == "$skip" ]; then
directive="# SKIP: does not apply to libfyaml"
break
fi
done
res="ok"
if [ "x$directive" == "x" ]; then
t1=`mktemp`
t2=`mktemp`
${TOP_BUILDDIR}/src/fy-tool --dump --strip-labels --strip-tags --strip-doc -r -mjson "$tst/in.yaml" | "${JQ}" --sort-keys . >"$t1"
cat "$tst/in.json" | "${JQ}" --sort-keys . > "$t2"
diff -u "$t1" "$t2"
if [ $? -eq 0 ]; then
res="ok"
else
res="not ok"
fi
rm -f "$t1" "$t2"
for xfail in $xfaillist; do
if [ "$test_subtest_id" == "$xfail" ]; then
directive=" # TODO: known failure."
break
fi
done
fi
echo "$res $i $test_subtest_id - $desctxt (JSON)$directive"
done
done