<commit_before><!--
build.xml

Ant build file for Bio-Formats project.
Download Apache Ant from http://ant.apache.org/.
Type "ant -p" for a list of targets.
-->

<project name="formats" default="jar" basedir=".">
  <description>Build file for Bio-Formats project</description>
  <property name="root.dir" location="../.."/>
  <import file="${root.dir}/ant/java.xml"/>
  <property file="build.properties"/>

  <target name="test" depends="jar,compile-tests,test-no-mdb,test-no-netcdf,
    test-no-poi"
    description="run tests">
    <!-- NOTE: Overrides default "test" target from java.xml -->
    <copy tofile="${build.dir}/testng.xml" overwrite="true"
      file="${tests.dir}/loci/formats/utests/testng.xml"/>
    <testng haltonfailure="true" groups="all" testname="${component.name}">
      <classpath>
        <pathelement location="${test-classes.dir}"/>
        <pathelement location="${classes.dir}"/>
        <pathelement path="${component.runtime-cp}"/>
      </classpath>
      <xmlfileset file="${build.dir}/testng.xml"/>
      <jvmarg value="-mx${testng.memory}"/>
    </testng>
  </target>

  <target name="test-no-mdb" depends="compile-tests"
    description="run missing MDB tools JAR tests" if="doTests">
    <copy tofile="${build.dir}/testng.xml" overwrite="true"
      file="${tests.dir}/loci/formats/utests/testng-no-mdb.xml"/>
    <testng failureProperty="failedTest">
      <classpath>
        <pathelement location="${test-classes.dir}"/>
        <pathelement location="${classes.dir}"/>
        <pathelement path="${component.cp.no-mdb}"/>
      </classpath>
      <xmlfileset file="${build.dir}/testng.xml"/>
      <jvmarg value="-mx${testng.memory}"/>
    </testng>
    <fail if="failedTest"/>
  </target>

  <target name="test-no-netcdf" depends="compile-tests"
    description="run missing NetCDF JAR tests" if="doTests">
    <copy tofile="${build.dir}/testng.xml" overwrite="true"
      file="${tests.dir}/loci/formats/utests/testng-no-netcdf.xml"/>
    <testng failureProperty="failedTest">
      <classpath>
        <pathelement location="${test-classes.dir}"/>
        <pathelement location="${classes.dir}"/>
        <pathelement path="${component.cp.no-netcdf}"/>
      </classpath>
      <xmlfileset file="${build.dir}/testng.xml"/>
      <jvmarg value="-mx${testng.memory}"/>
    </testng>
    <fail if="failedTest"/>
  </target>

  <target name="test-no-poi" depends="compile-tests"
    description="run missing POI JAR tests" if="doTests">
    <copy tofile="${build.dir}/testng.xml" overwrite="true"
      file="${tests.dir}/loci/formats/utests/testng-no-poi.xml"/>
    <testng failureProperty="failedTest">
      <classpath>
        <pathelement location="${test-classes.dir}"/>
        <pathelement location="${classes.dir}"/>
        <pathelement path="${component.cp.no-poi}"/>
      </classpath>
      <xmlfileset file="${build.dir}/testng.xml"/>
      <jvmarg value="-mx${testng.memory}"/>
    </testng>
    <fail if="failedTest"/>
  </target>

  <target name="test-metadata" depends="compile-tests"
    description="test metadata level support for a single file" if="doTests">
    <testng sourcedir="${test.dir}" testname="Metadata tests" failureProperty="failedTest">
      <classpath>
        <pathelement location="${test-classes.dir}"/><commit_msg>Remove log4j. warnings on missing log4j.properties<commit_after><!--
build.xml

Ant build file for Bio-Formats project.
Download Apache Ant from http://ant.apache.org/.
Type "ant -p" for a list of targets.
-->

