annotate disambiguate_cond.xml @ 1:6fc62e74d7a5

Update disambig cond.
author John Chilton <jmchilton@gmail.com>
date Thu, 18 Feb 2016 12:56:45 +0000
parents 5f452975cfb4
children d372217872de
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
1 <tool id="disambiguate_cond" name="disambiguate_cond">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
2 <command>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
3 echo "$p1.p1v $p2.p2v $p3.p3v" > $out_file1; cat "$files.p4.file" >> $out_file1;
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
4 </command>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
5 <inputs>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
6 <conditional name="p1">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
7 <param type="boolean" name="use" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
8 <when value="true">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
9 <param name="p1v" value="4" type="integer" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
10 </when>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
11 <when value="false">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
12 <param name="p1v" value="7" type="integer" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
13 </when>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
14 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
15 <conditional name="p2">
1
6fc62e74d7a5 Update disambig cond.
John Chilton <jmchilton@gmail.com>
parents: 0
diff changeset
16 <param type="boolean" name="use" label="use p2" />
0
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
17 <when value="true">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
18 <param name="p2v" value="4" type="integer" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
19 </when>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
20 <when value="false">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
21 <param name="p2v" value="7" type="integer" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
22 </when>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
23 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
24 <conditional name="p3">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
25 <param type="boolean" name="use" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
26 <when value="true">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
27 <param name="p3v" value="4" type="integer" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
28 </when>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
29 <when value="false">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
30 <param name="p3v" value="7" type="integer" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
31 </when>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
32 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
33 <conditional name="files">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
34 <param name="attach_files" type="boolean" checked="true" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
35 <when value="true">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
36 <conditional name="p4">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
37 <param type="boolean" name="use" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
38 <when value="true">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
39 <param type="data" name="file" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
40 </when>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
41 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
42 </when>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
43 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
44 </inputs>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
45 <outputs>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
46 <data name="out_file1" format="txt" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
47 </outputs>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
48 <tests interactor="api">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
49 <!-- Can use nested conditional blocks as shown below to disambiguate
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
50 various nested parameters. -->
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
51 <test>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
52 <conditional name="p1">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
53 <param name="use" value="False"/>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
54 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
55 <conditional name="p2">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
56 <param name="use" value="True"/>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
57 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
58 <conditional name="p3">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
59 <param name="use" value="False"/>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
60 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
61 <conditional name="files">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
62 <param name="attach_files" value="True" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
63 <conditional name="p4">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
64 <param name="use" value="True"/>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
65 <param name="file" value="simple_line_alternative.txt" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
66 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
67 </conditional>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
68 <output name="out_file1">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
69 <assert_contents>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
70 <has_line line="7 4 7" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
71 <has_line line="This is a different line of text." />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
72 </assert_contents>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
73 </output>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
74 </test>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
75 <!-- Can also use a more concise, flat verison of this, but it the
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
76 above version is more clear and should be considered preferable.
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
77 -->
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
78 <test>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
79 <param name="p1|use" value="True"/>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
80 <param name="p2|use" value="False"/>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
81 <param name="p3|use" value="True"/>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
82 <param name="p4|use" value="True" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
83 <!-- Only need to specify enough of a suffix to disambiguate,
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
84 but don't do this - it is too clever. -->
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
85 <param name="p4|file" value="simple_line.txt" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
86 <output name="out_file1">
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
87 <assert_contents>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
88 <has_line line="4 7 4" />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
89 <has_line line="This is a line of text." />
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
90 </assert_contents>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
91 </output>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
92 </test>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
93 </tests>
5f452975cfb4 Initial commit.
John Chilton <jmchilton@gmail.com>
parents:
diff changeset
94 </tool>