diff --git a/tools/diff/diff.xml b/tools/diff/diff.xml index b3070c6903..3ae9bb00b9 100644 --- a/tools/diff/diff.xml +++ b/tools/diff/diff.xml @@ -1,7 +1,7 @@ - + analyzes two files and generates an unidiff text file with information about the differences and an optional Html report - 3.7 + 3.10 0 @@ -13,10 +13,18 @@ '$diff_file'; - #if $generate_report: + diff + #if $report_format.report_format_select == 'txt_lines' or $report_format.report_format_select == 'html' + ## the -u option is needed to convert the output later to HTML + --unified=$report_format.unified + #else if $report_format.report_format_select == 'txt_columns' + -y + #end if + ## If the compared input files differ the diff command returns exit-code 1 + '$input1' '$input2' > '$diff_file' || [ \$? -eq 1 ]; + #if $report_format.report_format_select == 'html' sed -e 's/@@title@@/Diff report for "$input1.element_identifier" and "$input2.element_identifier"/g' - -e 's/@@outputformat@@/'$output_format'/g' + -e 's/@@outputformat@@/'$report_format.output_format'/g' -e '/@@diffoutput@@/{r'$diff_file'' -e ';d}' '$__tool_directory__/template.html' > '$html_file' #end if @@ -25,33 +33,50 @@ - - - - - + + + + + + + + + + + + + + + + + + - generate_report is True + report_format['report_format_select'] == 'html' - + + + - + - + + + @@ -63,7 +88,9 @@ - + + + @@ -73,8 +100,10 @@ - - + + + + @@ -85,8 +114,10 @@ - - + + + + @@ -95,9 +126,12 @@ - - - + + + + + + @@ -169,4 +203,4 @@ An **optional** *HTML report* with a friendlier visual representation of the dif } - + \ No newline at end of file diff --git a/tools/diff/test-data/file 3.txt b/tools/diff/test-data/file3.txt similarity index 100% rename from tools/diff/test-data/file 3.txt rename to tools/diff/test-data/file3.txt diff --git a/tools/diff/test-data/output_test4.txt b/tools/diff/test-data/output_test4.txt new file mode 100644 index 0000000000..db4ccf3cd8 --- /dev/null +++ b/tools/diff/test-data/output_test4.txt @@ -0,0 +1,2 @@ +a a + > b