<project name="formats" default="jar" basedir=".">
  <description>Build file for Bio-Formats project</description>
  <property name="root.dir" location="../.."/>
  <import file="${root.dir}/ant/java.xml"/>
  <property file="build.properties"/>

  <target name="test" depends="jar,compile-tests,test-no-mdb,test-no-netcdf,
    test-no-poi"
    description="run tests">
    <!-- NOTE: Overrides default "test" target from java.xml -->
    <copy tofile="${build.dir}/testng.xml" overwrite="true"
      file="${tests.dir}/loci/formats/utests/testng.xml"/>
    <testng haltonfailure="true" groups="all" testname="${component.name}">
      <classpath>
        <pathelement location="${root.dir}/tools/"/><!-- log4j.properties -->
        <pathelement location="${test-classes.dir}"/>
        <pathelement location="${classes.dir}"/>
        <pathelement path="${component.runtime-cp}"/>
      </classpath>
      <xmlfileset file="${build.dir}/testng.xml"/>
      <jvmarg value="-mx${testng.memory}"/>
      <jvmarg value="-Dlog4j.configuration=file://${root.dir}/tools/log4j.properties"/>
    </testng>
  </target>

  <target name="test-no-mdb" depends="compile-tests"
    description="run missing MDB tools JAR tests" if="doTests">
    <copy tofile="${build.dir}/testng.xml" overwrite="true"
      file="${tests.dir}/loci/formats/utests/testng-no-mdb.xml"/>
    <testng failureProperty="failedTest">
      <classpath>
        <pathelement location="${root.dir}/tools/"/><!-- log4j.properties -->
        <pathelement location="${test-classes.dir}"/>
        <pathelement location="${classes.dir}"/>
        <pathelement path="${component.cp.no-mdb}"/>
      </classpath>
      <xmlfileset file="${build.dir}/testng.xml"/>
      <jvmarg value="-mx${testng.memory}"/>
    </testng>
    <fail if="failedTest"/>
  </target>

  <target name="test-no-netcdf" depends="compile-tests"
    description="run missing NetCDF JAR tests" if="doTests">
    <copy tofile="${build.dir}/testng.xml" overwrite="true"
      file="${tests.dir}/loci/formats/utests/testng-no-netcdf.xml"/>
    <testng failureProperty="failedTest">
      <classpath>
        <pathelement location="${root.dir}/tools/"/><!-- log4j.properties -->
        <pathelement location="${test-classes.dir}"/>
        <pathelement location="${classes.dir}"/>
        <pathelement path="${component.cp.no-netcdf}"/>
      </classpath>
      <xmlfileset file="${build.dir}/testng.xml"/>
      <jvmarg value="-mx${testng.memory}"/>
    </testng>
    <fail if="failedTest"/>
  </target>

  <target name="test-no-poi" depends="compile-tests"
    description="run missing POI JAR tests" if="doTests">
    <copy tofile="${build.dir}/testng.xml" overwrite="true"
      file="${tests.dir}/loci/formats/utests/testng-no-poi.xml"/>
    <testng failureProperty="failedTest">
      <classpath>
        <pathelement location="${root.dir}/tools/"/><!-- log4j.properties -->
        <pathelement location="${test-classes.dir}"/>
        <pathelement location="${classes.dir}"/>
        <pathelement path="${component.cp.no-poi}"/>
      </classpath>
      <xmlfileset file="${build.dir}/testng.xml"/>
      <jvmarg value="-mx${testng.memory}"/>
    </testng>
    <fail if="failedTest"/>
  </target>

  <target name="test-metadata" depends="compile-tests"
    description="test metadata level support for a single file" if="doTests">
    <testng sourcedir="${test.dir}" testname="Metadata tests" failureProperty="failedTest">
      <classpath>
        <pathelement location="${root.dir}/tools/"/><!-- log4j.properties -->
        <pathelement location="${test-classes.dir}"/>
{'fraction_non_alphanumeric': 0.1953311770496414, 'fraction_numerical': 0.0012656447756996202, 'mean_word_length': 3.48989898989899, 'pattern_counts': {'":': 0, '<': 140, '<?xml version=': 0, '>': 140, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 38}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6179123', 'n_tokens_mistral': 2281, 'n_tokens_neox': 2267, 'n_words': 393}