comparison diff.xml @ 1:02dfbbf869d8 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/diff commit d1ef0f3da4118bf352c5acf720f277fc5ef07665"
author bgruening
date Tue, 14 Apr 2020 13:56:01 -0400
parents 8a18547725cf
children 95a9dc82fc9a
comparison
equal deleted inserted replaced
0:8a18547725cf 1:02dfbbf869d8
1 <tool id="diff" name="diff" version="3.6+galaxy0"> 1 <tool id="diff" name="diff" version="3.6+galaxy1">
2 2
3 <description>analyzes two files and generates a text file with information about the lines that are different</description> 3 <description>analyzes two files and generates an unidiff text file with information about the differences and an optional Html report</description>
4 4
5 <requirements> 5 <requirements>
6 <requirement type="package" version="3.6">diffutils</requirement> 6 <requirement type="package" version="3.6">diffutils</requirement>
7 <requirement type="package" version="4.7">sed</requirement>
7 </requirements> 8 </requirements>
8 9
9 <stdio> 10 <stdio>
10 <exit_code range="2:" level="fatal" description="Something went wrong trying to check differences in files. Please check output log for more details." /> 11 <exit_code range="2:" level="fatal" description="Something went wrong trying to check differences in files. Please check output log for more details." />
11 <regex match="diff: memory exhausted" source="stdout" level="fatal_oom" description="Out of memory error occurred" /> 12 <regex match="diff: memory exhausted" source="stdout" level="fatal_oom" description="Out of memory error occurred" />
12 </stdio> 13 </stdio>
13 14
14 <command ><![CDATA[ 15 <command ><![CDATA[
15 diff -u '$input1' '$input2' > '$output1' 16 diff -u '$input1' '$input2' > '$diff_file';
17 #if $generate_report:
18 sed -e 's/@@title@@/Diff report for '$input1.element_identifier' and '$input2.element_identifier'/g'
19 -e 's/@@outputformat@@/'$output_format'/g'
20 -e '/@@diffoutput@@/{r'$diff_file'' -e ';d}'
21 '$__tool_directory__/template.html' > '$html_file'
22 #end if
16 ]]> 23 ]]>
17 </command> 24 </command>
18 25
19 <inputs> 26 <inputs>
20 <param name="input1" type="data" format="txt" label="First input file" /> 27 <param name="input1" type="data" format="txt" label="First input file" />
21 <param name="input2" type="data" format="txt" label="Second input file" /> 28 <param name="input2" type="data" format="txt" label="Second input file" />
29 <param name="generate_report" type="boolean" checked="true" truevalue="true" falsevalue="false" label="Generate HTML report" help="Generates an HTML report to visualize the differences"/>
30 <param name="output_format" type="select" label="Choose report output format" help="Displays the differences in the report using the selected format. Either line by line or side by side.">
31 <option value="side-by-side">Side by side</option>
32 <option value="line-by-line">Line by line</option>
33 </param>
22 </inputs> 34 </inputs>
23 35
24 <outputs> 36 <outputs>
25 <data name="output1" format="txt" /> 37 <data format="txt" name="diff_file" from_work_dir="output.txt" label="${tool.name} on ${on_string}: Raw Output" />
38 <data format="html" name="html_file" from_work_dir="output.html" label="${tool.name} on ${on_string}: Html Report">
39 <filter>generate_report is True</filter>
40 </data>
26 </outputs> 41 </outputs>
27 42
28 <tests> 43 <tests>
29 <test expect_exit_code="0" expect_failure="false"> 44 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="1">
30 <param name="input1" value="file1.txt" /> 45 <param name="input1" value="file1.txt" />
31 <param name="input2" value="file1.txt" /> 46 <param name="input2" value="file1.txt" />
32 <output name="output1"> 47 <param name="generate_report" value="false" />
48 <output name="diff_file">
33 <assert_contents> 49 <assert_contents>
34 <has_n_lines n="0" /> 50 <has_n_lines n="0" />
35 </assert_contents> 51 </assert_contents>
36 </output> 52 </output>
37 </test> 53 </test>
38 <test expect_exit_code="1" expect_failure="false"> 54 <test expect_exit_code="1" expect_failure="false" expect_num_outputs="1">
39 <param name="input1" value="file1.txt" /> 55 <param name="input1" value="file1.txt" />
40 <param name="input2" value="file2.txt" /> 56 <param name="input2" value="file2.txt" />
41 <output name="output1"> 57 <param name="generate_report" value="false" />
58 <output name="diff_file">
42 <assert_contents> 59 <assert_contents>
43 <has_n_lines n="5" /> 60 <has_n_lines n="5" />
44 <has_line line=" a" /> 61 <has_line line=" a" />
45 <has_line line="+b" /> 62 <has_line line="+b" />
63 </assert_contents>
64 </output>
65 </test>
66 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
67 <param name="input1" value="file1.txt" />
68 <param name="input2" value="file2.txt" />
69 <param name="generate_report" value="true" />
70 <output name="html_file">
71 <assert_contents>
72 <has_text text="!DOCTYPE html" />
73 </assert_contents>
74 </output>
75 </test>
76 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
77 <param name="input1" value="file1.txt" />
78 <param name="input2" value="file2.txt" />
79 <param name="generate_report" value="true" />
80 <param name="output_format" value="side-by-side" />
81 <output name="html_file">
82 <assert_contents>
83 <has_text text="!DOCTYPE html" />
84 <has_text text="side-by-side" />
85 </assert_contents>
86 </output>
87 </test>
88 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
89 <param name="input1" value="file1.txt" />
90 <param name="input2" value="file2.txt" />
91 <param name="generate_report" value="true" />
92 <param name="output_format" value="line-by-line" />
93 <output name="html_file">
94 <assert_contents>
95 <has_text text="!DOCTYPE html" />
96 <has_text text="line-by-line" />
46 </assert_contents> 97 </assert_contents>
47 </output> 98 </output>
48 </test> 99 </test>
49 </tests> 100 </tests>
50 101
67 118
68 .. class:: infomark 119 .. class:: infomark
69 120
70 **Output** 121 **Output**
71 122
72 A *single text file*, either: 123 A *text file*, either:
73 124
74 - containing the lines differences in **unified format** (*unidiff*), 125 - containing the lines differences in **unified format** (*unidiff*),
75 126
76 - or an **empty** file if the two input files are the same. 127 - or an **empty** file if the two input files are the same.
128
129 An **optional** *HTML report* with a friendlier visual representation of the differences.
77 ]]> 130 ]]>
78 </help> 131 </help>
79 132
80 <citations> 133 <citations>
81 <citation type="bibtex"> 134 <citation type="bibtex">
85 title = {diff (GNU diffutils)}, 138 title = {diff (GNU diffutils)},
86 publisher = {The Free Software Foundation (FSF), Inc}, 139 publisher = {The Free Software Foundation (FSF), Inc},
87 url = {http://www.gnu.org/software/diffutils/}, 140 url = {http://www.gnu.org/software/diffutils/},
88 } 141 }
89 </citation> 142 </citation>
143 <citation type="bibtex">
144 @misc{diff2html,
145 author = {Rodrigo Fernandes},
146 year = {2014},
147 title = {Pretty diff to html javascript library (diff2html)},
148 publisher = {Github},
149 url = {https://github.com/rtfpessoa/diff2html},
150 }
151 </citation>
152 <citation type="bibtex">
153 @misc{sed,
154 author = {The Free Software Foundation (FSF), Inc},
155 year = {2017},
156 title = {sed (GNU sed)},
157 publisher = {The Free Software Foundation (FSF), Inc},
158 url = {http://www.gnu.org/software/sed/},
159 }
160 </citation>
90 </citations> 161 </citations>
91 </tool> 162 </tool>