PageRenderTime 49ms CodeModel.GetById 25ms app.highlight 18ms RepoModel.GetById 2ms app.codeStats 0ms

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