1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #!/bin/bash
- #shellcheck disable=SC1090
-
- . "$TF_DIR/include/subtest.sh"
- . "$TF_DIR/include/tools.sh"
-
-
- tf_enum_subtests() {
- echo name
- echo name_ex
- echo world
- }
-
- mkini() {
- mkdir -p "test/ini"
- {
- echo '[echo]'
- echo ' prefix = Hello'
- } > "test/ini/echo.ini"
- }
-
- mkoracle_out() {
- mkdir -p oracle
- case $TF_SUBTEST in
- name) echo 'HelloJoe' ;;
- name_ex) echo 'HelloMaggie!' ;;
- world) echo 'HelloWorld' ;;
- esac > "oracle/$TF_SUBTEST.stdout"
- }
-
- mkoracle_err() {
- mkdir -p oracle
- true > "oracle/$TF_SUBTEST.stderr"
- }
-
- mkoracle_es() {
- return 0
- }
-
- mkresult() {
- local what
- case $TF_SUBTEST in
- name) what="Joe" ;;
- name_ex) what="Maggie!" ;;
- world) what="World" ;;
- esac
- (
- export PRETTY=plain
- export SATURNIN_CONF_PATH="test/ini"
- saturnin-demo echo "$what"
- )
- }
-
- tf_do_subtest() {
- local o_es
- mkini
- mkoracle_out
- mkoracle_err
- mkoracle_es; o_es=$?
- tf_testflt \
- -n "$TF_SUBTEST" \
- -O "oracle/$TF_SUBTEST.stdout" \
- -E "oracle/$TF_SUBTEST.stderr" \
- -S "$o_es" \
- "mkresult"
- }
-
- tf_do_subtests
|