Add more sample tools for tool testing framework.

Adding multi_select.xml, which demonstrates twill cannot deal with - at the beginning of select param values - this test works immediately with API interactor.

Also adding a multi_output.xml, this is a tool using variable number of outputs (force_refresh=True), both interactors pass this but it is a good test to verify that.

Also adding example to test multi-page tools (multi_page.xml) - both interactors pass this test. Though the API needed to be adjusted to allow its use (in a previous changeset).

Also adding example tool demonstrating extra_files output.

Finally, a tool simple_constructs.xml that just tests the basics, various parameter types, simple conditional, and simple repeat.
This commit is contained in:
John Chilton
2013-11-21 19:17:12 -06:00
parent 036fd68a44
commit a0d6d113ab
6 changed files with 156 additions and 0 deletions
@@ -0,0 +1,24 @@
<tool id="composite_output" name="composite_output" version="1.0.0">
<command>mkdir $output.extra_files_path; cp $input.extra_files_path/* $output.extra_files_path</command>
<inputs>
<param name="input" type="data" format="velvet" label="Velvet Dataset" help="Prepared by velveth."/>
</inputs>
<outputs>
<data format="velvet" name="output" label="">
</data>
</outputs>
<tests>
<test>
<param name="input" value="velveth_test1/output.html" ftype="velvet" >
<composite_data value='velveth_test1/Sequences' ftype="Sequences"/>
<composite_data value='velveth_test1/Roadmaps' ftype="Roadmaps"/>
<composite_data value='velveth_test1/Log'/>
</param>
<output name="output" file="velveth_test1/output.html">
<extra_files type="file" name="Sequences" value="velveth_test1/Sequences" />
<extra_files type="file" name="Roadmaps" value="velveth_test1/Roadmaps" />
<extra_files type="file" name="Log" value="velveth_test1/Log" />
</output>
</test>
</tests>
</tool>
+22
View File
@@ -0,0 +1,22 @@
<tool id="multi_output" name="Multi_Output" description="multi_output" force_history_refresh="True" version="0.1.0">
<command>
echo "Hello" > $report;
echo "World" > '${__new_file_path__}/primary_${report.id}_moo_visible_?'
</command>
<inputs>
<param name="input" type="integer" value="7" />
</inputs>
<outputs>
<data format="txt" name="report" />
</outputs>
<tests>
<test>
<param name="input" value="7" />
<output name="report">
<assert_contents>
<has_line line="Hello" />
</assert_contents>
</output>
</test>
</tests>
</tool>
+29
View File
@@ -0,0 +1,29 @@
<tool id="multi_page" name="Multi_Page" description="multi_page" version="0.1.0">
<configfiles>
<configfile name="config">${p1} ${p2}</configfile>
</configfiles>
<command>cat $config > $output</command>
<inputs>
<page>
<param name="p1" type="integer" value="1" />
</page>
<page>
<param name="p2" type="integer" value="2" />
</page>
</inputs>
<outputs>
<data format="txt" name="output" />
</outputs>
<tests>
<test>
<param name="p1" value="3" />
<param name="p2" value="4" />
<output name="output">
<assert_contents>
<has_line line="3 4" />
</assert_contents>
</output>
</test>
</tests>
</tool>
+29
View File
@@ -0,0 +1,29 @@
<tool id="multi_select" name="multi_select" version="1.0.0">
<description>multi_select</description>
<configfiles>
<configfile name="config">${select_ex}</configfile>
</configfiles>
<command>cat $config > $output</command>
<inputs>
<param name="select_ex" type="select" display="checkboxes" multiple="true">
<option value="--ex1">Ex1</option>
<option value="ex2">Ex2</option>
<option value="--ex3">Ex3</option>
<option value="--ex4">Ex4</option>
<option value="ex5">Ex5</option>
</param>
</inputs>
<outputs>
<data format="txt" name="output" />
</outputs>
<tests>
<test>
<param name="select_ex" value="--ex1,ex2,--ex3" />
<output name="output">
<assert_contents>
<has_line line="--ex1,ex2,--ex3" />
</assert_contents>
</output>
</test>
</tests>
</tool>
@@ -1,7 +1,12 @@
<?xml version="1.0"?>
<toolbox>
<tool file="upload.xml"/>
<tool file="simple_constructs.xml" />
<tool file="composite.xml" />
<tool file="disambiguate_cond.xml" />
<tool file="multi_repeats.xml"/>
<tool file="multi_page.xml"/>
<tool file="multi_select.xml" />
<tool file="multi_output.xml" />
<tool file="composite_output.xml" />
</toolbox>
@@ -0,0 +1,47 @@
<tool id="simple_constructs" name="simple_constructs">
<command>
echo "$p1.p1val" >> $out_file1;
echo "$booltest" >> $out_file1;
echo "$inttest" >> $out_file1;
echo "$floattest" >> $out_file1;
cat "$files[0].file" >> $out_file1;
</command>
<inputs>
<conditional name="p1">
<param type="boolean" name="p1use" />
<when value="true">
<param name="p1val" value="p1used" type="text" />
</when>
<when value="false">
<param name="p1val" value="p1notused" type="text" />
</when>
</conditional>
<param name="booltest" truevalue="booltrue" falsevalue="boolfalse" checked="false" type="boolean" />
<param name="inttest" value="1" type="integer" />
<param name="floattest" value="1.0" type="float" />
<repeat name="files" title="Files">
<param name="file" type="data" format="txt" />
</repeat>
</inputs>
<outputs>
<data name="out_file1" format="txt" />
</outputs>
<tests>
<test>
<param name="p1use" value="true" />
<param name="booltest" value="true" />
<param name="inttest" value="12456" />
<param name="floattest" value="6.789" />
<param name="file" value="simple_line.txt" /> <!-- This is a line of text. -->
<output name="out_file1">
<assert_contents>
<has_line line="p1used" />
<has_line line="booltrue" />
<has_line line="12456" />
<has_line line="6.789" />
<has_line line="This is a line of text." />
</assert_contents>
</output>
</test>
</tests>
</tool>