diff --git a/run_functional_tests.sh b/run_functional_tests.sh
index b467974ef46..f6e01a192d2 100755
--- a/run_functional_tests.sh
+++ b/run_functional_tests.sh
@@ -13,6 +13,8 @@ elif [ $1 = 'help' ]; then
echo "'run_functional_tests.sh -list' for listing all the tool ids"
echo "'run_functional_tests.sh -toolshed' for running all the test scripts in the ./test/tool_shed/functional directory"
echo "'run_functional_tests.sh -toolshed testscriptname' for running one test script named testscriptname in the .test/tool_shed/functional directory"
+ echo "'run_functional_tests.sh -framework' for running through example tool tests testing framework features in test/functional/tools"
+ echo "'run_functional_tests.sh -framework -id toolid' for testing one framework tool (in test/functional/tools/) with id 'toolid'"
elif [ $1 = '-id' ]; then
python ./scripts/functional_tests.py -v functional.test_toolbox:TestForTool_$2 --with-nosehtml --html-report-file run_functional_tests.html
elif [ $1 = '-sid' ]; then
@@ -46,6 +48,14 @@ elif [ $1 = '-toolshed' ]; then
else
python ./test/tool_shed/functional_tests.py -v --with-nosehtml --html-report-file ./test/tool_shed/run_functional_tests.html $2
fi
+elif [ $1 = '-framework' ]; then
+ if [ ! $2 ]; then
+ python ./scripts/functional_tests.py -v functional.test_toolbox --with-nosehtml --html-report-file run_functional_tests.html -framework
+ elif [ $2 = '-id' ]; then
+ python ./scripts/functional_tests.py -v functional.test_toolbox:TestForTool_$3 --with-nosehtml --html-report-file run_functional_tests.html -framework
+ else
+ echo "Invalid test option selected, if -framework first argument to $0, optional second argument must be -id followed a tool id."
+ fi
else
python ./scripts/functional_tests.py -v --with-nosehtml --html-report-file run_functional_tests.html $1
fi
diff --git a/scripts/functional_tests.py b/scripts/functional_tests.py
index c29eec51a2d..6d1e1660389 100644
--- a/scripts/functional_tests.py
+++ b/scripts/functional_tests.py
@@ -178,6 +178,7 @@ def main():
os.environ[ 'HTTP_ACCEPT_LANGUAGE' ] = default_galaxy_locales
testing_migrated_tools = '-migrated' in sys.argv
testing_installed_tools = '-installed' in sys.argv
+ datatypes_conf_override = None
if testing_migrated_tools or testing_installed_tools:
sys.argv.pop()
@@ -197,8 +198,21 @@ def main():
# Exclude all files except test_toolbox.py.
ignore_files = ( re.compile( r'^test_[adghlmsu]*' ), re.compile( r'^test_ta*' ) )
else:
- tool_config_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', 'tool_conf.xml' )
- galaxy_test_file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR', default_galaxy_test_file_dir )
+ framework_test = '-framework' in sys.argv # Run through suite of tests testing framework.
+ if framework_test:
+ sys.argv.pop()
+ framework_tool_dir = os.path.join('test', 'functional', 'tools')
+ tool_conf = os.path.join( framework_tool_dir, 'samples_tool_conf.xml' )
+ datatypes_conf_override = os.path.join( framework_tool_dir, 'sample_datatypes_conf.xml' )
+ test_dir = os.path.join( framework_tool_dir, 'test-data')
+
+ tool_path = framework_tool_dir
+ else:
+ # Use tool_conf.xml toolbox.
+ tool_conf = 'tool_conf.xml'
+ test_dir = default_galaxy_test_file_dir
+ tool_config_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', tool_conf )
+ galaxy_test_file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR', test_dir )
if not os.path.isabs( galaxy_test_file_dir ):
galaxy_test_file_dir = os.path.join( os.getcwd(), galaxy_test_file_dir )
library_import_dir = galaxy_test_file_dir
@@ -338,6 +352,8 @@ def main():
if use_distributed_object_store:
kwargs[ 'object_store' ] = 'distributed'
kwargs[ 'distributed_object_store_config_file' ] = 'distributed_object_store_conf.xml.sample'
+ if datatypes_conf_override:
+ kwargs[ 'datatypes_config_file' ] = datatypes_conf_override
# If the user has passed in a path for the .ini file, do not overwrite it.
galaxy_config_file = os.environ.get( 'GALAXY_TEST_INI_FILE', None )
if not galaxy_config_file:
diff --git a/test/functional/tools/README.txt b/test/functional/tools/README.txt
new file mode 100644
index 00000000000..52671e96143
--- /dev/null
+++ b/test/functional/tools/README.txt
@@ -0,0 +1,3 @@
+This directory contains tools only useful for testing the tool test framework
+and demonstrating it features. Run the driver script 'run_functional_tests.sh'
+with '-installed' as first argument to run through these tests.
diff --git a/test/functional/tools/multi_repeats.xml b/test/functional/tools/multi_repeats.xml
new file mode 100644
index 00000000000..38e364b9ad9
--- /dev/null
+++ b/test/functional/tools/multi_repeats.xml
@@ -0,0 +1,39 @@
+
+ tail-to-head
+
+ cat $input1 #for $q in $queries# ${q.input2} #end for# #for $q in $more_queries# ${q.more_queries_input} #end for# > $out_file1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/functional/tools/sample_datatypes_conf.xml b/test/functional/tools/sample_datatypes_conf.xml
new file mode 100644
index 00000000000..1b838c38339
--- /dev/null
+++ b/test/functional/tools/sample_datatypes_conf.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml
new file mode 100644
index 00000000000..5bc9dd7c689
--- /dev/null
+++ b/test/functional/tools/samples_tool_conf.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/functional/tools/test-data/simple_line.txt b/test/functional/tools/test-data/simple_line.txt
new file mode 100644
index 00000000000..f71ace9cbbd
--- /dev/null
+++ b/test/functional/tools/test-data/simple_line.txt
@@ -0,0 +1 @@
+This is a line of text.
diff --git a/test/functional/tools/test-data/simple_line_x2.txt b/test/functional/tools/test-data/simple_line_x2.txt
new file mode 100644
index 00000000000..0fbb0d8960f
--- /dev/null
+++ b/test/functional/tools/test-data/simple_line_x2.txt
@@ -0,0 +1,2 @@
+This is a line of text.
+This is a line of text.
diff --git a/test/functional/tools/test-data/simple_line_x3.txt b/test/functional/tools/test-data/simple_line_x3.txt
new file mode 100644
index 00000000000..348d98593b3
--- /dev/null
+++ b/test/functional/tools/test-data/simple_line_x3.txt
@@ -0,0 +1,3 @@
+This is a line of text.
+This is a line of text.
+This is a line of text.
diff --git a/test/functional/tools/test-data/simple_line_x5.txt b/test/functional/tools/test-data/simple_line_x5.txt
new file mode 100644
index 00000000000..bdd333b9b1b
--- /dev/null
+++ b/test/functional/tools/test-data/simple_line_x5.txt
@@ -0,0 +1,5 @@
+This is a line of text.
+This is a line of text.
+This is a line of text.
+This is a line of text.
+This is a line of text.
diff --git a/test/functional/tools/upload.py b/test/functional/tools/upload.py
new file mode 120000
index 00000000000..6cf43a566b3
--- /dev/null
+++ b/test/functional/tools/upload.py
@@ -0,0 +1 @@
+../../../tools/data_source/upload.py
\ No newline at end of file
diff --git a/test/functional/tools/upload.xml b/test/functional/tools/upload.xml
new file mode 120000
index 00000000000..3096f6a2d4c
--- /dev/null
+++ b/test/functional/tools/upload.xml
@@ -0,0 +1 @@
+../../../tools/data_source/upload.xml
\ No newline at end of file