<commit_before><project name="SAX-Conformance" default="run">
    <target name="run" depends="setup, expected, test"/>
    <target name="setup">
        <get src="http://www.cafeconleche.org/SAXTest/SAXTest.zip" dest="SAXTest.zip" usetimestamp="true"/>
        <get src="http://www.w3.org/XML/Test/xmlts20080827.zip" dest="xmlts.zip" usetimestamp="true"/>
        
        <unzip src="SAXTest.zip" dest="."/>
        <unzip src="xmlts.zip" dest="SAXTest"/>
    </target>
    
    <target name="expected" description="Generates expected output">
        <ant dir="SAXTest" target="expected" inheritAll="false"/>
        <copy todir="SAXTest/expected">
            <fileset dir="SAXTest/results/preexpected"/>
        </copy>        
    </target>
    
    <target name="test" depends="generate, compare, report"/>
    
    <target name="generate" description="Generate output from JLibs">
        <java dir="SAXTest" fork="true" failOnError="true" classname="com.elharo.saxtest.ConformanceGenerator" 
              output="output.txt" error="error.txt">
            <classpath>
                <pathelement location="SAXTest/build/classes"/>
                <pathelement location="SAXTest/lib/xom-1.0a1.jar"/>
                <pathelement location="SAXTest/lib/xercesImpl.jar"/>
           
                <pathelement location="../../core/target/jlibs-core.jar"/>
                <pathelement location="../../nbp/target/jlibs-nbp.jar"/>
                <pathelement location="../target/jlibs-xml.jar"/>
            </classpath>
            <arg value="jlibs.xml.sax.async.AsyncXMLReader"/> 
        </java>
    </target>
    
    <target name="compare" description="Compare expected output with actual output">
        <java dir="SAXTest" fork="true" classname="com.elharo.saxtest.ResultComparer">
            <classpath>
                <pathelement location="SAXTest/build/classes"/>
                <pathelement location="SAXTest/lib/xom-1.0a1.jar"/>
                <pathelement location="SAXTest/lib/xercesImpl.jar"/>
                <pathelement location="SAXTest/lib/xmlParserAPIs.jar"/>
                <pathelement location="SAXTest/lib/junit.jar"/>
            </classpath>
            <arg value="jlibs.xml.sax.async.AsyncXMLReader"/> 
        </java>
    </target>

    <target name="report" description="Generate Report">
        <xslt style="SAXTest/results.xsl" in="SAXTest/jlibs.xml.sax.async.AsyncXMLReader.xml" out="SAXTest/results.html"/>
    </target>
    
    <target name="clean">
        <delete includeEmptyDirs="true">
            <fileset dir=".">
                <include name="output.txt"/>
                <include name="error.txt"/>
                <include name="SAXTest/**"/>
            </fileset>
        </delete>
    </target>
</project>
<commit_msg>show test report in ant output and fail build if any test failed<commit_after><project name="SAX-Conformance" default="run">
    <target name="run" depends="setup, expected, test"/>
    <target name="setup">
        <get src="http://www.cafeconleche.org/SAXTest/SAXTest.zip" dest="SAXTest.zip" usetimestamp="true"/>
        <get src="http://www.w3.org/XML/Test/xmlts20080827.zip" dest="xmlts.zip" usetimestamp="true"/>
        
        <unzip src="SAXTest.zip" dest="."/>
        <unzip src="xmlts.zip" dest="SAXTest"/>
    </target>
    
    <target name="expected" description="Generates expected output">
        <ant dir="SAXTest" target="expected" inheritAll="false"/>
        <copy todir="SAXTest/expected">
            <fileset dir="SAXTest/results/preexpected"/>
        </copy>        
    </target>
    
    <target name="test" depends="generate, compare, report"/>
    
    <target name="generate" description="Generate output from JLibs">
        <java dir="SAXTest" fork="true" failOnError="true" classname="com.elharo.saxtest.ConformanceGenerator" 
              output="output.txt" error="error.txt">
            <classpath>
                <pathelement location="SAXTest/build/classes"/>
                <pathelement location="SAXTest/lib/xom-1.0a1.jar"/>
                <pathelement location="SAXTest/lib/xercesImpl.jar"/>
           
                <pathelement location="../../core/target/jlibs-core.jar"/>
                <pathelement location="../../nbp/target/jlibs-nbp.jar"/>
                <pathelement location="../target/jlibs-xml.jar"/>
            </classpath>
            <arg value="jlibs.xml.sax.async.AsyncXMLReader"/> 
        </java>
    </target>
    
    <target name="compare" description="Compare expected output with actual output">
        <java dir="SAXTest" fork="true" classname="com.elharo.saxtest.ResultComparer">
            <classpath>
                <pathelement location="SAXTest/build/classes"/>
                <pathelement location="SAXTest/lib/xom-1.0a1.jar"/>
                <pathelement location="SAXTest/lib/xercesImpl.jar"/>
                <pathelement location="SAXTest/lib/xmlParserAPIs.jar"/>
                <pathelement location="SAXTest/lib/junit.jar"/>
            </classpath>
            <arg value="jlibs.xml.sax.async.AsyncXMLReader"/> 
        </java>
    </target>

    <target name="report" description="Generate Report">
        <xslt style="SAXTest/results.xsl" in="SAXTest/jlibs.xml.sax.async.AsyncXMLReader.xml" out="SAXTest/results.html"/>
        <xslt style="report.xsl" in="SAXTest/jlibs.xml.sax.async.AsyncXMLReader.xml" out="report.txt"/>
        <loadfile property="report" srcFile="report.txt"/>
        <delete file="report.txt"/>
        <echo>${report}</echo>
        <echo>Report : SAXTest/results.html</echo>
        <condition property="success">
            <contains string="${report}" substring="Failed : 0"/>
        </condition>
        <fail message="Some Tests Failed" unless="success"/>
    </target>
    
    <target name="clean">
        <delete includeEmptyDirs="true">
            <fileset dir=".">
                <include name="output.txt"/>
                <include name="error.txt"/>
                <include name="SAXTest/**"/>
            </fileset>
        </delete>
    </target>
</project>

{'fraction_non_alphanumeric': 0.1596914492040046, 'fraction_numerical': 0.0050878056786476285, 'mean_word_length': 2.3355227148330595, 'pattern_counts': {'":': 0, '<': 120, '<?xml version=': 0, '>': 120, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5800099', 'n_tokens_mistral': 1892, 'n_tokens_neox': 1826, 'n_words': 294}