Last active
August 29, 2015 14:21
-
-
Save pjbriggs/c27e4366dfcdd6d96cb2 to your computer and use it in GitHub Desktop.
Dummy Galaxy tool demonstrating problem with setting value of boolean parameter used as "control" variable in a conditional tag within tool tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo Values are ${@:2} > $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tool id="boolean_issue2" name="Boolean test issue 2" version="1.1"> | |
<description>Demonstrate issue with using booleans in Galaxy tests</description> | |
<command interpreter="bash"> | |
galaxy_boolean_test_issue2.sh | |
$output_1 $bdg1 $bdg_options.bdg2 | |
#if str($bdg_options.bdg2) == 'True' | |
-B2 $bdg_options.spmr | |
#if str($bdg_options.make_bigwig) == 'True' | |
--make-big-wig | |
#end if | |
#end if | |
</command> | |
<inputs> | |
<!-- Normal boolean --> | |
<param name="bdg1" type="boolean" checked="False" | |
truevalue="-B1" falsevalue="" label="Save pileups in bedGraph?" /> | |
<!-- Boolean used for conditional --> | |
<conditional name="bdg_options"> | |
<param name="bdg2" type="boolean" checked="False" | |
truevalue="-B2" falsevalue="" label="Save pileups in bedGraph?" /> | |
<when value="-B2"> | |
<param name="spmr" type="boolean" checked="False" | |
truevalue="--SPMR" falsevalue="" label="Use --SPMR?" /> | |
<param name="make_bigwig" type="boolean" checked="True" | |
truevalue="True" falsevalue="" label="Generate bigWig?" /> | |
</when> | |
<when value=""> | |
<!-- Display nothing --> | |
</when> | |
</conditional> | |
</inputs> | |
<outputs> | |
<data name="output_1" format="txt" label="Values of booleans" /> | |
</outputs> | |
<tests> | |
<test> | |
<!-- #0: don't set any params explicitly --> | |
<output name="output_1"> | |
<assert_contents> | |
<has_line line="Values are False" /> | |
</assert_contents> | |
</output> | |
</test> | |
<test> | |
<!-- #1: set non-conditional boolean only to true --> | |
<param name="bdg1" value="true" /> | |
<output name="output_1"> | |
<assert_contents> | |
<has_line line="Values are -B1 False" /> | |
</assert_contents> | |
</output> | |
</test> | |
<test> | |
<!-- #2: (try to) set conditional boolean to true using 'bdg2' --> | |
<param name="bdg1" value="true" /> | |
<param name="bdg2" value="true" /> | |
<output name="output_1"> | |
<assert_contents> | |
<has_line line="Values are -B1 True -B2 --make-big-wig" /> | |
</assert_contents> | |
</output> | |
</test> | |
<test> | |
<!-- #3: (try to) set conditional boolean to true using 'bdg_options|bdg2'--> | |
<param name="bdg1" value="true" /> | |
<param name="bdg_options|bdg2" value="true" /> | |
<output name="output_1"> | |
<assert_contents> | |
<has_line line="Values are -B1 True -B2 --make-big-wig" /> | |
</assert_contents> | |
</output> | |
</test> | |
<test> | |
<!-- #4: (try to) set conditional boolean to true using 'bdg_options.bdg2' --> | |
<param name="bdg1" value="true" /> | |
<param name="bdg_options.bdg2" value="true" /> | |
<output name="output_1"> | |
<assert_contents> | |
<has_line line="Values are -B1 True -B2 --make-big-wig" /> | |
</assert_contents> | |
</output> | |
</test> | |
<test> | |
<!-- #5: (try to) set conditional boolean to -B2 using 'bdg2' --> | |
<param name="bdg1" value="true" /> | |
<param name="bdg2" value="-B2" /> | |
<output name="output_1"> | |
<assert_contents> | |
<has_line line="Values are -B1 True -B2 --make-big-wig" /> | |
</assert_contents> | |
</output> | |
</test> | |
<test> | |
<!-- #6: (try to) set conditional boolean to -B2 using 'bdg_options|bdg2'--> | |
<param name="bdg1" value="true" /> | |
<param name="bdg_options|bdg2" value="-B2" /> | |
<output name="output_1"> | |
<assert_contents> | |
<has_line line="Values are -B1 True -B2 --make-big-wig" /> | |
</assert_contents> | |
</output> | |
</test> | |
<test> | |
<!-- #7: (try to) set conditional boolean to -B2 using 'bdg_options.bdg2' --> | |
<param name="bdg1" value="true" /> | |
<param name="bdg_options.bdg2" value="-B2" /> | |
<output name="output_1"> | |
<assert_contents> | |
<has_line line="Values are -B1 True -B2 --make-big-wig" /> | |
</assert_contents> | |
</output> | |
</test> | |
</tests> | |
</tool> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment