shell dot on steroids https://pagure.io/shellfu

TF_RUN 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. . "$TF_DIR/include/subtest.sh"
  3. . "$TF_DIR/include/tools.sh"
  4. tf_enum_subtests() {
  5. #
  6. # Enumerate tests to run
  7. #
  8. echo lsx_tricky
  9. echo lsv_tricky
  10. echo lsf_tricky
  11. echo direct_path
  12. echo included_path
  13. echo nonesuch
  14. echo empty
  15. echo naked
  16. echo simplest
  17. echo simple
  18. echo tricky
  19. echo simple_by_fun
  20. echo simple_by_var
  21. }
  22. export SHELLFU_PATH=test/include
  23. tf_do_subtest() {
  24. #
  25. # Decode parts of test case name and compose test command
  26. #
  27. local name=$1
  28. local cmd
  29. local o_es=0
  30. case $name in
  31. nonesuch) o_es=3 ;;
  32. esac
  33. case $name in
  34. lsx_tricky) cmd="sfdoc --ls test/include/tricky.sh" ;;
  35. lsv_tricky) cmd="sfdoc --lsvar test/include/tricky.sh" ;;
  36. lsf_tricky) cmd="sfdoc --lsfun test/include/tricky.sh" ;;
  37. direct_path) cmd="sfdoc -e markdown test/other/path.sh" ;;
  38. included_path) cmd="sfdoc -I test/other -e markdown path" ;;
  39. simple_by_fun) cmd="sfdoc -O -e markdown simple_foo" ;;
  40. simple_by_var) cmd="sfdoc -O -e markdown SIMPLE_LIMIT" ;;
  41. *) cmd="sfdoc -e markdown $name" ;;
  42. esac
  43. tf_testflt -n "$name" -O "oracle/$name.stdout" -E "oracle/$name.stderr" -S "$o_es" "$cmd"
  44. }
  45. tf_do_subtests