changeset 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
files diff.xml test-data/file 3.txt
diffstat 2 files changed, 55 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/diff.xml	Tue Apr 14 13:56:01 2020 -0400
+++ b/diff.xml	Wed Feb 03 20:49:42 2021 +0000
@@ -1,104 +1,115 @@
-<tool id="diff" name="diff" version="3.6+galaxy1">
-
+<tool id="diff" name="diff" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@">
     <description>analyzes two files and generates an unidiff text file with information about the differences and an optional Html report</description>
-
+    <macros>
+        <token name="@TOOL_VERSION@">3.6</token>
+        <token name="@GALAXY_VERSION@">2</token>
+    </macros>
     <requirements>
-        <requirement type="package" version="3.6">diffutils</requirement>
+        <requirement type="package" version="@TOOL_VERSION@">diffutils</requirement>
         <requirement type="package" version="4.7">sed</requirement>
     </requirements>
-
     <stdio>
-        <exit_code range="2:" level="fatal" description="Something went wrong trying to check differences in files. Please check output log for more details." />
-        <regex match="diff: memory exhausted" source="stdout" level="fatal_oom" description="Out of memory error occurred" />
+        <exit_code range="2:" level="fatal" description="Something went wrong trying to check differences in files. Please check output log for more details."/>
+        <regex match="diff: memory exhausted" source="stdout" level="fatal_oom" description="Out of memory error occurred"/>
     </stdio>
-
-    <command ><![CDATA[
+    <command><![CDATA[
         diff -u '$input1' '$input2' > '$diff_file';
         #if $generate_report:
-            sed -e 's/@@title@@/Diff report for '$input1.element_identifier' and '$input2.element_identifier'/g'
+            sed -e 's/@@title@@/Diff report for "$input1.element_identifier" and "$input2.element_identifier"/g'
                 -e 's/@@outputformat@@/'$output_format'/g'
                 -e '/@@diffoutput@@/{r'$diff_file'' -e ';d}'
                 '$__tool_directory__/template.html' > '$html_file'
         #end if
     ]]>
     </command>
-
     <inputs>
-        <param name="input1" type="data" format="txt" label="First input file" />
-        <param name="input2" type="data" format="txt" label="Second input file" />
+        <param name="input1" type="data" format="txt" label="First input file"/>
+        <param name="input2" type="data" format="txt" label="Second input file"/>
         <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"/>
         <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.">
             <option value="side-by-side">Side by side</option>
             <option value="line-by-line">Line by line</option>
         </param>
     </inputs>
-
     <outputs>
-        <data format="txt" name="diff_file" from_work_dir="output.txt" label="${tool.name} on ${on_string}: Raw Output" />
+        <data format="txt" name="diff_file" from_work_dir="output.txt" label="${tool.name} on ${on_string}: Raw Output"/>
         <data format="html" name="html_file" from_work_dir="output.html" label="${tool.name} on ${on_string}: Html Report">
             <filter>generate_report is True</filter>
         </data>
     </outputs>
-
     <tests>
         <test expect_exit_code="0" expect_failure="false" expect_num_outputs="1">
-            <param name="input1" value="file1.txt" />
-            <param name="input2" value="file1.txt" />
-            <param name="generate_report" value="false" />
+            <param name="input1" value="file1.txt"/>
+            <param name="input2" value="file1.txt"/>
+            <param name="generate_report" value="false"/>
             <output name="diff_file">
                 <assert_contents>
-                    <has_n_lines n="0" />
+                    <has_n_lines n="0"/>
                 </assert_contents>
             </output>
         </test>
         <test expect_exit_code="1" expect_failure="false" expect_num_outputs="1">
-            <param name="input1" value="file1.txt" />
-            <param name="input2" value="file2.txt" />
-            <param name="generate_report" value="false" />
+            <param name="input1" value="file1.txt"/>
+            <param name="input2" value="file2.txt"/>
+            <param name="generate_report" value="false"/>
             <output name="diff_file">
                 <assert_contents>
-                    <has_n_lines n="5" />
-                    <has_line line=" a" />
-                    <has_line line="+b" />
+                    <has_n_lines n="5"/>
+                    <has_line line=" a"/>
+                    <has_line line="+b"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
+            <param name="input1" value="file1.txt"/>
+            <param name="input2" value="file2.txt"/>
+            <param name="generate_report" value="true"/>
+            <output name="html_file">
+                <assert_contents>
+                    <has_text text="!DOCTYPE html"/>
                 </assert_contents>
             </output>
         </test>
         <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
-            <param name="input1" value="file1.txt" />
-            <param name="input2" value="file2.txt" />
-            <param name="generate_report" value="true" />
+            <param name="input1" value="file1.txt"/>
+            <param name="input2" value="file2.txt"/>
+            <param name="generate_report" value="true"/>
+            <param name="output_format" value="side-by-side"/>
             <output name="html_file">
                 <assert_contents>
-                    <has_text text="!DOCTYPE html" />
+                    <has_text text="!DOCTYPE html"/>
+                    <has_text text="side-by-side"/>
                 </assert_contents>
             </output>
         </test>
         <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
-            <param name="input1" value="file1.txt" />
-            <param name="input2" value="file2.txt" />
-            <param name="generate_report" value="true" />
-            <param name="output_format" value="side-by-side" />
+            <param name="input1" value="file1.txt"/>
+            <param name="input2" value="file2.txt"/>
+            <param name="generate_report" value="true"/>
+            <param name="output_format" value="line-by-line"/>
             <output name="html_file">
                 <assert_contents>
-                    <has_text text="!DOCTYPE html" />
-                    <has_text text="side-by-side" />
+                    <has_text text="!DOCTYPE html"/>
+                    <has_text text="line-by-line"/>
                 </assert_contents>
             </output>
         </test>
         <test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
-            <param name="input1" value="file1.txt" />
-            <param name="input2" value="file2.txt" />
-            <param name="generate_report" value="true" />
-            <param name="output_format" value="line-by-line" />
+            <param name="input1" value="file 3.txt"/>
+            <param name="input2" value="file 3.txt"/>
+            <param name="generate_report" value="true"/>
+            <output name="diff_file">
+                <assert_contents>
+                    <has_n_lines n="0"/>
+                </assert_contents>
+            </output>
             <output name="html_file">
                 <assert_contents>
-                    <has_text text="!DOCTYPE html" />
-                    <has_text text="line-by-line" />
+                    <has_text text="!DOCTYPE html"/>
                 </assert_contents>
             </output>
         </test>
     </tests>
-
     <help><![CDATA[
 .. class:: infomark
 
@@ -129,7 +140,6 @@
 An **optional** *HTML report* with a friendlier visual representation of the differences.
     ]]>
     </help>
-
     <citations>
         <citation type="bibtex">
             @misc{gnudiffutils,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/file 3.txt	Wed Feb 03 20:49:42 2021 +0000
@@ -0,0 +1,1 @@
+c