|
|
@@ -19,6 +19,9 @@ |
|
|
|
<import file="../../buildfiletest-base.xml"/> |
|
|
|
|
|
|
|
<target name="setUp"> |
|
|
|
<mkdir dir="${input}" /> |
|
|
|
<unzip src="input.zip" dest="${input}"/> |
|
|
|
<unzip src="expected.zip" dest="${input}"/> |
|
|
|
<mkdir dir="${output}" /> |
|
|
|
</target> |
|
|
|
|
|
|
@@ -27,7 +30,7 @@ |
|
|
|
<attribute name="junk" default="" /> |
|
|
|
<attribute name="name" default="Junk@{junk}.java" /> |
|
|
|
<attribute name="file1" default="${output}/@{name}" /> |
|
|
|
<attribute name="file2" default="expected/@{name}" /> |
|
|
|
<attribute name="file2" default="${input}/expected/@{name}" /> |
|
|
|
<sequential> |
|
|
|
<fail message="@{file1} and @{file2} are different"> |
|
|
|
<condition> |
|
|
@@ -40,77 +43,77 @@ |
|
|
|
</macrodef> |
|
|
|
|
|
|
|
<target name="test1" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk1.java" |
|
|
|
javafiles="true" tab="add" eol="crlf" eof="asis" /> |
|
|
|
<assertequal junk="1" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test2" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk2.java" |
|
|
|
javafiles="true" tab="add" cr="add" eol="crlf" eof="asis" /> |
|
|
|
<assertequal junk="2" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test3" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk3.java" |
|
|
|
javafiles="true" tab="remove" eol="lf" eof="asis" /> |
|
|
|
<assertequal junk="3" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test4" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk4.java" |
|
|
|
javafiles="true" tab="remove" eol="lf" eof="asis" /> |
|
|
|
<assertequal junk="4" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test5" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk5.java" |
|
|
|
tab="remove" eol="lf" eof="asis" /> |
|
|
|
<assertequal junk="5" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test6" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk6.java" |
|
|
|
tab="add" cr="remove" eol="crlf" eof="asis" /> |
|
|
|
<assertequal junk="6" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test7" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk7.java" |
|
|
|
tab="add" cr="add" eof="asis" /> |
|
|
|
<assertequal junk="7" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test8" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk8.java" |
|
|
|
javafiles="true" tab="add" cr="add" eof="add" /> |
|
|
|
<assertequal junk="8" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test9" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk9.java" |
|
|
|
javafiles="true" tab="remove" cr="remove" eof="remove" /> |
|
|
|
<assertequal junk="9" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testMacLines" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Mac2Unix" eol="lf" /> |
|
|
|
<assertequal name="Mac2Unix" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testNoOverwrite" depends="test1"> |
|
|
|
<touch file="${output}/Junk1.java" millis="0" /> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="Junk1.java" preservelastmodified="false" |
|
|
|
javafiles="true" tab="add" eol="crlf" eof="asis" /> |
|
|
|
<fail message="overwrote unchanged output file">Q |
|
|
@@ -125,72 +128,72 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testEncoding" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="input.crlf.utf16" |
|
|
|
javafiles="false" cr="remove" encoding="UnicodeBig" /> |
|
|
|
<assertequal file1="${output}/input.crlf.utf16" |
|
|
|
file2="expected/input.lf.utf16" /> |
|
|
|
file2="${input}/expected/input.lf.utf16" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testOutputEncoding" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="input.crlf.utf16" |
|
|
|
javafiles="false" eol="lf" encoding="UnicodeBig" |
|
|
|
outputencoding="ascii" /> |
|
|
|
<assertequal file1="${output}/input.crlf.utf16" |
|
|
|
file2="expected/input.lf.ascii" /> |
|
|
|
file2="${input}/expected/input.lf.ascii" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testLongLines" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="longlines.crlf" |
|
|
|
javafiles="false" cr="remove" /> |
|
|
|
<assertequal file1="${output}/longlines.crlf" |
|
|
|
file2="expected/longlines.lf" /> |
|
|
|
file2="${input}/expected/longlines.lf" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testCrCrLfSequence-unix" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="crcrlf" eol="lf" /> |
|
|
|
<assertequal file1="${output}/crcrlf" |
|
|
|
file2="expected/crcrlf.unix" /> |
|
|
|
file2="${input}/expected/crcrlf.unix" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testCrCrLfSequence-dos" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="crcrlf" eol="crlf" /> |
|
|
|
<assertequal file1="${output}/crcrlf" |
|
|
|
file2="expected/crcrlf.dos" /> |
|
|
|
file2="${input}/expected/crcrlf.dos" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testCrCrLfSequence-mac" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="crcrlf" eol="cr" /> |
|
|
|
<assertequal file1="${output}/crcrlf" |
|
|
|
file2="expected/crcrlf.mac" /> |
|
|
|
file2="${input}/expected/crcrlf.mac" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFixlastDos" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="fixlastfalse.lf" eol="crlf" /> |
|
|
|
<assertequal file1="${output}/fixlastfalse.lf" |
|
|
|
file2="expected/fixlast.dos" /> |
|
|
|
file2="${input}/expected/fixlast.dos" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFixlastFalseMac" depends="setUp"> |
|
|
|
<fixcrlf srcdir="input" destdir="${output}" |
|
|
|
<fixcrlf srcdir="${input}/input" destdir="${output}" |
|
|
|
includes="fixlastfalse.lf" eol="cr" fixlast="false" /> |
|
|
|
<assertequal file1="${output}/fixlastfalse.lf" |
|
|
|
file2="expected/fixlastfalse.mac" /> |
|
|
|
file2="${input}/expected/fixlastfalse.mac" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<!-- Bugzilla Report 20840 --> |
|
|
|
<target name="createParentDirs" depends="setUp"> |
|
|
|
<fixcrlf srcdir="." destdir="${output}" includes="input/Junk1.java" /> |
|
|
|
<fixcrlf srcdir="${input}" destdir="${output}" includes="input/Junk1.java" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFixFile" depends="setUp"> |
|
|
|
<fixcrlf file="input/longlines.crlf" destdir="${output}" /> |
|
|
|
<fixcrlf file="${input}/input/longlines.crlf" destdir="${output}" /> |
|
|
|
<fail message="didn't create output file"> |
|
|
|
<condition> |
|
|
|
<not> |
|
|
@@ -201,17 +204,17 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFixFileExclusive" depends="setUp"> |
|
|
|
<fixcrlf file="input/longlines.crlf" srcdir="input" destdir="${output}"/> |
|
|
|
<fixcrlf file="${input}/input/longlines.crlf" srcdir="${input}/input" destdir="${output}"/> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testPreserveLastModified" depends="setUp"> |
|
|
|
<fixcrlf file="input/longlines.crlf" destdir="${output}" |
|
|
|
<fixcrlf file="${input}/input/longlines.crlf" destdir="${output}" |
|
|
|
preservelastmodified="true" /> |
|
|
|
<fail> |
|
|
|
<condition> |
|
|
|
<not> |
|
|
|
<uptodate srcfile="${output}/longlines.crlf" |
|
|
|
targetfile="input/longlines.crlf" /> |
|
|
|
targetfile="${input}/input/longlines.crlf" /> |
|
|
|
</not> |
|
|
|
</condition> |
|
|
|
</fail> |
|
|
@@ -229,7 +232,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter1" depends="setUp"> |
|
|
|
<copy file="input/Junk1.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk1.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf javafiles="true" tab="add" |
|
|
|
eol="crlf" eof="asis" /> |
|
|
@@ -239,7 +242,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter2" depends="setUp"> |
|
|
|
<copy file="input/Junk2.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk2.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf javafiles="true" tab="add" cr="add" eol="crlf" eof="asis" /> |
|
|
|
</filterchain> |
|
|
@@ -248,7 +251,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter3" depends="setUp"> |
|
|
|
<copy file="input/Junk3.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk3.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf javafiles="true" tab="remove" eol="lf" eof="asis" /> |
|
|
|
</filterchain> |
|
|
@@ -257,7 +260,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter4" depends="setUp"> |
|
|
|
<copy file="input/Junk4.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk4.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf javafiles="true" tab="remove" eol="lf" eof="asis" /> |
|
|
|
</filterchain> |
|
|
@@ -266,7 +269,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter5" depends="setUp"> |
|
|
|
<copy file="input/Junk5.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk5.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf tab="remove" eol="lf" eof="asis" /> |
|
|
|
</filterchain> |
|
|
@@ -275,7 +278,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter6" depends="setUp"> |
|
|
|
<copy file="input/Junk6.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk6.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf tab="add" cr="remove" eol="crlf" eof="asis" /> |
|
|
|
</filterchain> |
|
|
@@ -284,7 +287,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter7" depends="setUp"> |
|
|
|
<copy file="input/Junk7.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk7.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf tab="add" cr="add" eof="asis" /> |
|
|
|
</filterchain> |
|
|
@@ -293,7 +296,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter8" depends="setUp"> |
|
|
|
<copy file="input/Junk8.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk8.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf javafiles="true" tab="add" cr="add" eof="add" /> |
|
|
|
</filterchain> |
|
|
@@ -302,7 +305,7 @@ |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testFilter9" depends="setUp"> |
|
|
|
<copy file="input/Junk9.java" todir="${output}" overwrite="true"> |
|
|
|
<copy file="${input}/input/Junk9.java" todir="${output}" overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf javafiles="true" tab="remove" cr="remove" eof="remove" /> |
|
|
|
</filterchain> |
|
|
@@ -316,8 +319,8 @@ |
|
|
|
<assertequal junk="8" /> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="testTabInLiteralInComment"> |
|
|
|
<copy file="input/tab_in_literal_in_comment" todir="${output}" |
|
|
|
<target name="testTabInLiteralInComment" depends="setUp"> |
|
|
|
<copy file="${input}/input/tab_in_literal_in_comment" todir="${output}" |
|
|
|
overwrite="true"> |
|
|
|
<filterchain> |
|
|
|
<fixcrlf javafiles="true" tab="remove" eol="lf" fixlast="false" /> |
|
|
|