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

TF_RUN 1.1KB

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