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

TF_RUN 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_forcecolor \
  14. -e _pretty_color \
  15. -e inigrep \
  16. -e _pretty_notify \
  17. -e charmenu \
  18. -e exit \
  19. -e termcolors \
  20. -e pretty \
  21. -e sfdoc \
  22. -e sfpi \
  23. -e mdfmt \
  24. #FIXME: remove the filter when TFKit learns to test in sandbox
  25. }
  26. shellfu_get_all() {
  27. local t=$1 # type (functions, variables, modules)
  28. sfdoc --all --lsmod \
  29. | flt_ours \
  30. | case $t in
  31. modules) cat ;;
  32. variables) xargs -L1 sfdoc --all --lsvar ;;
  33. functions) xargs -L1 sfdoc --all --lsfun ;;
  34. esac \
  35. | LC_ALL=C sort
  36. }
  37. tf_enum_subtests() {
  38. echo "variables"
  39. echo "functions"
  40. echo "modules"
  41. }
  42. tf_do_subtest() {
  43. local name=$1
  44. tf_testflt -n "$name" -O "oracle/$name.stdout" shellfu_get_all "$name"
  45. }
  46. tf_do_subtests