buildframework/helium/tests/minibuilds/ido/hack-test.ant.xml
changeset 628 7c4a911dc066
parent 179 d8ac696cc51f
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
    20 
    20 
    21 ============================================================================
    21 ============================================================================
    22 -->
    22 -->
    23 <project name="hack-test" xmlns:au="org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
    23 <project name="hack-test" xmlns:au="org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium">
    24 
    24 
    25 	<property name="hack.dir" location="${build.drive}/test_hack/"/>
    25     <property name="hack.dir" location="${build.drive}/test_hack/"/>
    26 	
    26     
    27 	<!-- Running hack test. -->
    27     <!-- Running hack test. -->
    28 	<target name="run-hack" depends="prepare-hack,do-hack,cleanup-hack"/>
    28     <target name="run-hack" depends="prepare-hack,do-hack,cleanup-hack"/>
    29 
    29 
    30 	<!-- Getting real file to hack. -->
    30     <!-- Getting real file to hack. -->
    31 	<target name="prepare-hack">
    31     <target name="prepare-hack">
    32 		<mkdir dir="${hack.dir}"/>
    32         <mkdir dir="${hack.dir}"/>
    33 		<copy file="${build.drive}\epoc32\tools\variant\variant.cfg" todir="${hack.dir}" overwrite="true"/>
    33         <copy file="${build.drive}\epoc32\tools\variant\variant.cfg" todir="${hack.dir}" overwrite="true"/>
    34 		<copy file="${build.drive}\epoc32\rom\ppd.oby" todir="${hack.dir}" overwrite="true"/>
    34         <copy file="${build.drive}\epoc32\rom\ppd.oby" todir="${hack.dir}" overwrite="true"/>
    35 		<copy file="${build.drive}\epoc32\data\z\private\10202be9\101F8763.txt" todir="${hack.dir}" overwrite="true"/>
    35         <copy file="${build.drive}\epoc32\data\z\private\10202be9\101F8763.txt" todir="${hack.dir}" overwrite="true"/>
    36 	</target>
    36     </target>
    37 
    37 
    38 	<!-- Cleanup hack area. -->
    38     <!-- Cleanup hack area. -->
    39 	<target name="cleanup-hack">
    39     <target name="cleanup-hack">
    40         <delete verbose="true" includeemptydirs="true">
    40         <delete verbose="true" includeemptydirs="true">
    41             <fileset dir="${hack.dir}/" casesensitive="false">
    41             <fileset dir="${hack.dir}/" casesensitive="false">
    42                 <include name="**"/>
    42                 <include name="**"/>
    43             </fileset>
    43             </fileset>
    44         </delete>
    44         </delete>
    45 	</target>
    45     </target>
    46 
    46 
    47 	<!-- Testing hackMacro by hacking s60.iby and variant.cfg. -->
    47     <!-- Testing hackMacro by hacking s60.iby and variant.cfg. -->
    48 	<target name="do-hack">
    48     <target name="do-hack">
    49 		<!-- Hacking variant.cfg -->
    49         <!-- Hacking variant.cfg -->
    50 		<copy file="${hack.dir}/variant.cfg" tofile="${hack.dir}/variant_hacked.cfg" overwrite="true"/>
    50         <copy file="${hack.dir}/variant.cfg" tofile="${hack.dir}/variant_hacked.cfg" overwrite="true"/>
    51 		<hlm:hackMacro file="${hack.dir}/variant_hacked.cfg" keyword="ENABLE_ABIVX_MODE" regex="(.hrh\s*$)" replace="\1\nENABLE_ABIVX_MODE"/>
    51         <hlm:hackMacro file="${hack.dir}/variant_hacked.cfg" keyword="ENABLE_ABIVX_MODE" regex="(.hrh\s*$)" replace="\1\nENABLE_ABIVX_MODE"/>
    52 		<copy file="${hack.dir}/variant_hacked.cfg" tofile="${hack.dir}/variant_skipped.cfg" overwrite="true"/>
    52         <copy file="${hack.dir}/variant_hacked.cfg" tofile="${hack.dir}/variant_skipped.cfg" overwrite="true"/>
    53 		<hlm:hackMacro file="${hack.dir}/variant_skipped.cfg" keyword="ENABLE_ABIVX_MODE" regex="(.hrh\s*$)" replace="\1\nENABLE_ABIVX_MODE"/>
    53         <hlm:hackMacro file="${hack.dir}/variant_skipped.cfg" keyword="ENABLE_ABIVX_MODE" regex="(.hrh\s*$)" replace="\1\nENABLE_ABIVX_MODE"/>
    54 
    54 
    55 		<au:assertFilesDiffer expected="${hack.dir}/variant.cfg" actual="${hack.dir}/variant_hacked.cfg" />
    55         <au:assertFilesDiffer expected="${hack.dir}/variant.cfg" actual="${hack.dir}/variant_hacked.cfg" />
    56 		<au:assertFilesMatch expected="${hack.dir}/variant_skipped.cfg" actual="${hack.dir}/variant_hacked.cfg" />
    56         <au:assertFilesMatch expected="${hack.dir}/variant_skipped.cfg" actual="${hack.dir}/variant_hacked.cfg" />
    57 
    57 
    58 		<!-- Hacking S60.iby -->
    58         <!-- Hacking S60.iby -->
    59 		<copy file="${hack.dir}/ppd.oby" tofile="${hack.dir}/ppd_hacked.oby" overwrite="true"/>
    59         <copy file="${hack.dir}/ppd.oby" tofile="${hack.dir}/ppd_hacked.oby" overwrite="true"/>
    60 		<hlm:hackMacro file="${hack.dir}/ppd_hacked.oby" keyword="&lt;foo\.iby&gt;" regex="#endif" replace="#include &lt;foo.iby&gt;\n#endif"/>
    60         <hlm:hackMacro file="${hack.dir}/ppd_hacked.oby" keyword="&lt;foo\.iby&gt;" regex="#endif" replace="#include &lt;foo.iby&gt;\n#endif"/>
    61 		<copy file="${hack.dir}/ppd_hacked.oby" tofile="${hack.dir}/ppd_skipped.oby" overwrite="true"/>
    61         <copy file="${hack.dir}/ppd_hacked.oby" tofile="${hack.dir}/ppd_skipped.oby" overwrite="true"/>
    62 		<hlm:hackMacro file="${hack.dir}/ppd_skipped.oby" keyword="&lt;foo\.iby&gt;" regex="#endif" replace="#include &lt;foo.iby&gt;\n#endif"/>
    62         <hlm:hackMacro file="${hack.dir}/ppd_skipped.oby" keyword="&lt;foo\.iby&gt;" regex="#endif" replace="#include &lt;foo.iby&gt;\n#endif"/>
    63 
    63 
    64 		<au:assertFilesDiffer expected="${hack.dir}/ppd.oby" actual="${hack.dir}/ppd_hacked.oby" />
    64         <au:assertFilesDiffer expected="${hack.dir}/ppd.oby" actual="${hack.dir}/ppd_hacked.oby" />
    65 		<au:assertFilesMatch expected="${hack.dir}/ppd_skipped.oby" actual="${hack.dir}/ppd_hacked.oby" />
    65         <au:assertFilesMatch expected="${hack.dir}/ppd_skipped.oby" actual="${hack.dir}/ppd_hacked.oby" />
    66 
    66 
    67 		<!-- Hacking 101F8763.iby -->
    67         <!-- Hacking 101F8763.iby -->
    68 		<copy file="${hack.dir}/101F8763.txt" tofile="${hack.dir}/101F8763_hacked.txt" overwrite="true"/>
    68         <copy file="${hack.dir}/101F8763.txt" tofile="${hack.dir}/101F8763_hacked.txt" overwrite="true"/>
    69 		<hlm:hackMacro file="${hack.dir}/101F8763_hacked.txt" keyword="0xA int 0 0" regex="0xA int 1 0" replace="0xA int 0 0" encoding="UTF16"/>
    69         <hlm:hackMacro file="${hack.dir}/101F8763_hacked.txt" keyword="0xA int 0 0" regex="0xA int 1 0" replace="0xA int 0 0" encoding="UTF16"/>
    70 		<copy file="${hack.dir}/101F8763_hacked.txt" tofile="${hack.dir}/101F8763_skipped.txt" overwrite="true"/>
    70         <copy file="${hack.dir}/101F8763_hacked.txt" tofile="${hack.dir}/101F8763_skipped.txt" overwrite="true"/>
    71 		<hlm:hackMacro file="${hack.dir}/101F8763_skipped.txt" keyword="0xA int 0 0" regex="0xA int 1 0" replace="0xA int 0 0" encoding="UTF16"/>
    71         <hlm:hackMacro file="${hack.dir}/101F8763_skipped.txt" keyword="0xA int 0 0" regex="0xA int 1 0" replace="0xA int 0 0" encoding="UTF16"/>
    72 
    72 
    73 		<au:assertFilesDiffer expected="${hack.dir}/101F8763.txt" actual="${hack.dir}/101F8763_hacked.txt" />
    73         <au:assertFilesDiffer expected="${hack.dir}/101F8763.txt" actual="${hack.dir}/101F8763_hacked.txt" />
    74 		<au:assertFilesMatch expected="${hack.dir}/101F8763_skipped.txt" actual="${hack.dir}/101F8763_hacked.txt" />
    74         <au:assertFilesMatch expected="${hack.dir}/101F8763_skipped.txt" actual="${hack.dir}/101F8763_hacked.txt" />
    75 	</target>
    75     </target>
    76 
    76 
    77 </project>
    77 </project>
    78 
    78