gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
ant - automatic testing tasks, for MJ-WSL and WSL-WSL_T
[mjc2wsl.git] / build.xml
index 84ce509..8381036 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -32,6 +32,8 @@
 
     <property name="transf.wsl.file" value="src-wsl/transf-min.wsl" />
     <property name="transf.wsl.ini" value="transf.ini" />
 
     <property name="transf.wsl.file" value="src-wsl/transf-min.wsl" />
     <property name="transf.wsl.ini" value="transf.ini" />
+    
+    <property name="tests.dir" value="tests" />
 
     <property name="log.dir" value="logs" />
     <property name="log.file.transformations" value="${log.dir}/transformations" />
 
     <property name="log.dir" value="logs" />
     <property name="log.file.transformations" value="${log.dir}/transformations" />
             <param name="file.dir" value="${samples.temp.dir}"/>
         </antcall>
     </target>
             <param name="file.dir" value="${samples.temp.dir}"/>
         </antcall>
     </target>
+    
+    <target name="init-compare">
+        <mkdir dir="${samples.temp.dir}/outputs"/>
+    </target>
+        
+    <target name="test-m-w">
+    
+    <basename property="file.out" file="${inputfile}" suffix=".txt"/>
+    
+        <java classpath="${compiler.class.dir}:${compiler.class.jar}" 
+        classname="${compiler.classname.interpreter}" 
+        input="${inputfile}"
+        error="${samples.temp.dir}/outputs/${file.out}.errmj"
+        output="${samples.temp.dir}/outputs/${file.out}.outmj">
+            <arg value="${file.dir}/${file.name}.obj" />
+        </java>
+        
+        <exec executable="${fermat.dir}/bin/wsl" 
+        input="${inputfile}"
+        error="${samples.temp.dir}/outputs/${file.out}.errwsl"
+        output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
+            <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
+            <env key="FermaT" path="${fermat.dir}" />
+            <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
+            <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
+            <arg value="${file.dir}/${file.name}.wsl"/>
+        </exec>
+        
+        <exec executable="perl" resultproperty="ook">
+            <arg value="lib/compare-m-w.pl"/>
+            <arg value="${file.dir}/outputs"/>
+            <arg value="${file.out}"/>
+        </exec>
+        
+    </target>
+    
+    <target name="test-w-wt">
+    
+    <basename property="file.out" file="${inputfile}" suffix=".txt"/>
+    
+        <exec executable="${fermat.dir}/bin/wsl" 
+        input="${inputfile}"
+        error="${samples.temp.dir}/outputs/${file.out}.errwsl"
+        output="${samples.temp.dir}/outputs/${file.out}.outwsl" >
+            <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
+            <env key="FermaT" path="${fermat.dir}" />
+            <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
+            <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
+            <arg value="${file.dir}/${file.name}.wsl"/>
+        </exec>
+        
+        <exec executable="${fermat.dir}/bin/wsl" 
+        input="${inputfile}"
+        error="${samples.temp.dir}/outputs/${file.out}.errwslt"
+        output="${samples.temp.dir}/outputs/${file.out}.outwslt" >
+            <env key="PATH" path="${fermat.dir}/bin:${env.PATH}"/>
+            <env key="FermaT" path="${fermat.dir}" />
+            <env key="SCHEME_LIBRARY_PATH" path="${fermat.dir}/slib/" />
+            <env key="SCM_INIT_PATH" path="${fermat.dir}/scm/Init5e7.scm" />
+            <arg value="${file.dir}/${file.name}_t.wsl"/>
+        </exec>
+        
+        <exec executable="perl">
+            <arg value="lib/compare-w-wt.pl"/>
+            <arg value="${file.dir}/outputs"/>
+            <arg value="${file.out}"/>
+        </exec>
+    </target>
+
+    <target name="test-fn">
+        <basename property="file.name" file="${filename}" suffix=".obj"/>
+        <dirname property="file.dir" file="${filename}"/>
+        <foreach param="inputfile" target="test-m-w" inheritall="true">
+            <path>
+            <fileset dir='${tests.dir}'>
+                <include name="${file.name}*.txt"/>
+            </fileset>
+            </path>
+        </foreach>
+    </target>
+    
+    <target name="test-fn-t">
+        <basename property="file.name" file="${filename}" suffix="_t.wsl"/>
+        <dirname property="file.dir" file="${filename}"/>
+        <foreach param="inputfile" target="test-w-wt" inheritall="true">
+            <path>
+            <fileset dir='${tests.dir}'>
+                <include name="${file.name}*.txt"/>
+            </fileset>
+            </path>
+        </foreach>
+    </target>
+    
+    <target name="test-all-m" depends="init-compare"
+    description="Run all the tests from the test directory to compare MJ and WSL" >
+        <foreach param="filename" target="test-fn" inheritall="true">
+            <path>
+            <fileset dir='${samples.temp.dir}'>
+                <include name="*.obj"/>
+            </fileset>
+            </path>
+        </foreach>
+    </target>
 
 
+    <target name="test-all-t" depends="init-compare"
+    description="Run all the tests from the test directory to compare WSL and transformations" >
+        <foreach param="filename" target="test-fn-t">
+            <path>
+            <fileset dir='${samples.temp.dir}'>
+                <include name="*_t.wsl"/>
+            </fileset>
+            </path>
+        </foreach>
+    </target>
+    
+    <target name="q-test">
+    <!-- for quick tests -->
+        <antcall target="test-fn">
+            <param name="file.name" value="Rek1"/>
+            <param name="file.dir" value="${samples.temp.dir}"/>
+        </antcall>
+    </target>
+    
     <!-- output serveral versions of files -->
 
     <target name="output-all-versions"
     <!-- output serveral versions of files -->
 
     <target name="output-all-versions"
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner