#!/bin/sh
# Valid tests to run
tests="utest_binary \
       utest_bits \
       utest_boolean \
       utest_common \
       utest_decimal64 \
       utest_diff \
       utest_empty \
       utest_enumeration \
       utest_hash_table \
       utest_identityref \
       utest_inet_types \
       utest_inout \
       utest_instanceid \
       utest_instanceid_keys \
       utest_int16 \
       utest_int32 \
       utest_int64 \
       utest_int8 \
       utest_json \
       utest_leafref \
       utest_list \
       utest_lyb \
       utest_merge \
       utest_metadata \
       utest_nacm \
       utest_new \
       utest_parser_json \
       utest_parser_xml \
       utest_pattern \
       utest_printer_tree \
       utest_printer_xml \
       utest_plugins \
       utest_range \
       utest_schema \
       utest_schema_mount \
       utest_set \
       utest_string \
       utest_structure \
       utest_tree_data \
       utest_tree_schema_compile \
       utest_uint16 \
       utest_uint32 \
       utest_uint64 \
       utest_uint8 \
       utest_union \
       utest_validation \
       utest_xml \
       utest_xpath \
       utest_yang \
       utest_yangdata \
       utest_yang_types \
       utest_yanglib \
       utest_yin"

# cd into right directory
ptestdir=$(dirname "$(readlink -f "$0")")
cd "$ptestdir"/tests || exit

# Run specified tests
for f in $tests
do
    if test -e ./"$f"; then
        if ./"$f" > ./"$f".out 2> ./"$f".err; then
            echo "PASS: $f"
        else
            echo "FAIL: $f"
        fi
    else
        echo "SKIP: $f"
    fi
done
