Mercurial > repos > bgruening > diff
comparison diff.xml @ 2:95a9dc82fc9a draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/diff commit 04afacfdfc505fb74219d0e6124afdce61e2ad8f"
author | bgruening |
---|---|
date | Wed, 03 Feb 2021 20:49:42 +0000 |
parents | 02dfbbf869d8 |
children | 156d0908e232 |
comparison
equal
deleted
inserted
replaced
1:02dfbbf869d8 | 2:95a9dc82fc9a |
---|---|
1 <tool id="diff" name="diff" version="3.6+galaxy1"> | 1 <tool id="diff" name="diff" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@"> |
2 | |
3 <description>analyzes two files and generates an unidiff text file with information about the differences and an optional Html report</description> | 2 <description>analyzes two files and generates an unidiff text file with information about the differences and an optional Html report</description> |
4 | 3 <macros> |
4 <token name="@TOOL_VERSION@">3.6</token> | |
5 <token name="@GALAXY_VERSION@">2</token> | |
6 </macros> | |
5 <requirements> | 7 <requirements> |
6 <requirement type="package" version="3.6">diffutils</requirement> | 8 <requirement type="package" version="@TOOL_VERSION@">diffutils</requirement> |
7 <requirement type="package" version="4.7">sed</requirement> | 9 <requirement type="package" version="4.7">sed</requirement> |
8 </requirements> | 10 </requirements> |
9 | |
10 <stdio> | 11 <stdio> |
11 <exit_code range="2:" level="fatal" description="Something went wrong trying to check differences in files. Please check output log for more details." /> | 12 <exit_code range="2:" level="fatal" description="Something went wrong trying to check differences in files. Please check output log for more details."/> |
12 <regex match="diff: memory exhausted" source="stdout" level="fatal_oom" description="Out of memory error occurred" /> | 13 <regex match="diff: memory exhausted" source="stdout" level="fatal_oom" description="Out of memory error occurred"/> |
13 </stdio> | 14 </stdio> |
14 | 15 <command><![CDATA[ |
15 <command ><![CDATA[ | |
16 diff -u '$input1' '$input2' > '$diff_file'; | 16 diff -u '$input1' '$input2' > '$diff_file'; |
17 #if $generate_report: | 17 #if $generate_report: |
18 sed -e 's/@@title@@/Diff report for '$input1.element_identifier' and '$input2.element_identifier'/g' | 18 sed -e 's/@@title@@/Diff report for "$input1.element_identifier" and "$input2.element_identifier"/g' |
19 -e 's/@@outputformat@@/'$output_format'/g' | 19 -e 's/@@outputformat@@/'$output_format'/g' |
20 -e '/@@diffoutput@@/{r'$diff_file'' -e ';d}' | 20 -e '/@@diffoutput@@/{r'$diff_file'' -e ';d}' |
21 '$__tool_directory__/template.html' > '$html_file' | 21 '$__tool_directory__/template.html' > '$html_file' |
22 #end if | 22 #end if |
23 ]]> | 23 ]]> |
24 </command> | 24 </command> |
25 | |
26 <inputs> | 25 <inputs> |
27 <param name="input1" type="data" format="txt" label="First input file" /> | 26 <param name="input1" type="data" format="txt" label="First input file"/> |
28 <param name="input2" type="data" format="txt" label="Second input file" /> | 27 <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"/> | 28 <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."> | 29 <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> | 30 <option value="side-by-side">Side by side</option> |
32 <option value="line-by-line">Line by line</option> | 31 <option value="line-by-line">Line by line</option> |
33 </param> | 32 </param> |
34 </inputs> | 33 </inputs> |
35 | |
36 <outputs> | 34 <outputs> |
37 <data format="txt" name="diff_file" from_work_dir="output.txt" label="${tool.name} on ${on_string}: Raw Output" /> | 35 <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"> | 36 <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> | 37 <filter>generate_report is True</filter> |
40 </data> | 38 </data> |
41 </outputs> | 39 </outputs> |
42 | |
43 <tests> | 40 <tests> |
44 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="1"> | 41 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="1"> |
45 <param name="input1" value="file1.txt" /> | 42 <param name="input1" value="file1.txt"/> |
46 <param name="input2" value="file1.txt" /> | 43 <param name="input2" value="file1.txt"/> |
47 <param name="generate_report" value="false" /> | 44 <param name="generate_report" value="false"/> |
48 <output name="diff_file"> | 45 <output name="diff_file"> |
49 <assert_contents> | 46 <assert_contents> |
50 <has_n_lines n="0" /> | 47 <has_n_lines n="0"/> |
51 </assert_contents> | 48 </assert_contents> |
52 </output> | 49 </output> |
53 </test> | 50 </test> |
54 <test expect_exit_code="1" expect_failure="false" expect_num_outputs="1"> | 51 <test expect_exit_code="1" expect_failure="false" expect_num_outputs="1"> |
55 <param name="input1" value="file1.txt" /> | 52 <param name="input1" value="file1.txt"/> |
56 <param name="input2" value="file2.txt" /> | 53 <param name="input2" value="file2.txt"/> |
57 <param name="generate_report" value="false" /> | 54 <param name="generate_report" value="false"/> |
58 <output name="diff_file"> | 55 <output name="diff_file"> |
59 <assert_contents> | 56 <assert_contents> |
60 <has_n_lines n="5" /> | 57 <has_n_lines n="5"/> |
61 <has_line line=" a" /> | 58 <has_line line=" a"/> |
62 <has_line line="+b" /> | 59 <has_line line="+b"/> |
63 </assert_contents> | 60 </assert_contents> |
64 </output> | 61 </output> |
65 </test> | 62 </test> |
66 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2"> | 63 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2"> |
67 <param name="input1" value="file1.txt" /> | 64 <param name="input1" value="file1.txt"/> |
68 <param name="input2" value="file2.txt" /> | 65 <param name="input2" value="file2.txt"/> |
69 <param name="generate_report" value="true" /> | 66 <param name="generate_report" value="true"/> |
70 <output name="html_file"> | 67 <output name="html_file"> |
71 <assert_contents> | 68 <assert_contents> |
72 <has_text text="!DOCTYPE html" /> | 69 <has_text text="!DOCTYPE html"/> |
73 </assert_contents> | 70 </assert_contents> |
74 </output> | 71 </output> |
75 </test> | 72 </test> |
76 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2"> | 73 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2"> |
77 <param name="input1" value="file1.txt" /> | 74 <param name="input1" value="file1.txt"/> |
78 <param name="input2" value="file2.txt" /> | 75 <param name="input2" value="file2.txt"/> |
79 <param name="generate_report" value="true" /> | 76 <param name="generate_report" value="true"/> |
80 <param name="output_format" value="side-by-side" /> | 77 <param name="output_format" value="side-by-side"/> |
81 <output name="html_file"> | 78 <output name="html_file"> |
82 <assert_contents> | 79 <assert_contents> |
83 <has_text text="!DOCTYPE html" /> | 80 <has_text text="!DOCTYPE html"/> |
84 <has_text text="side-by-side" /> | 81 <has_text text="side-by-side"/> |
85 </assert_contents> | 82 </assert_contents> |
86 </output> | 83 </output> |
87 </test> | 84 </test> |
88 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2"> | 85 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2"> |
89 <param name="input1" value="file1.txt" /> | 86 <param name="input1" value="file1.txt"/> |
90 <param name="input2" value="file2.txt" /> | 87 <param name="input2" value="file2.txt"/> |
91 <param name="generate_report" value="true" /> | 88 <param name="generate_report" value="true"/> |
92 <param name="output_format" value="line-by-line" /> | 89 <param name="output_format" value="line-by-line"/> |
93 <output name="html_file"> | 90 <output name="html_file"> |
94 <assert_contents> | 91 <assert_contents> |
95 <has_text text="!DOCTYPE html" /> | 92 <has_text text="!DOCTYPE html"/> |
96 <has_text text="line-by-line" /> | 93 <has_text text="line-by-line"/> |
94 </assert_contents> | |
95 </output> | |
96 </test> | |
97 <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2"> | |
98 <param name="input1" value="file 3.txt"/> | |
99 <param name="input2" value="file 3.txt"/> | |
100 <param name="generate_report" value="true"/> | |
101 <output name="diff_file"> | |
102 <assert_contents> | |
103 <has_n_lines n="0"/> | |
104 </assert_contents> | |
105 </output> | |
106 <output name="html_file"> | |
107 <assert_contents> | |
108 <has_text text="!DOCTYPE html"/> | |
97 </assert_contents> | 109 </assert_contents> |
98 </output> | 110 </output> |
99 </test> | 111 </test> |
100 </tests> | 112 </tests> |
101 | |
102 <help><![CDATA[ | 113 <help><![CDATA[ |
103 .. class:: infomark | 114 .. class:: infomark |
104 | 115 |
105 **Purpose** | 116 **Purpose** |
106 | 117 |
127 - or an **empty** file if the two input files are the same. | 138 - or an **empty** file if the two input files are the same. |
128 | 139 |
129 An **optional** *HTML report* with a friendlier visual representation of the differences. | 140 An **optional** *HTML report* with a friendlier visual representation of the differences. |
130 ]]> | 141 ]]> |
131 </help> | 142 </help> |
132 | |
133 <citations> | 143 <citations> |
134 <citation type="bibtex"> | 144 <citation type="bibtex"> |
135 @misc{gnudiffutils, | 145 @misc{gnudiffutils, |
136 author = {The Free Software Foundation (FSF), Inc}, | 146 author = {The Free Software Foundation (FSF), Inc}, |
137 year = {2017}, | 147 year = {2017}, |