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

TF_RUN 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. . "$TF_DIR/include/subtest.sh"
  3. . "$TF_DIR/include/tools.sh"
  4. flt_ours() {
  5. #
  6. # Filter list of modules on stdin; allow only ours
  7. #
  8. grep -xF \
  9. -e _pretty_plain \
  10. -e _pretty_journald \
  11. -e _pretty_html \
  12. -e sync \
  13. -e _pretty_color \
  14. -e inigrep \
  15. -e _pretty_notify \
  16. -e charmenu \
  17. -e exit \
  18. -e termcolors \
  19. -e pretty \
  20. -e mdfmt \
  21. #FIXME: remove the filter when TFKit learns to test in sandbox
  22. }
  23. shellfu_get_all() {
  24. local t=$1 # type (functions, variables, modules)
  25. sfdoc --all --lsmod \
  26. | flt_ours \
  27. | case $t in
  28. modules) cat ;;
  29. variables) xargs -L1 sfdoc --all --lsvar ;;
  30. functions) xargs -L1 sfdoc --all --lsfun ;;
  31. esac \
  32. | LC_ALL=C sort
  33. }
  34. tf_enum_subtests() {
  35. echo "variables"
  36. echo "functions"
  37. echo "modules"
  38. }
  39. tf_do_subtest() {
  40. local name=$1
  41. tf_testflt -n "$name" -O "oracle/$name.stdout" shellfu_get_all "$name"
  42. }
  43. tf_do_subtests