source: MDRepository/trunk/xquery/build-tests.xml @ 827

Last change on this file since 827 was 827, checked in by vronk, 14 years ago

adding build (for tests) + basic version of the test-queries file;
minor but important correction in cmd-model.xqm

File size: 2.9 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!-- ======================================================================= -->
4<!-- eXist build file : Run jUnit tests                                      -->
5<!-- ======================================================================= -->
6<!-- $Id: performance.xml 10021 2009-09-07 10:36:35Z ellefj $ -->
7
8<project default="benchmark" name="cmdi-tests">
9
10  <description>Performance and consistency tests for the CMDI-repository</description>
11       
12  <dirname property="cmdi-tests.basedir" file="${ant.file.cmdi-tests}"/>
13        <property file="${cmdi-tests.basedir}/build-tests.properties"/>
14
15        <!-- import common targets -->
16       
17        <import file="${basedir}/build.xml"/>   
18
19
20<!--    <property name="benchmark.output" value="${junit.reports}/benchmark"/>
21        <property name="benchmark.data" value="${benchmark.output}/data"/>
22-->
23    <property name="benchmark.src" value="${junit.reports}/src"/>
24
25<!--
26    <available property="benchmark.jgoethe.available"
27        file="jgoethe.xml" filepath="${benchmark.data}/jgoethe"/>
28    <available property="benchmark.dblp.available"
29        file="dblp.xml" filepath="${benchmark.data}/dblp"/>
30    <available property="benchmark.imdi.available"
31        file="01_Content.imdi" filepath="${benchmark.data}/imdi"/>
32-->
33    <target name="benchmark" depends="run-benchmark, post-process-benchmark"/>
34
35<!-- install-data-goethe, install-data-dblp, , install-data-imdi -->
36    <target name="run-benchmark" depends="test-compile" 
37            xmlns:test="http://exist-db.org/test">     
38        <typedef resource="org/exist/performance/ant/antlib.xml" uri="http://exist-db.org/test">
39            <classpath>
40                <path refid="classpath.core"/>
41                <path refid="classpath.junit"/>
42            </classpath>
43        </typedef>
44                               
45                                <echo message="queries-file:${test.file}"/> 
46        <delete dir="${tests.output}/temp" failonerror="false"/>
47        <mkdir dir="${tests.output}"/>
48        <mkdir dir="${tests.output}/temp"/>
49       
50       <test:benchmark outputFile="${tests.output}/cmdi-result.xml"
51                source="${test.file}"
52                group="cmdi-tests-cc"/>       
53    </target>
54
55
56    <target name="post-process-benchmark" xmlns:xdb="http://exist-db.org/ant">
57        <typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
58            <classpath refid="classpath.core"/>
59        </typedef>
60
61        <xdb:store uri="${repo.uri}//db/bench" createcollection="true" initdb="true">
62                                                <fileset dir="${tests.output}">
63                <include name="*.xml"/>
64            </fileset>
65        </xdb:store>
66        <xdb:xquery uri="${repo.uri}//db/bench"
67               queryFile="${benchmark.src}/org/exist/performance/log2html.xql"
68                outputProperty="tests.result"/>
69        <echo file="${tests.output}/results.html" message="${tests.result}"/>
70        <copy todir="${tests.output}" file="${benchmark.src}/org/exist/performance/style.css"/>
71    </target>
72
73</project>
Note: See TracBrowser for help on using the repository browser.