/run_functional_tests.sh

https://bitbucket.org/cistrome/cistrome-harvard/ · Shell · 75 lines · 68 code · 3 blank · 4 comment · 21 complexity · f93cf23f95b4406f4677d43894f12bef MD5 · raw file

  1. #!/bin/sh
  2. # A good place to look for nose info: http://somethingaboutorange.com/mrl/projects/nose/
  3. rm -f run_functional_tests.log
  4. if [ ! $1 ]; then
  5. python ./scripts/functional_tests.py -v --with-nosehtml --html-report-file run_functional_tests.html --exclude="^get" functional
  6. elif [ $1 = 'help' ]; then
  7. echo "'run_functional_tests.sh' for testing all the tools in functional directory"
  8. echo "'run_functional_tests.sh aaa' for testing one test case of 'aaa' ('aaa' is the file name with path)"
  9. echo "'run_functional_tests.sh -id bbb' for testing one tool with id 'bbb' ('bbb' is the tool id)"
  10. echo "'run_functional_tests.sh -sid ccc' for testing one section with sid 'ccc' ('ccc' is the string after 'section::')"
  11. echo "'run_functional_tests.sh -list' for listing all the tool ids"
  12. echo "'run_functional_tests.sh -toolshed' for running all the test scripts in the ./test/tool_shed/functional directory"
  13. echo "'run_functional_tests.sh -toolshed testscriptname' for running one test script named testscriptname in the .test/tool_shed/functional directory"
  14. echo "'run_functional_tests.sh -workflow test.xml' for running a workflow test case as defined by supplied workflow xml test file"
  15. echo "'run_functional_tests.sh -framework' for running through example tool tests testing framework features in test/functional/tools"
  16. echo "'run_functional_tests.sh -framework -id toolid' for testing one framework tool (in test/functional/tools/) with id 'toolid'"
  17. echo "'run_functional_tests.sh -data_managers -id data_manager_id' for testing one Data Manager with id 'data_manager_id'"
  18. elif [ $1 = '-id' ]; then
  19. python ./scripts/functional_tests.py -v functional.test_toolbox:TestForTool_$2 --with-nosehtml --html-report-file run_functional_tests.html
  20. elif [ $1 = '-sid' ]; then
  21. python ./scripts/functional_tests.py --with-nosehtml --html-report-file run_functional_tests.html -v `python tool_list.py $2`
  22. elif [ $1 = '-list' ]; then
  23. python tool_list.py
  24. echo "==========================================================================================================================================="
  25. echo "'run_functional_tests.sh -id bbb' for testing one tool with id 'bbb' ('bbb' is the tool id)"
  26. echo "'run_functional_tests.sh -sid ccc' for testing one section with sid 'ccc' ('ccc' is the string after 'section::')"
  27. elif [ $1 = '-migrated' ]; then
  28. if [ ! $2 ]; then
  29. python ./scripts/functional_tests.py -v functional.test_toolbox --with-nosehtml --html-report-file run_functional_tests.html -migrated
  30. elif [ $2 = '-id' ]; then
  31. # TODO: This option is not tested...
  32. python ./scripts/functional_tests.py -v functional.test_toolbox:TestForTool_$3 --with-nosehtml --html-report-file run_functional_tests.html -migrated
  33. else
  34. python ./scripts/functional_tests.py -v functional.test_toolbox --with-nosehtml --html-report-file run_functional_tests.html -migrated
  35. fi
  36. elif [ $1 = '-installed' ]; then
  37. if [ ! $2 ]; then
  38. python ./scripts/functional_tests.py -v functional.test_toolbox --with-nosehtml --html-report-file run_functional_tests.html -installed
  39. elif [ $2 = '-id' ]; then
  40. # TODO: This option is not tested...
  41. python ./scripts/functional_tests.py -v functional.test_toolbox:TestForTool_$3 --with-nosehtml --html-report-file run_functional_tests.html -installed
  42. else
  43. python ./scripts/functional_tests.py -v functional.test_toolbox --with-nosehtml --html-report-file run_functional_tests.html -installed
  44. fi
  45. elif [ $1 = '-toolshed' ]; then
  46. if [ ! $2 ]; then
  47. python ./test/tool_shed/functional_tests.py -v --with-nosehtml --html-report-file ./test/tool_shed/run_functional_tests.html ./test/tool_shed/functional
  48. else
  49. python ./test/tool_shed/functional_tests.py -v --with-nosehtml --html-report-file ./test/tool_shed/run_functional_tests.html $2
  50. fi
  51. elif [ $1 = '-workflow' ]; then
  52. python ./scripts/functional_tests.py -v functional.workflow:WorkflowTestCase --with-nosehtml --html-report-file ./test/tool_shed/run_functional_tests.html -workflow $2
  53. elif [ $1 = '-data_managers' ]; then
  54. if [ ! $2 ]; then
  55. python ./scripts/functional_tests.py -v functional.test_data_managers --with-nosehtml --html-report-file run_functional_tests.html -data_managers
  56. elif [ $2 = '-id' ]; then
  57. python ./scripts/functional_tests.py -v functional.test_data_managers:TestForDataManagerTool_$3 --with-nosehtml --html-report-file run_functional_tests.html -data_managers
  58. else
  59. python ./scripts/functional_tests.py -v functional.test_data_managers --with-nosehtml --html-report-file run_functional_tests.html -data_managers
  60. fi
  61. elif [ $1 = '-framework' ]; then
  62. if [ ! $2 ]; then
  63. python ./scripts/functional_tests.py -v functional.test_toolbox --with-nosehtml --html-report-file run_functional_tests.html -framework
  64. elif [ $2 = '-id' ]; then
  65. python ./scripts/functional_tests.py -v functional.test_toolbox:TestForTool_$3 --with-nosehtml --html-report-file run_functional_tests.html -framework
  66. else
  67. echo "Invalid test option selected, if -framework first argument to $0, optional second argument must be -id followed a tool id."
  68. fi
  69. else
  70. python ./scripts/functional_tests.py -v --with-nosehtml --html-report-file run_functional_tests.html $1
  71. fi
  72. echo "'run_functional_tests.sh help' for help"