12345678910111213141516171819202122232425262728293031323334353637 |
- #!/bin/bash
- #shellcheck disable=SC1090
-
- . "$TF_DIR/include/subtest.sh"
- . "$TF_DIR/include/tools.sh"
-
- tf_enum_subtests() {
- echo one
- echo two
- echo three
- }
-
- my_sut() {
- local word=$1
- declare -A map
- map[one]=1
- map[two]=2
- map[three]=33
- echo "${map[$word]}"
- }
-
- mkoracle() {
- mkdir -p oracle
- case $subtest in
- one) echo 1 ;;
- two) echo 2 ;;
- three) echo 3 ;;
- esac > "oracle/$subtest.stdout"
- }
-
- tf_do_subtest() {
- local subtest=$1
- mkoracle
- tf_testflt -n "$subtest" -O "oracle/$subtest.stdout" "my_sut $subtest"
- }
-
- tf_do_subtests
|