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

TF_RUN 1.1KB

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