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

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