#!/usr/bin/env bash 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 # there must be a test there if [ ! -e "$tst/===" ]; then continue fi # skip tests that are expected to fail if [ -e "$tst/error" ]; then continue fi # there must be an alias in the test grep -q '\*[A-Za-z]' "$tst/in.yaml" if [ $? -ne 0 ]; then continue fi count=`expr $count + 1` done done # output plan echo 1..$count declare -A skips=( [2JQS]="duplicate keys in testcase; cannot load as document" [X38W]="duplicate keys after resolution" ) declare -A xfails=( ) 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 # there must be a test there if [ ! -e "$tst/===" ]; then continue fi # skip tests that are expected to fail if [ -e "$tst/error" ]; then continue fi # there must be an alias in the test grep -q '\*[A-Za-z]' "$tst/in.yaml" if [ $? -ne 0 ]; then continue fi i=`expr $i + 1` # strip trailing / t=${tst%/} # remove test-suite-data/ 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/==="` t1=`mktemp` t2=`mktemp` directive="" skip_reason="${skips[$test_subtest_id]}" if [ "x$skip_reason" != "x" ]; then directive=" # SKIP: ${skip_reason}" fi res="ok" if [ "x$skip_reason" = "x" ]; then res="not ok" ${TOP_BUILDDIR}/src/fy-tool --dump --resolve "$tst/in.yaml" | ${TOP_BUILDDIR}/src/fy-tool --testsuite --disable-flow-markers - >"$t1" ${TOP_BUILDDIR}/src/fy-tool --dump --resolve --streaming "$tst/in.yaml" | ${TOP_BUILDDIR}/src/fy-tool --testsuite --disable-flow-markers - >"$t2" diff -u "$t1" "$t2" if [ $? -eq 0 ]; then res="ok" else res="not ok" fi xfail_reason="${xfails[$test_subtest_id]}" if [ "x$xfail_reason" != "x" ]; then directive=" # TODO: ${xfail_reason}" fi fi rm -f "$t1" "$t2" echo "$res $i $test_subtest_id - $desctxt$directive" done done