<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="testsrc" basedir="..">
	<!--
		Location of mozilla/js/tests directory
	-->
	<property name="test.library.dir" location="../tests" />
	
	<!--
		Destination to which testing classes should be built
	-->
	<property name="test.classes" value="${build.dir}/test/classes" />
	
	<!--
		Output directory for HTML files generated by jsdriver
	-->
	<property name="test.output" value="${build.dir}/test/output" />
	
	<!--
		Timeout in milliseconds for tests
	-->
	<property name="test.timeout" value="60000" />
	
	<!--
		Maximum heap size for VM executing test cases.
	-->
	<property name="test.vm.mx" value="256m" />
	
	<!--	
		TODO	Currently JUnit is required in order to compile the test code, which ought not be necessary
	-->
	<target name="compile">
		<mkdir dir="${test.classes}" />
		<javac destdir="${test.classes}" debug="true"
			target="${target-jvm}"
			source="${source-level}"
		>
			<classpath>
				<pathelement path="${classes}" />
			</classpath>
			<src path="testsrc" />
		</javac>
		<copy todir="${test.classes}/org/mozilla/javascript">
			<fileset dir="testsrc/org/mozilla/javascript">
				<include name="*.html"/>
			</fileset>
		</copy>
	</target>
	
	<target name="clean">
		<delete dir="${test.classes}" />
	</target>
	
	<target name="junit" depends="compile">
		<junit printsummary="on" fork="true" forkmode="once" maxmemory="${test.vm.mx}" showoutput="true">
			<sysproperty key="mozilla.js.tests" value="${test.library.dir}" />
			<sysproperty key="mozilla.js.tests.timeout" value="${test.timeout}" />
			<classpath>
				<pathelement location="${xbean.jar}"/>
				<pathelement location="${jsr173.jar}"/>
				<pathelement path="${classes}" />
				<pathelement path="${test.classes}" />
			</classpath>
			<test name="org.mozilla.javascript.StandardTests" />
			<formatter type="plain" usefile="false" />
		</junit>
	</target>
	
	<target name="jsdriver" depends="compile">
		<tstamp>
			<format property="test.timestamp" pattern="yyyy.MM.dd.HH.mm.ss" />
		</tstamp>
		<mkdir dir="${test.output}" />
		<java<commit_msg>Separate compilation of JsDriver from compilation of JUnit-based tests so that JUnit is not required to compile non-JUnit tests<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="testsrc" basedir="..">
	<!--
		Location of mozilla/js/tests directory
	-->
	<property name="test.library.dir" location="../tests" />
	
	<!--
		Destination to which testing classes should be built
	-->
	<property name="test.classes" value="${build.dir}/test/classes" />
	
	<!--
		Output directory for HTML files generated by jsdriver
	-->
	<property name="test.output" value="${build.dir}/test/output" />
	
	<!--
		Timeout in milliseconds for tests
	-->
	<property name="test.timeout" value="60000" />
	
	<!--
		Maximum heap size for VM executing test cases.
	-->
	<property name="test.vm.mx" value="256m" />
	
	<target name="junit-compile" if="test.junit.classpath">
		<javac
			srcdir="testsrc"
			destdir="${test.classes}" debug="true"
			target="${target-jvm}"
			source="${source-level}"
		>
			<classpath>
				<pathelement path="${test.junit.classpath}" />
				<pathelement path="${classes}" />
				<pathelement path="${test-classes}" />
			</classpath>
			<include name="org/mozilla/javascript/StandardTests.java" />
		</javac>
	</target>
	
	<!--
		Set the property test.junit.classpath to the path to the junit classes in order 
		to compile the JUnit version of the tests.  Otherwise, just the 
		command-line JsDriver tests will be compiled.
	-->
	<target name="compile">
		<mkdir dir="${test.classes}" />
		<javac
			srcdir="testsrc"
			destdir="${test.classes}" debug="true"
			target="${target-jvm}"
			source="${source-level}"
		>
			<classpath>
				<pathelement path="${classes}" />
			</classpath>
			<sourcepath path="testsrc" />
			<include name="org/mozilla/javascript/JsDriver.java" />
		</javac>
		<copy todir="${test.classes}/org/mozilla/javascript">
			<fileset dir="testsrc/org/mozilla/javascript">
				<include name="*.html"/>
			</fileset>
		</copy>
		<antcall target="junit-compile" />
	</target>
	
	<target name="clean">
		<delete dir="${test.classes}" />
	</target>
	
	<target name="junit" depends="compile">
		<junit printsummary="on" fork="true" forkmode="once" maxmemory="${test.vm.mx}" showoutput="true">
			<sysproperty key="mozilla.js.tests" value="${test.library.dir}" />
			<sysproperty key="mozilla.js.tests.timeout" value="${test.timeout}" />
			<classpath>
				<pathelement location="${xbean.jar}"/>
				<pathelement location="${jsr173.jar}"/>
				<pathelement path="${classes}" />
				<pathelement path="${test.classes}" />
			</classpath>
			<test name="org.mozilla.javascript.StandardTests" />
			<formatter type="plain" usefile="false" />
		</junit>
	</target>
	
	<target name="jsdriver" depends="compile">
		<tstamp>
			<format property="test.timestamp" pattern="yyyy.MM.dd.HH.mm.ss" />
		</tstamp>
		<mkdir dir="${test.output}" />
		<java
{'fraction_non_alphanumeric': 0.19474001204577393, 'fraction_numerical': 0.0056213611724553305, 'mean_word_length': 3.879529872673849, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 2, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6465861', 'n_tokens_mistral': 1838, 'n_tokens_neox': 1598, 'n_words': 344}